Prioritise external subtitles over internal

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Zarbis Offline
Junior Member
Posts: 17
Joined: Nov 2009
Reputation: 0
Post: #1
For people who's native language is not English pretty common situation where you download episode with English subs in container and then download translated subtitles in .ass or .srt format usually.
Most desktop video players prioritise external subtitles over internal which seems logical because usually user will manually place external subtitles near video with internal subs for a good reason, in my case: native subs over English.
However XBMC gives priority to internal subtitles, which is a bit frustrating to manually switch to external subs each time.
My suggestion is either change default XBMC's behaviour to give priority to external subtitles over internal, or make this an option, either in UI or advancedconfig.xml.
(This post was last modified: 2011-09-24 15:46 by Zarbis.)
find quote
gabbott Offline
Team-Kodi Member
Posts: 1,545
Joined: Jul 2007
Reputation: 27
Post: #2
Maybe this has changed but I'm pretty sure the behavior I'm experiencing with the pre-eden builds is that external sub files are prioritized over subs muxed into the video file.
find quote
Zarbis Offline
Junior Member
Posts: 17
Joined: Nov 2009
Reputation: 0
Post: #3
I've pulled and rebuilt lastest git revision and double-checked issue on several files. On current state internal subs are prioritised.
find quote
ezechiel1917 Offline
Aeon Group
Posts: 745
Joined: Jun 2005
Location: Czech Republic
Post: #4
Unfortunately this is true, I've posted a ticket to trac some time ago:
http://trac.xbmc.org/ticket/11724
Hopefully someone will notice and fix it. It's really inconvenient.

XBMCbuntu 13.0 | XBMC PRE-14.0 | VDR + VNSI @ Technotrend CT-3650 CI | Transparency! skin | trakt.tv
find quote
andreofgyn Offline
Junior Member
Posts: 6
Joined: Oct 2011
Reputation: 0
Thumbs Up   
Post: #5
I noted that xbmc always put the external subtitles as "0" subtitle stream (but not always select it as default), so, here is a workaround for new scanned movies on your library always get external subtitles as default:

Warning: this is a little advanced and I only tested on mysql, backup first!

Open your xbmc_video database, go to the table files and create the following trigger that fires after insert:

Code:
Insert into settings values (new.idFile, 1, 0, 1, 1, 0, -1, 0, 0, 1, 50, 50, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);

The trick is create a new default setting with subtitle stream "0" for each new file/movie scanned. I used the default values of xbmc settings, you can set each field/value as you wish.
(This post was last modified: 2011-10-21 09:35 by andreofgyn.)
find quote
ezechiel1917 Offline
Aeon Group
Posts: 745
Joined: Jun 2005
Location: Czech Republic
Post: #6
interesting workaround, how does it work if you don't have external subtitle for the movie/video, does it still respect default and forced flags of embedded subtitles, so if there is no external subtitle found will there be subs displayed if they have default / forced flag?
Also besides adding this for each new file I'd need it also for every file already existing in db.
And how does this work If I set different values as default in xbmc gui, will these settings overrides the ones in DB?

I'd still prefer proper fix from xbmc team, it's really not comfortable clicking through the subtitles streams in gui to get external subtitle displayed... It has always worked before, so far nobody even confirmed whether this is just a bug, which will be fixed sometime or new default behavior and the reason behind it.

XBMCbuntu 13.0 | XBMC PRE-14.0 | VDR + VNSI @ Technotrend CT-3650 CI | Transparency! skin | trakt.tv
find quote
buyukbang Offline
Junior Member
Posts: 1
Joined: Dec 2011
Reputation: 0
Post: #7
Thanks for the tip, but unfortunately this method causes some problems. Given line has some values that darken my display when playing movies. Do not try to use directly these values.

I also tried just setting the 6th and 8th columns that is related with the subtitle, but this way also causes problems which makes XBMC confused.

Since every column has a meaning here, I think the best idea is to use the default values set on your system.

I created a simple .bat file for windows. You can modify below commands to use in your system. Just download and use sqlite, modify below commands then run them once:

"c:\batch\sqlite\sqlite3.exe" "C:\Users\YOUR_USERNAME\AppData\Roaming\XBMC\userdata\Database\MyVideos58.db" "delete from settings;"

"c:\batch\sqlite\sqlite3.exe" "C:\Users\YOUR_USERNAME\AppData\Roaming\XBMC\userdata\Database\MyVideos58.db" "insert into settings select new.idfile,...................... from files"

"c:\batch\sqlite\sqlite3.exe" "C:\Users\YOUR_USERNAME\AppData\Roaming\XBMC\userdata\Database\MyVideos58.db" "drop trigger external_subtitle;"

"c:\batch\sqlite\sqlite3.exe" "C:\Users\YOUR_USERNAME\AppData\Roaming\XBMC\userdata\Database\MyVideos58.db" "create trigger external_subtitle after insert on files for each row begin insert into settings values new.idfile,...................... ; end;"





andreofgyn Wrote:I noted that xbmc always put the external subtitles as "0" subtitle stream (but not always select it as default), so, here is a workaround for new scanned movies on your library always get external subtitles as default:

Warning: this is a little advanced and I only tested on mysql, backup first!

Open your xbmc_video database, go to the table files and create the following trigger that fires after insert:

Code:
Insert into settings values (new.idFile, 1, 0, 1, 1, 0, -1, 0, 0, 1, 50, 50, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);

The trick is create a new default setting with subtitle stream "0" for each new file/movie scanned. I used the default values of xbmc settings, you can set each field/value as you wish.
(This post was last modified: 2011-12-31 22:32 by buyukbang.)
find quote
arty1977 Offline
Junior Member
Posts: 1
Joined: Jan 2012
Reputation: 0
Post: #8
terrible, annoying behaviour in eden builds indeed Sad hope this silly bug gets fixed soon!
find quote