Re: [vdr] vdr + h264
On 01/15/08 08:53, Stefan Lucke wrote: On Tuesday 15 January 2008, Reinhard Nissl wrote: Hi, Stefan Lucke schrieb: is it correct that h264 is written as PES via PlayVideo() ? For decoding with ffmpeg it would be useful to have a PROGRAM_STREAM_MAP in front of a new video stream. Basically not a bad idea, but where do you put it in live streaming? I think it should be transmitted first, after a stream reset. A basic PSM that maps from PES 0x01e0 to h264 could look like: unsigned char psm_map_0xe0_to_h264 [] = { 0x00, 0x00, 0x01, 0xbc, 0x00, 0x10, // psm length 0x00, 0x00, // unknown 0x00, 0x00, // info length // info data here 0x00, 0x04 // map length // map data here 0x1b, 0xe0, 0x00, 0x00 // h264 map entry / NO map info 0x00, 0x00, 0x00, 0x00 // crc32 }; That is inspired by ffmpegs: libavformat/mpeg.c mpegps_psm_parse() line ~220 . Or after a seek in VDR's recording player? By above, it's just (pinned) at the beginning of the file. Don't know if we should expect changes in between (but all bad things happen). Mplayer does some nice tests to determine PES vs. ES. It has just not been extended to detect H.264 in the same way. Aren't users beeing told to feed mplayer with PSM too ? H.264 uses a limited start code set compared to MPEG1/2 so it should be easy to detect the content, due to the distribution of start codes. Why does H.264 have to be such a broken format? MPEG2 can be handled just fine in PES, why can't H.264 be, too? Why can't H.264 video packets be recognized as such all by themselves, just like MPEG2 or MPEG1 packets are? Klaus ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr + h264
On Tuesday 15 January 2008, Stefan Lucke wrote: On Tuesday 15 January 2008, Reinhard Nissl wrote: Hi, Stefan Lucke schrieb: is it correct that h264 is written as PES via PlayVideo() ? For decoding with ffmpeg it would be useful to have a PROGRAM_STREAM_MAP in front of a new video stream. Basically not a bad idea, but where do you put it in live streaming? I think it should be transmitted first, after a stream reset. A basic PSM that maps from PES 0x01e0 to h264 could look like: unsigned char psm_map_0xe0_to_h264 [] = { 0x00, 0x00, 0x01, 0xbc, 0x00, 0x10, // psm length 0x00, 0x00, // unknown 0x00, 0x00, // info length // info data here 0x00, 0x04 // map length // map data here 0x1b, 0xe0, 0x00, 0x00 // h264 map entry / NO map info 0x00, 0x00, 0x00, 0x00 // crc32 }; That is inspired by ffmpegs: libavformat/mpeg.c mpegps_psm_parse() line ~220 . And now I know that softdevice can switch between h264 and mpeg2 when using the following addition (file remux.c line ~2552): #define TEST_cVideoRepacker #ifdef TEST_cVideoRepacker ts2pes[numTracks++] = new cTS2PES(VPid, resultBuffer, IPACKS, 0xE0, 0x00, new cVideoRepacker(h264)); #else ts2pes[numTracks++] = new cTS2PES(VPid, resultBuffer, IPACKS, 0xE0); #endif -- cut -- if (h264) { resultBuffer-Put (psm_map_0xe0_to_h264, sizeof (psm_map_0xe0_to_h264)); fprintf(stderr, is h264\n); } else { fprintf(stderr, is NO h264\n); } -- cut -- The bad thing is, PSM info should be repeated more often, as the decoder may reset itself due to bad reception (ahead of each video packet ??). Or is there a simpler way to recognize h264 (or other codecs) as Klaus demands? Stefan Lucke ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr + h264
Hi, Stefan Lucke schrieb: The bad thing is, PSM info should be repeated more often, as the decoder may reset itself due to bad reception (ahead of each video packet ??). Or is there a simpler way to recognize h264 (or other codecs) as Klaus demands? In VDR context, you may want to use cRemux::IsFrameH264() on the first PES-Paket of a frame to detect H.264. Bye. -- Dipl.-Inform. (FH) Reinhard Nissl mailto:[EMAIL PROTECTED] ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
[vdr] vdr + h264
Hi, is it correct that h264 is written as PES via PlayVideo() ? For decoding with ffmpeg it would be useful to have a PROGRAM_STREAM_MAP in front of a new video stream. -- Stefan Lucke ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr + h264
Hi, Stefan Lucke schrieb: is it correct that h264 is written as PES via PlayVideo() ? For decoding with ffmpeg it would be useful to have a PROGRAM_STREAM_MAP in front of a new video stream. Basically not a bad idea, but where do you put it in live streaming? Or after a seek in VDR's recording player? Mplayer does some nice tests to determine PES vs. ES. It has just not been extended to detect H.264 in the same way. H.264 uses a limited start code set compared to MPEG1/2 so it should be easy to detect the content, due to the distribution of start codes. Bye. -- Dipl.-Inform. (FH) Reinhard Nissl mailto:[EMAIL PROTECTED] ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Re: [vdr] vdr + h264
On Tuesday 15 January 2008, Reinhard Nissl wrote: Hi, Stefan Lucke schrieb: is it correct that h264 is written as PES via PlayVideo() ? For decoding with ffmpeg it would be useful to have a PROGRAM_STREAM_MAP in front of a new video stream. Basically not a bad idea, but where do you put it in live streaming? I think it should be transmitted first, after a stream reset. A basic PSM that maps from PES 0x01e0 to h264 could look like: unsigned char psm_map_0xe0_to_h264 [] = { 0x00, 0x00, 0x01, 0xbc, 0x00, 0x10, // psm length 0x00, 0x00, // unknown 0x00, 0x00, // info length // info data here 0x00, 0x04 // map length // map data here 0x1b, 0xe0, 0x00, 0x00 // h264 map entry / NO map info 0x00, 0x00, 0x00, 0x00 // crc32 }; That is inspired by ffmpegs: libavformat/mpeg.c mpegps_psm_parse() line ~220 . Or after a seek in VDR's recording player? By above, it's just (pinned) at the beginning of the file. Don't know if we should expect changes in between (but all bad things happen). Mplayer does some nice tests to determine PES vs. ES. It has just not been extended to detect H.264 in the same way. Aren't users beeing told to feed mplayer with PSM too ? H.264 uses a limited start code set compared to MPEG1/2 so it should be easy to detect the content, due to the distribution of start codes. -- Stefan Lucke ___ vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr