[MPlayer-users] Trouble playing mpegts containing H264

Keean Schupke k.schupke at imperial.ac.uk
Wed Nov 22 13:13:05 CET 2006


Hi,

I am trying to play an H264 encoded stream from a DVB card. If I run
dvbtune on the card, with the -i flag it tells me I have two streams
with types "27" (H264) and "6".

mplayer (current cvs) however misdetects the stream type (in
libavformat/demux_ts.c) as MPEG2. If I add a print statement arround
line 700:

    if (is_video)
    {
        if((req_vpid == -1) || (req_vpid == es.pid))
        {

+           printf("es type=%x subtype=%x
h264=%x\n",es.type,es.subtype,VIDEO_H264);

             param->vtype = IS_VIDEO(es.type) ? es.type : es.subtype
             param->vpid = es.pid
             video_found = 1;
        }
    }

when I run mplayer I get:

"es type=10000002 subtype=0 h264=10000005"

and the player fails to find the video stream and just plays the audio.

If however I modify the line that sets the video type:

-          param->vtype = IS_VIDEO(es.type) ? es.type : es.subtype
+         param->vtype = VIDEO_H264;

Then the stream plays correctly!

It appears on closer examination the PAT table for the stream does not 
contain information for the video and audio streams, and so mplayer 
falls back to guessing based on the PES stream-id... which is of course 
about as useful as a random guess (in as far as it always chooses MPEG2 
for the video stream, so it works for the current generation of 
broadcast DVB). However "dvbtune -i" correctly finds the H264 stream and 
the audio stream. How is dvbtune picking up this information when 
mplayer cannot? VLC also picks up the correct stream type. VLC uses 
libdvbpsi to parse the streams, perhaps mplayer should use this library too?

Is there any work in progress to fix the mpeg-ts stream type detection?

(I have a temporary fix, that sets the fallback stream type to H264 if 
an environment variable is set, and MPEG2 otherwise, which at least lets 
me play HD streams by hand).

    Regards,
    Keean.






More information about the MPlayer-users mailing list