Automatically choosing the audio stream / subtitle for a given language

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
dteirney Offline
Team-XBMC Developer
Posts: 830
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #1
Before we finish of some work for http://trac.xbmc.org/ticket/1070 and https://github.com/xbmc/xbmc/pull/267 I'd like some input from whomever cares to give it.

This seems reasonable, but I'm not really the target audience.

User can choose to define a "Default Audio Language"
User can choose to define a "Default Subtitle Language"

Choosing the Audio Stream
1) If "Default Audio Language" is set, XBMC looks at all the audio streams in a video and if there is one of the "Default Audio Language" it chooses that.
2) If there is more than one stream with the default audio language it chooses the one with the most number of channels / best codec if same number of channels.
3) If none found with "Default Audio Language" revert to what dvdplayer does already.

Choosing the Subtitle Stream
1) If "Default Subtitle Language" is set, XBMC looks at all the subtitle streams in a video and chooses the first that matches the "Default Subtitle Language" and turns on subtitles.
2) If no match found then see if there is a subtitle stream that matches the "Default Audio Language" with the "forced" flag set on it. I doubt there are many users that would want to set the "Default Audio Stream" and "Default Subtitle Stream" to be the same language. Perhaps those hard of hearing may want to though?
3) If still no matches, revert to what dvdplayer does already.

1a) If "Default Subtitle Language" is not set, and "Default Audio Stream" is set and there is a subtitle stream of "Default Audio Language", should that be turned on if there was no audio stream found for the "Default Audio Language"?

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
(This post was last modified: 2011-07-12 12:26 by dteirney.)
find quote
dteirney Offline
Team-XBMC Developer
Posts: 830
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #2
How to choose the default languages might be worth discussion. There are 143 language codes defined by ISO for the 2 char variants. That's a LOT.

The initial pull request only showed languages for audio streams currently in the XBMC Movie or TV Show library. This should narrow the list down to 1 for a lot of users and likely <5 for a lot of other users (depending on where content is sourced from).

Personally, 143 seems like way too many to choose from...

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
find quote
ezechiel1917 Offline
Aeon Group
Posts: 745
Joined: Jun 2005
Location: Czech Republic
Post: #3
great idea, but it would be great for default subtitle stream to take in mind external subtitles. Not sure about foolproof language codes with that (it's not even necessary to check for them I think - but external subtitles in general would be enough, you don't usually store more than one.)

The idea is to prioritize external subtitles over embedded ones. If you have external subs you want them displayed. Currently you can't set up default subtitles to be the default ones (this used to work though...), if embedded forced subtitle track exist it overrides external subtitles. you have to go to menu and manually select external subtitles.

For my example I would like to be able setup English subtitles as default subtitle language, but if external subs exists when I play the video, use them, if don't check for english embedded subs, if these don't exist , pick forced subs, if no forced subs, don't display any of other embedded subs.

more about current behavior of forced and external subs is explained here: http://trac.xbmc.org/ticket/11724

XBMCbuntu 13.0 | XBMC PRE-14.0 | VDR + VNSI @ Technotrend CT-3650 CI | Transparency! skin | trakt.tv
find quote
joelmeans Offline
Member
Posts: 64
Joined: Jan 2009
Reputation: 0
Post: #4
dteirney Wrote:User can choose to define a "Default Audio Language"
User can choose to define a "Default Subtitle Language"

Choosing the Audio Stream
1) If "Default Audio Language" is set, XBMC looks at all the audio streams in a video and if there is one of the "Default Audio Language" it chooses that.
2) If there is more than one stream with the default audio language it chooses the one with the most number of channels / best codec if same number of channels.
3) If none found with "Default Audio Language" revert to what dvdplayer does already.

This sounds good to me.

Quote:Choosing the Subtitle Stream
1) If "Default Subtitle Language" is set, XBMC looks at all the subtitle streams in a video and chooses the first that matches the "Default Subtitle Language" and turns on subtitles.
2) If no match found then see if there is a subtitle stream that matches the "Default Audio Language" with the "forced" flag set on it. I doubt there are many users that would want to set the "Default Audio Stream" and "Default Subtitle Stream" to be the same language. Perhaps those hard of hearing may want to though?
3) If still no matches, revert to what dvdplayer does already.

Again, this sounds good.

Quote:1a) If "Default Subtitle Language" is not set, and "Default Audio Stream" is set and there is a subtitle stream of "Default Audio Language", should that be turned on if there was no audio stream found for the "Default Audio Language"?

I like this idea. This is probably my most common usage case. If I am watching a Kurosawa film in Japanese, I need the English subtitles on.

So, in the UI, we would want to have a boolean "setDefaultAudioLanguage". If that is set "true", then populate the list of languages in whatever is determined to be the best way. Likewise for subtitle languages. Sound good?
(This post was last modified: 2011-07-12 15:32 by joelmeans.)
find quote
joelmeans Offline
Member
Posts: 64
Joined: Jan 2009
Reputation: 0
Post: #5
dteirney Wrote:How to choose the default languages might be worth discussion. There are 143 language codes defined by ISO for the 2 char variants. That's a LOT.

The initial pull request only showed languages for audio streams currently in the XBMC Movie or TV Show library. This should narrow the list down to 1 for a lot of users and likely <5 for a lot of other users (depending on where content is sourced from).

Personally, 143 seems like way too many to choose from...

Yeah, that is what I was getting at before. I think the complete list is just too long. (At least we aren't looking at the 3-letter codes, with >500.) I just can't imagine someone having a video library full of videos with English, Spanish and French language tracks and thinking "why can't I set Chinese as my default language choice?". However, for subtitles, the situation may be different. Perhaps you just can't find movies with audio in your preferred language, but you can download the srt files. Looking up languages in the database won't account for external subtitles (or did I just miss that in the db?). I am not sure how to handle that part. Perhaps ezechiel1917's idea of prioritizing external subtitles over everything else is the best way to go. It seems like most people aren't going to go to the trouble of getting external subtitle files unless they need to use them. I know I only have them for my non-English language films.
(This post was last modified: 2011-07-12 15:27 by joelmeans.)
find quote
pecinko Offline
Donor
Posts: 3,847
Joined: Dec 2008
Reputation: 53
Location: Prague / Belgrade
Post: #6
dteirney Wrote:1a) If "Default Subtitle Language" is not set, and "Default Audio Stream" is set and there is a subtitle stream of "Default Audio Language", should that be turned on if there was no audio stream found for the "Default Audio Language"?

I agree with all you posted, but in this one I would suggest turning subtitles off. Reasoning is - those who want subtitles should define their language preference, if you don't set it you probably don't want them shown.

In other words - spincontrol that would choose between "No subtitles" and "_values_from_library_". After all, you can always turn subtitles on manually from OSD.

My skins:

Amber
Quartz

find quote
iamGodskid Offline
Junior Member
Posts: 11
Joined: Feb 2011
Reputation: 0
Post: #7
As one who depends heavily on subtitles I can tell you that the 1st choice does not always match the spoken word in the movie or TV series, it not good to automatically select a subtitle, because it may not match and I am therefore having to wait 30 seconds (sometimes longer) to find out what was said sometime I know what the folks will say BEFORE they do (even worse) cause the subtitle is early, so please let us go thru the list of found subtitles until we find one that matches our video. Even worse are the subtitles that someone used a translation program to convert them from another language, cause sometimes the words do not even come close to syncing with what they actually said (it can however be quite funny SmileSmileSmile )
find quote
dteirney Offline
Team-XBMC Developer
Posts: 830
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #8
iamGodskid Wrote:As one who depends heavily on subtitles I can tell you that the 1st choice does not always match the spoken word in the movie or TV series, it not good to automatically select a subtitle, because it may not match and I am therefore having to wait 30 seconds (sometimes longer) to find out what was said sometime I know what the folks will say BEFORE they do (even worse) cause the subtitle is early, so please let us go thru the list of found subtitles until we find one that matches our video. Even worse are the subtitles that someone used a translation program to convert them from another language, cause sometimes the words do not even come close to syncing with what they actually said (it can however be quite funny SmileSmileSmile )

The existing functionality to switch subtitle streams will still exist. The proposed new functionality will just aid in automatically choosing a subtitle stream, if desired. This new functionality doesn't need to be used.

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
find quote
Mindzai Offline
Fan
Posts: 333
Joined: Aug 2010
Reputation: 0
Post: #9
I'm not sure about the idea of basing subtitle language choices on the library. I understand the reasoning, but I think it could lead to a lot of support requests in the forum. Personally, when I'm setting up a new XBMC install, the first thing I do is go through all of the settings and configure them to my requirements. Crucially, I do this before importing anything into the library (after all, it makes sense to configure things like the scraper before doing the import). I would not be surprised if many other people follow this sort of procedure. For me then, I would not be able to select my subtitle language at all. Of course I can come back and set it after populating the library, but that's not necessarily obvious.

Perhaps the best thing would be to provide all languages as options if the library is empty?
find quote
joelmeans Offline
Member
Posts: 64
Joined: Jan 2009
Reputation: 0
Post: #10
Mindzai Wrote:Perhaps the best thing would be to provide all languages as options if the library is empty?

That was my early thought, as well. If the library has been populated, grab the languages from there (for audio and subtitles). Otherwise, just present the entire list.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #11
Question: Are users ever going to want the Audio language setting and Subtitle language setting set to different languages?

If not, no need for 2 lists of languages.

Instead, there'd be a single list for preferred language, and then an additional setting with how it should be preferred. eg. Use the chosen language as audio if present (and forced subs), else use for subs only etc.

Advantage is that the settings are self-explainatory in the edge cases.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
pecinko Offline
Donor
Posts: 3,847
Joined: Dec 2008
Reputation: 53
Location: Prague / Belgrade
Post: #12
jmarshall Wrote:Question: Are users ever going to want the Audio language setting and Subtitle language setting set to different languages?

A lot of them will. I prefer to watch movies with audio language they were filmed as I just can't stand seeing Clint Eastwood speaking Czech. In order to enjoy movies in english I need Czech or Serbian subtitles, though.

EDIT: As a matter of fact, Zeljko has solved it perfectly in XBMC Subtitles. A tighter integration would be awesome - you define your preferences and if subtitles are not found you try to fetch them.

My skins:

Amber
Quartz

(This post was last modified: 2011-07-14 02:32 by pecinko.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #13
@pecinko: That scenario is completely supported under the "Only for subtitles thanks" option that would be in the second spinner.

Point is that noone is going to want Russian audio and Chinese subs for movies that weren't originally filmed in Russian.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
magao Offline
Senior Member
Posts: 160
Joined: Sep 2008
Reputation: 2
Post: #14
The best option IMO is to specify multiple pairs of audio + subtitle. For example, my preference would be:

1. other language audio + english subtitles
2. english audio + english forced subtitles only

Specifically, I would not want other language audio + forced-only or no subtitles in preference to english audio. I can't tell from the above, but it seems like that would not be an option with the proposed implementation.
find quote
dteirney Offline
Team-XBMC Developer
Posts: 830
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #15
pecinko Wrote:A lot of them will. I prefer to watch movies with audio language they were filmed as I just can't stand seeing Clint Eastwood speaking Czech. In order to enjoy movies in english I need Czech or Serbian subtitles, though.

EDIT: As a matter of fact, Zeljko has solved it perfectly in XBMC Subtitles. A tighter integration would be awesome - you define your preferences and if subtitles are not found you try to fetch them.

That would be cool. Specify a "Default Audio Language". If that language isn't found in the audio streams for a video, or in the subtitles then the subtitle of the "Default Audio Language" is downloaded and displayed.

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
find quote
Post Reply