Page 1 of 2

Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 09:10
by ednys
When choosing a subtitle track, I would like the menu (Video / Subtitle Track) to show us the name of the subtitle file (its language) instead of displaying generic Track 1, Track 2, Track 3...

For exemple, if we have a movie called "Star Trek.avi" and several subtitles in the same folder called "Star Trek.english.srt" "Star Trek.french.srt" "Star Trek.german.srt" "Star Trek.spanish.srt" "Star Trek.director comment.srt" I wish the menu showed this :

Video /
---------Subtitle Track /
--------------------------- english
--------------------------- french
--------------------------- german
--------------------------- spanish
--------------------------- director comment.

and not this :

Video /
---------Subtitle Track /
--------------------------- Track 1
--------------------------- Track 2
--------------------------- Track 3
--------------------------- Track 4
--------------------------- Track 5


(based on what's written before the file extension and after the last dot, as in movie name.language.srt ).
It is confusing to see Track # because obviously we might not know which particular language it refers to!

Thank you!

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 12:20
by Jean-Baptiste Kempf
This is difficult, because there are too many patterns to decide. how to find the language.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 14:15
by kdean
Maybe if a meta-name for the track is not available, just show the filename like:

Track 1 (Star Trek.english.srt)
Track 2 (Star Trek.german.srt)

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 15:03
by ednys
I've seen it on some other media players. (BSPlayer, and others I can't remember the name).

If the file is renamed in a pattern like movie.language.srt , the menu will show "language", (ie : what is on the right of the last dot sign before the extension), but if the file is chaotically named, it will show the whole file name.

It's a matter of organizing our own file names so that VLC display the name right.

Even if VLC could display the name of any compatible subtitle files, located in the video folder, that would be great.
Because the track number is really not conveniant.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 16:01
by Jean-Baptiste Kempf
Using filenames to guess a language is a bad idea compared to having the infos inside the language file.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 17:44
by ednys
Yes, but we don't always have control of how the language file is coded (I suppose you mean some meta tags with info on the language). I don't even see how this info could be coded in a text file like a .srt file...
But what we certainly have is the filename.
It would still be better to see the file name than to see "track 1" or "track 2".... in my opinion. It doesn't matter if what is shown is not truly the name of the language, but what's important is to be able to identify which files refers to Track 1, which files is Track 2, and so on...
I guess it's alphabetical, but it's a pain to have to do some try & error, or to go to the folder and count the files.

I think if a user wants to read relevant information in the subtitle menu, he will be careful to rename the sub files accordingly, so that VLC would pick up what is supposed to be the language name. (in the pattern xxxxxx.yyyyyy.srt where yyyyyy is to identify the language). We just have to agree on this convention.
If the user doesn't care about recognizing subtitles, then it's not a problem, whatever the menu shows will be enough for him.

If the problem is able to notice any subtitle files in the current folder, and build up a list of "Track n", I don't know how hard it is to fetch the file name and add it. Unless it's something very different to do from one OS to the other. (Windows, Linux...)

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 17:47
by Jean-Baptiste Kempf
Patch is welcome :)

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 18:00
by ednys
maybe that's the perfect opportunity for me to try to contribute to the development of the program!
(but i know mostly Java, I'm not sure in which language the program is written)... I have to investigate the DEV section of this...

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Feb 2012 18:25
by Jean-Baptiste Kempf
it should probably be near src/input/input.c and src/input/subtitles.c

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 01 Apr 2012 13:27
by Cymrodor
I think using standard two-letter international language codes at the end of the filenames might be best, so filenames would be ...PDTV.XviD.en.srt, ...PDTV.XviD.es.srt, and so on. In some cases, such as en and es, it may be needed to specify the country, too, e.g. en-GB, en-US, es-ES, es-AR.

Language codes: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Country codes: http://en.wikipedia.org/wiki/ISO_3166-1

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 01 Apr 2012 14:36
by mederi
I agree with previous post. I use Country codes right in front of file extension: EN, DE, SK, CZ, PL, FR, ES, RU, ... For English language I simply use EN, but could be also differentiated as suggested in previous post: EN, EN-US, EN-GB, EN-AU, ... Most countries also use their country code as Top-level domain (TLD) on Internet.
Perhaps it is possible to define a table (an array) of language codes with their descriptions, for example: "en/eng/english"="English", "en-us"="English (US)", "en-gb"="English (GB)", "en-au"="English (AU)", "cz/cs/cze/czech"="Czech", "sk/svk"="Slovak", ... And then to compare last dot-separated part of file name with the defined table to find a possible language description.
--- EDIT ---
Or simply just show the last dot-separated part of file name (max. 10 characters?) in VLC: Video > Subtitle Track > Track 1: EN. There could be also some option in preferences to turn on/off this feature.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Jul 2012 18:18
by saf4vlc
Hi- I was searching for this possibility myself and found this post. Has anything happened with this yet? It would be nice if the program would at least list the filenames of the available .srt files in the folder instead of track 1, track 2, and so on. Then it would be up to the user to make sure the filenames of the .srt matched the language inside the .srt file. It's not like seeing track 1, track 2, and so on alerts me to what the language is of the track anyway. Coming up with some future structured naming convention format architecture compliance, reading in-between the dots, program would be nice too but in the meantime just listing the actual .srt filenames in the subtitle menu would rock. Thanks for this program. vlc is the best.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 05 Aug 2012 06:09
by TheFalcon
I think using standard two-letter international language codes at the end of the filenames might be best, so filenames would be ...PDTV.XviD.en.srt, ...PDTV.XviD.es.srt, and so on. In some cases, such as en and es, it may be needed to specify the country, too, e.g. en-GB, en-US, es-ES, es-AR.

Language codes: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Country codes: http://en.wikipedia.org/wiki/ISO_3166-1
Yes, this would be even better. It's more professional/standard. Some mediaplayers already support this.

I am already using that format for most of the subtitles

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 14 Nov 2012 18:19
by Dr. Crash
it should probably be near src/input/input.c and src/input/subtitles.c
I am willing to give this a try as I am also looking to fix a bug where subtitle tracks whose names contain non-ASCII characters (e.g. "Français" or "Español") get blank entries in the menu. (This is also true in other menus like Video and Audio so this might a problem decoding the names from the m4v in my case.)

As much as I agree that using filenames to convey information about the language is not great that is the only option for SubRip SRTs. So I propose to parse a filename as follows:

<movie basename>.<language info>.srt

and then parse <language info> as: <lang = iso 639 alpha 2>["_" < country = iso 3166 alpha 2>]["-" <optional stuff>]. The combination of lang and country with an underscore is like the locale everybody knows. So for example, one would get:

Some movie.Half-SBS.en.srt => en
Some movie.Half-SBS.fr_CH.srt => fr_CH
Some movie.Half-SBS.fr_CH-forced.srt => fr_CH

I like the idea to just display what was parsed in the menu, e.g. "Track 6 (fr_CH-forced)" in the last example. I also am thinking that if the locale is recognized as something valid, I want to let VLC know about the guess so that it can automatically pick the right subtitles based on language.

How does VLC managed forced subtitles? I set forced information in Subler on a track but don't see VLC switch to those subtitles automatically like iTunes/QT would do when the language track changes. But they're still listed in the menu so at least I can do it by hand.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 16 Nov 2012 13:44
by mederi
I was just thinking again about this. Probably the most universal solution for everybody would be to display the end of filename where the language information should be located: the last dot separated part or just fixed amount of characters (including filename extension?). Then if pointed with a mouse, a full filename should be displayed as a pop-up title or as a next submenu. This way users get information they need, regardless of the way the users use to describe language in subtitle filenames (international codes / names in their native language) or not at all.

Code: Select all

Video > > Subtitle Track > > Track 1 ...EN.srt > Video name.2012.EN.srt > Track 2 ...Français.sub > Some name - Whatever.Français.sub > Track 3 ...r the film.idx/sub > Chinese subtitles for the film.idx/sub
This can be improved with some language codes recognition. Then there are also internal subtitle tracks in multimedia files. This information can be displayed just like for external subtitle files.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 01 Feb 2013 04:45
by waltercacau
Well, I have a working patch with a simple solution. My patch just extracts the string between the last two dots of the filename and sets an internal VLC variable about the language.

So, it works for the cases listed by Dr. Crash

Code: Select all

Some movie.Half-SBS.en.srt => en Some movie.Half-SBS.fr_CH.srt => fr_CH Some movie.Half-SBS.fr_CH-forced.srt => fr_CH
I will try submitting it through the proper channels tomorrow, but if anyone wants to try it out:
https://gist.github.com/4689021

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 01 Feb 2013 17:52
by mederi
Please, could you also include a filename extension? Something like: "en.srt" or "en (srt)". This way users will know, that it is a subtitle file of certain subtitle type. Thanks.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 01 Feb 2013 21:58
by waltercacau
Hi mederi,

I think this can be done with another patch latter. The patch I sent actually uses the structure already in place to tag the subtitle resource with a language.

If anyone wants to give it a shot, the file type can probably be added with a few modifications in the function "EsOutESVarUpdateGeneric" in src/input/es_out.c . Look for the string "Track" in that function and you will find the spot where the string is generated.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 06 Feb 2013 17:56
by Jean-Baptiste Kempf
Thanks for the work.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 18 Jun 2013 12:50
by Cymrodor
I wonder if or when this feature might make it into the player?

It is annoying having to guess which language is 'Track 1' and which is 'Track 2', especially when I guess wrongly and have to get up from the sofa to change it. :)

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 26 Jun 2013 13:59
by penguinball
I love VLC and have been a steady user for many years. However, this issue is pretty annoying. :o
If VLC can automatically detect that there are subtitles in the folder available, why can't it grep out the language? Is it something we could add inside the sub/srt file? Otherwise, the name of the file should be sufficient. Just throwing my support in for this change. If I knew how to program, I would try! It's a little over my head now though. :?

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 28 Jun 2013 19:53
by bosa60
I've seen it on some other media players. (BSPlayer, and others I can't remember the name).

If the file is renamed in a pattern like movie.language.srt , the menu will show "language", (ie : what is on the right of the last dot sign before the extension), but if the file is chaotically named, it will show the whole file name.

It's a matter of organizing our own file names so that VLC display the name right.

Even if VLC could display the name of any compatible subtitle files, located in the video folder, that would be great.
Because the track number is really not conveniant.

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 28 Jun 2013 19:56
by bosa60
:mrgreen: :mrgreen: :mrgreen:

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Jan 2014 18:07
by Giftmugs
I am wondering if something like the following would be possible:
I would be more than happy to just have the "sub-title file name" appear instead of Track 1, Trak 2, etc.
I can rename the .srt file(s) to whatever suits me best (if need be) and then that name would be its trak name.
I load the subtitle files by hand while the video is about to run.
Does this seem possible??
:?:

Re: Subtitles menu - show Name, instead of Track 1, Track 2

Posted: 21 Jan 2014 18:12
by Giftmugs
I am wondering if something like the following would be possible:
I would be more than happy to just have the "sub-title file name" appear instead of Track 1, Track 2, etc.
I can rename the .srt file(s) to whatever suits me best (if need be) and then that name would be its track name.
I load the subtitle files by hand while the video is about to run.
Does this seem possible??
:?: