2021-01-02, 00:51
My google fu failed me miserably, so I need your help in developing a small addon.
I have some files with multiple audio and subtitle streams.
Stream #0:0: Video
Stream #0:1: (eng) Audio, Title: English 2.0 channel AAC
Stream #0:2: (eng) Audio, Title: English Commenary 2.0 channel AAC
Stream #0:3: (ger) Audio, Title: German 2.0 channel AAC
Stream #0:4: (eng) Subtitle, Title: English Signs and Songs
Stream #0:5: (eng) Subtitle, Title: English Full Subs
Stream #0:6: (ger) Subtitle, Title: German Signs and Songs
Stream #0:7: (ger) Subtitle, Title: German Full Subs
...
Using the player class'
getSubtitles()
getAvailableSubtitleStreams()
or
xbmc.getInfoLabel('VideoPlayer.SubtitlesLanguage')
I get e.g. "eng" as the current in use subtitle and the list "eng, eng, ger, ger" as the available subtitles.
How can I get the full title of the currently selected and the available streams, so I can reliably tell them apart?
Kodi has this information, as it is shown in the log when playing the file and switching the subtitles will display a popup window which contains the full title.
For audio I have two problems.
There seems to be no function to get the currently selected audio stream? Something like getAudio() would be required? How do I get what audio stream is playing?
getAvailableAudioStreams()
xbmc.getInfoLabel('VideoPlayer.AudioLanguage')
Have the same problem as above. They only use the short "eng, eng, ger" format, which is not distinctive. How can I get the full title, so I can tell the streams apart?
I hope somebody knowledgeable is able to help me. Thank you very much in advance!
I have some files with multiple audio and subtitle streams.
Stream #0:0: Video
Stream #0:1: (eng) Audio, Title: English 2.0 channel AAC
Stream #0:2: (eng) Audio, Title: English Commenary 2.0 channel AAC
Stream #0:3: (ger) Audio, Title: German 2.0 channel AAC
Stream #0:4: (eng) Subtitle, Title: English Signs and Songs
Stream #0:5: (eng) Subtitle, Title: English Full Subs
Stream #0:6: (ger) Subtitle, Title: German Signs and Songs
Stream #0:7: (ger) Subtitle, Title: German Full Subs
...
Using the player class'
getSubtitles()
getAvailableSubtitleStreams()
or
xbmc.getInfoLabel('VideoPlayer.SubtitlesLanguage')
I get e.g. "eng" as the current in use subtitle and the list "eng, eng, ger, ger" as the available subtitles.
How can I get the full title of the currently selected and the available streams, so I can reliably tell them apart?
Kodi has this information, as it is shown in the log when playing the file and switching the subtitles will display a popup window which contains the full title.
For audio I have two problems.
There seems to be no function to get the currently selected audio stream? Something like getAudio() would be required? How do I get what audio stream is playing?
getAvailableAudioStreams()
xbmc.getInfoLabel('VideoPlayer.AudioLanguage')
Have the same problem as above. They only use the short "eng, eng, ger" format, which is not distinctive. How can I get the full title, so I can tell the streams apart?
I hope somebody knowledgeable is able to help me. Thank you very much in advance!