[MPlayer-users] Problem identifying subs

RVM rvm3000 at ya.com
Wed Oct 3 02:06:26 CEST 2007


Hi.

I'm developing a mplayer front-end (smplayer). I'm having a problem with the 
subtitles, I'm not sure about the value I should pass to the slave command 
sub_select.

It seems for audios I have to use the ID that mplayer prints in ID_AUDIO_ID:

ID_AUDIO_ID=0
[Ogg] stream 1: audio (Vorbis), -aid 0
ID_AUDIO_ID=1
[Ogg] stream 2: audio (Vorbis), -aid 1

That works ok. But for subtitles it doesn't seem to be the same case. It seems 
I have to use the position in mplayer's internal list. The ID of the first 
subtitle may be 4 but I have to send sub_select 0, the 2nd may be ID 5 but I 
have to use sub_select 1.

One problem is that mplayer doesn't say in the output what's the position of 
the subtitle in the list. I just figured out that it's the same order on 
which they appear in the output.

That was the way I implemented and it worked well until now.

It seems that now, at least for mp4 files (I don't know others) it requires 
the ID. 

ID_SUBTITLE_ID=2
[mov] Subtitle stream found, -sid 2

If the ID is 2 I have to use sub_select 2, instead of sub_select 0 as before.

Ok, I think this is better. The problem is when several different kind of 
subtitles are used at the same time. Imagine a mp4 or mkv movie with some 
embedded subtitles, plus a *.srt file with the same name which will be loaded 
by mplayer, and the user uses -vobsub to load a idx/sub file, which provides 
more subtitles:

This is what mplayer would print:

// Vobsub subtitles:
ID_VOBSUB_ID=0
ID_VSID_0_LANG=en
ID_VOBSUB_ID=1
ID_VSID_1_LANG=fr
ID_VOBSUB_ID=2
ID_VSID_2_LANG=es
ID_VOBSUB_ID=3
ID_VSID_3_LANG=sr

// Subtitles embedded in mkv:
ID_SUBTITLE_ID=0
ID_SID_0_LANG=spa
ID_SUBTITLE_ID=1
ID_SID_1_LANG=eng
ID_SUBTITLE_ID=2
ID_SID_2_LANG=ger

// Subtitles from srt file:
SUB: Detected subtitle file format: subviewer
SUB: Read 766 subtitles.
SUB: Adjusted 247 subtitle(s).
ID_FILE_SUB_ID=0
ID_FILE_SUB_FILENAME=./Futurama.srt

What subtitles would "sub_select 0" use? The one from vobsub? The one from 
mkv? The srt?

So the question is: how can I really know the value I should use for 
sub_select? Is there any option or something that makes mplayer to print the 
value I have to use?

That would make things a lot easier.

-- 
RVM



More information about the MPlayer-users mailing list