This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Play H264 MPEG-PES stream

Other Parts Discussed in Thread: DM385

Hi,

i have a question regarding UDP MPEG-PES Stream.

I have a DM385 which encodes a Video in h264 and pack it to MPEG-PES.

On the Client i use mplayer to Play the Video stream.

If I use "-demuxer h264es" in the mplayer i can Play the Video. If i try to use the "-demuxer mpeg-pes" mplayer just says "searching for sequence Header" and Play nothing back.

Is there another way to Play the mpeg-pes stream? Or is there something which i do not understand exactly regarding playing a mpeg-pes stream.

It is possible to dump and open the stream in wireshark, which detects the file as MPEG-PES. The Header and the payload Looks fine.

I hope there is someboady out who can help me.

Regards

Andy

  • Could you provide a short bit-stream?

  • Hi,

    sure i have attached a pes stream captured with mplayer "dumpstream".

    Regards

    Andy

    pes_stream.123
  • by checking , there're errors in the header of the stream.

     .

    Could you give the stream from your platform directly?

    or are you sure this stream is totally the same as the one from your platform.

  • Andreas Werner said:

    Is there another way to Play the mpeg-pes stream? Or is there something which i do not understand exactly regarding playing a mpeg-pes stream.

    I hope there is someboady out who can help me.

    Please download ffmpeg tool(ffplay) and execute "ffplay.exe bitstream"

    and you'll see all messages in your problem bit-stream.

  • Sorry got the wrong file.

    Attached you will find the new one.

    I can Play it with avplay (ffplay) and with mplayer (-demuxer h264es) but not with -demuxer mpegpes.

    I have checked the Header with h264analyze.

    Regards

    Andy

    pes_stream2.123
  • You also have to specify "-fps 60" in mplayer because i am not sending VUI info.

  • hi,

    Andreas Werner said:

    I have checked the Header with h264analyze.

    did you mean the header in your bit-stream is verified without any error?

     

    by checking you BS, we still find

     

    and one more thing, I checked video frame by frame and found following, you may try to play without error concealment. 

     

  • Hi,

    thanks. I will also check this Kind of error. Maybe the stream send is to short, and there are still Errors at the beginning.

    I have checked the Header with h264_analyze to verify if all fields are filled out correctly and if the bitstream length is eqal to the length given in the Header.

    I still do not understand why the stream is playing "almost" good with avplay and mplayer (with -demuxer h264es) but not with "-demxuer mpegpes".

    Do you have any idea about that issue?

    Regards

    Andy

  • By parsing pes header in your BS,

    By checking description of the standard of ITU-T Rec. H.262   

    MPEG-1 refers to ISO/IEC 11172-2 whilst MPEG-2 refers to ISO/IEC 13818-2.

    And you video is H264 (Mpeg4-part10) instead of  MPEG1/MPEG2. That means there's conflict between your header (MPEG1/2) and contents (H264).

    And that might be the root cause about why "-demuxer mpegpes"  will show following 

    It's because the video header of MPEG1/MPEG2 can't be found.

     

  • Hi,

    thanks for the nice Explanation.

    But as I know, it is possible to carry an MPEG4/H264 Stream within a PES.

    The Problem sounds like that mplayer expects MPEG1/2 within PES and cannot find anything else like h264. Or do you mean that the stream ID (0xE0 = MPEG1, -2, -4 Part 2, MPEG-4 Part 10) is the Problem?

    Regards

    Andy

  • But as I know, it is possible to carry an MPEG4/H264 Stream within a PES.

    > Sure . As I checked the standard of H.222, it was described as below

    As your speaking, it looks like something done in mplayer. 

    By checking the source code about flag "-demuxer mpegpes" inside mplayer, 

    As below, we know it just check if your BS is real mpeg video defined in ISO/IEC 13818-2 Video or ISO/IEC 11172-2.

    Others such as MPEG4/H264 were classified as unknown type.

    static int demux_mpg_pes_probe(demuxer_t *demuxer) {
    demuxer->synced = 3;
    return (demux_mpg_probe(demuxer) == DEMUXER_TYPE_MPEG_PS) ? DEMUXER_TYPE_MPEG_PES : DEMUXER_TYPE_UNKNOWN;
    }

    static int demux_mpg_probe(demuxer_t *demuxer) {
    ...
    file_format=DEMUXER_TYPE_MPEG_ES;
    ...
    file_format=DEMUXER_TYPE_MPEG4_ES;
    ...
    file_format=DEMUXER_TYPE_H264_ES;
    ...
    return file_format;
    }

  • Hi,
    yes thats the table i know.

    Maybe i can adapt Mplayer to Support the h264 within PES but i think that will be not easy.
    Do you know any other Player which can Play such Kind of a stream?
    I did not find any alternative till now.

    Regards
    Andy