[MPlayer-users] switch_audio on *.ts files

rvm rvm3000 at gmail.com
Thu Jun 18 12:12:29 CEST 2009


2009/6/18 Nico Sabbi <Nicola.Sabbi at poste.it>:
> On Thursday 18 June 2009 03:59:08 RVM wrote:
>> Tested with MPlayer SVN-r29355.
>>
>> I've got a ts file with two audio tracks, reported this way by
>> mplayer:
>>
>> ID_AUDIO_ID=1403
>> ID_AUDIO_ID=1402
>>
>> If I try to change the audio track with the switch_audio command,
>> using the ID as parameter (1402 or 1403), it doesn't work, the
>> audio doesn't change. I have to use instead the numbers 0 and 1 (0
>> selects the first audio track, 1 the second).
>>
>> But wouldn't be the correct to use the ID number?
>
> I don't remember if the behaviour has changed since I implemented the
> switch_audio command, but at the time it took 1402 and 1403

Well, it seems it doesn't work that way now :(

>> I think to remember that at least for DVDs the ID was required.
>>
>> This is what http://www.mplayerhq.hu/DOCS/tech/slave.txt says about
>> it:
>>
>> switch_audio [value] (currently MPEG*, AVI, Matroska and streams
>> handled by libavformat)
>>     Switch to the audio track with the ID [value]. Cycle through
>> the available tracks if [value] is omitted or negative.
>>
>> BTW, there's another problem. Initially mplayer reports this:
>>
>> ID_AID_1403_LANG=eng
>> ID_AID_1402_LANG=spa
>>
>> But some lines below says this:
>>
>> ID_AID_1403_LANG=spa
>> ID_AID_1402_LANG=spa
>>
>> which is wrong.
>
> what's reported is what is read from the PMT, it may be broken.
> Did you try to run decode_pat and decode_pmt on that stream?
> They are included in the examples/ directory of libdvbpsi.
> dvbsnoop is another all-in-one tool to examine TS streams, but it's
> very difficult to use.

 ./decode_pat ~/Videos/ts/Providence.m2t

New PAT
  transport_stream_id : 187
  version_number      : 0
    | program_number @ [NIT|PMT]_PID
    |              0 @ 0x10 (16)
    |           1000 @ 0xff (255)
  active              : 1

./decode_pmt ~/Videos/ts/Providence.m2t 1000 255

New active PMT
  program_number : 1000
  version_number : 0
  PCR_PID        : 0x579 (1401)
    | type @ elementary_PID
    | 0x02 (ISO/IEC 13818-2 Video) @ 0x579 (1401)
    |  ] 0x07 : �$"
    |  ] 0x11 : "�"
    | 0x04 (ISO/IEC 13818-3 Audio) @ 0x57a (1402)
    |  ] 0x0a : "spa"
    | 0x04 (ISO/IEC 13818-3 Audio) @ 0x57b (1403)
    |  ] 0x0a : "eng"
    | 0x06 (ISO/IEC 13818-1 Private PES data packets) @ 0x57e (1406)
    |  ] 0x59 : 1 subtitles,
       | 0 - lang: spa, type: 16, cpid: 4, apid: 5

-- 
RVM


More information about the MPlayer-users mailing list