• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
[RELEASE] Video language script for audio & subtitle streams
#1
Hi,

there is currently no other way to show the language of all audio & subtitle streams of a video file than adding the language(s) to the filename and display images with substring conditions. Since XBMC already extracts all those infos (we just don't have the necessary info labels), I decided to make a small script which sets properties for the languages in the video info dialog.

You have to add this to DialogVideoInfo.xml
<onload condition="System.HasAddon(script.videolanguage) + [Container.Content(movies) | Container.Content(episodes)]">RunScript(script.videolanguage,movieid=$INFO[ListItem.DBID])</onload>


Then you can access the following properties in the video info dialog
PHP Code:
Window.Property(AudioLanguage.%d)
Window.Property(SubtitleLanguage.%d

Quick example
PHP Code:
<control type="grouplist">
    [...]
    <
control type="image">
        <
width>48</width>
        <
height>48</height>
        <
texture>$INFO[Window.Property(AudioLanguage.1),flags/language/,.png]</texture>
        <
visible>!IsEmpty(Window.Property(AudioLanguage.1))</visible>
    </
control>
    <
control type="image">
        <
width>48</width>
        <
height>48</height>
        <
texture>$INFO[Window.Property(AudioLanguage.2),flags/language/,.png]</texture>
        <
visible>!IsEmpty(Window.Property(AudioLanguage.2))</visible>
    </
control>
    [...]
</
control

I did some quick testing and it seems to work fine but you never know. Suggestions are welcome. Smile

GitHub
Image
Reply
#2
Nice one ! Going to test it the next days...
Thanx mate
Reply
#3
nice work. thx.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#4
Nice work black.

Whatever happened to the request anyway?
Reply
#5
Hi,
I wasn't around much last month so I guess I missed request for this.

I'd say that now there is no good way to pass data containing multiple entries/items (i.e. cast list, album's track list, subtitles/audio streams list) to skin. We usually hardcode some list id to fill it with items (cast / track list). We need to add some mechanism to automate control/items creation, for example:

1.
Code:
<control type="grouplist">
    [...]
    <template end="$INFO[Window.Property(AudioLanguage.Count)]" begin="1" step="1"> <!-- begin and step could be optional -->
        <control type="image">
            <width>48</width>
            <height>48</height>
            <texture>$INFO[Window.Property(AudioLanguage.%d),flags/language/,.png]</texture>
        </control>
    </template>
    [...]
</control>
and/or
2.
Code:
<control type="grouplist">
    [...]
    <template source="AudioLanguages">
        <control type="image">
            <width>48</width>
            <height>48</height>
            <texture>$INFO[Entry,flags/language/,.png]</texture> <!-- for complex types like cast things like Entry.ActorName, EntryRole could be used -->
        </control>
    </template>
    [...]
</control>
This could be used in grouplists and static containers. I remember there was idea like this before but I never got to do anything in this direction.

After having such mechanism in place it would be really easy to add access to audio/subtitles streams (plus it would allow some nice stuff to be done with VideoPlayer.Cast)
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#6
@pieh
That would be nice. 2. example looks ok to me, maybe with begin, step and most importantly number of max items. The source could maybe better ListItem.AudioLanguages instead of just AudioLanguages.
Image
Reply
#7
I use the skin Aeon Nox that recently has included this script in the latest git, but the Languages don't show for me.
Here you have the log. Is there any error?

http://www.xbmclogs.com/show.php?id=1177

Thanks!!

I use XBMC (12.0), Platform: Linux (Ubuntu 12.04 LTS - XBMCbuntu, 3.2.0-37-generic-pae i686). Built on Feb 7 2013
Reply
#8
Your video file has no language in the audio stream.
Image
Reply
#9
would be nice if you could also add

self.window.setProperty('AudioCodec.%d' % count, item['codec'])

and

self.window.setProperty('AudioChannels.%d' % count, item['channels'])

to the script.

( + putting the script on GitHub Smile )

cheers.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#10
Will do. Should also be no problem to submit it to the official repo.

Edit: https://github.com/Black09/script.videolanguage
Image
Reply
#11
(2013-02-25, 14:04)`Black Wrote: Your video file has no language in the audio stream.

How can I add this language in the audio stream to my films? Thanks
Reply
#12
I have a video that has a language set to "hin" but i only see english in the video info dialog. Using Aeon Nox latest git.

http://www.xbmclogs.com/show.php?id=1204

Is it supposed to change the language of the plot automatically to hindi in this case? or am i missing something
Intel® Quad Core i5 Sandybridge @3.40GHz | ASRock Z775 Mobo 8GB DDR3 Ram | Logitech K400 Keyboard |
| Logitec Harmony 550 Remote| 46' Samsung LCD TV | Onkyo TX-S605 w/ Bose 5.1 Surround
Reply
#13
It won't change the plot language, you have to configure that in the scraper. If you don't see a flag image for hindi, I guess there simply is no hin.png available.

@ferent
Google it.
Image
Reply
#14
(2013-02-26, 13:35)`Black Wrote: It won't change the plot language, you have to configure that in the scraper. If you don't see a flag image for hindi, I guess there simply is no hin.png available.

Ah ok that explains. I do see the flag image but was not sure how the plot comes in a different language. Thanks for this amazing feature.
Intel® Quad Core i5 Sandybridge @3.40GHz | ASRock Z775 Mobo 8GB DDR3 Ram | Logitech K400 Keyboard |
| Logitec Harmony 550 Remote| 46' Samsung LCD TV | Onkyo TX-S605 w/ Bose 5.1 Surround
Reply
#15
awesome work first off all Big Grin

1 question i have and i should mention i have ony a general idea how this works so no flaming me please Big Grin. pretty much all my movies and tvshow episodes have a seperate subtitle file wich is names exactly as the movie or show
small example
Pulp Fiction.mkv
Pulp Fiction-EN.srt

is it possible that it sees the .srt file and add the flag ?
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Video language script for audio & subtitle streams3