Hi,<br><br>i'm puzzled by playing h264 stream from rtp with vlc-0.9.4. There is no picture out.<br><br>i change the source\modules\demux\rtp.c like this:<br><br>1. in function Demux() add<br> case 96:<br> msg_Dbg(demux, "****detected H264 Stream****");<br>
pt.init = h264_init;<br> pt.decode = h264_decode;<br> pt.frequency = 9000;<br> break;<br>2. add function h264_init <br>static void *h264_init (demux_t *demux)<br>{<br> es_format_t fmt;<br>
<br> es_format_Init (&fmt, VIDEO_ES, VLC_FOURCC ('h', '2', '6', '4'));<br> return codec_init (demux, &fmt);<br>}<br>i also changed function es_format_Init with fmt->b_packetized = false;<br>
<br>3. add function h264_decode<br>static void h264_decode (demux_t *demux, void *data, block_t *block)<br>{<br> if (block->i_buffer < 4)<br> {<br> block_Release (block);<br> return;<br> }<br>
<br> //add 0x00,0x00,0x00,0x01 after the RTP header for every block<br> block_t *p_block = block_New(demux, block->i_buffer + 4);<br> p_block->p_buffer[0] = 0x00;<br> p_block->p_buffer[1] = 0x00;<br> p_block->p_buffer[2] = 0x00;<br>
p_block->p_buffer[3] = 0x01;<br><br> memcpy(p_block->p_buffer + 4, block->p_buffer, block->i_buffer);<br> codec_decode (demux, data, p_block);<br>}<br><br>4. compile it and play the rtp h264 stream and the log is as following:<br>
main debug: thread 4400 (interface) created at priority 0 (interface/interface.c:168)<br>main debug: thread started<br>main debug: looking for interface module: 1 candidate<br>main debug: using interface module "hotkeys"<br>
main debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)<br>main debug: thread 4428 (interface) created at priority 0 (interface/interface.c:168)<br>main debug: thread started<br>main debug: adding item `rtp://@:1234' ( rtp://@:1234 )<br>
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.<br>main debug: looking for interface module: 1 candidate<br>rc: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team<br>
rc: <br><br>main debug: using interface module "rc"<br>main debug: TIMER module_Need() : 9.000 ms - Total 9.000 ms / 1 intvls (Avg 9.000 ms)<br>main debug: thread 4468 (interface) created at priority 0 (interface/interface.c:168)<br>
main debug: thread started<br>main debug: rebuilding array of current - root<br>main debug: rebuild done - 1 items, index -1<br>main debug: starting new item<br>main debug: processing request item null node skip 0<br>main debug: creating new input thread<br>
main debug: Creating an input for 'rtp://@:1234'<br>main debug: waiting for thread initialization<br>main debug: thread started<br>main debug: `rtp://@:1234' gives access `rtp' demux `' path `@:1234'<br>
main debug: thread 4508 (input) created at priority 1 (input/input.c:370)<br>main debug: creating demux: access='rtp' demux='' path='@:1234'<br>main debug: looking for access_demux module: 1 candidate<br>
main debug: net: opening any datagram port 1234<br>main debug: net: opening any datagram port 1235<br>main debug: using access_demux module "rtp"<br>main debug: TIMER module_Need() : 34.000 ms - Total 34.000 ms / 1 intvls (Avg 34.000 ms)<br>
main debug: looking for a subtitle file in D:\cygwin\home\wangwei1\vlc-0.9.4\vlc-0.9.4\<br>main debug: `rtp://@:1234' successfully opened<br><span style="color: rgb(255, 0, 0);">rtp debug: ****detected H264 Stream****</span><br>
<span style="color: rgb(255, 0, 0);">rtp debug: added payload type 96 (f = 9000 Hz)</span><br>main debug: selecting program id=0<br>main debug: looking for decoder module: 31 candidates<br>avcodec debug: libavcodec initialized (interface 3358464 )<br>
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started<br>main debug: using decoder module "avcodec"<br>main debug: TIMER module_Need() : 32.000 ms - Total 32.000 ms / 1 intvls (Avg 32.000 ms)<br>main debug: looking for packetizer module: 18 candidates<br>
main debug: using packetizer module "packetizer_h264"<br>main debug: TIMER module_Need() : 3.000 ms - Total 3.000 ms / 1 intvls (Avg 3.000 ms)<br>main debug: thread 4660 (decoder) created at priority 0 (input/decoder.c:217)<br>
main debug: thread started<br>rtp debug: added RTP source (23be84e1)<br>main debug: control type=1<br>packetizer_h264 warning: waiting for SPS/PPS<br>packetizer_h264 warning: waiting for SPS/PPS<br>packetizer_h264 warning: waiting for SPS/PPS<br>
packetizer_h264 warning: waiting for SPS/PPS<br>packetizer_h264 warning: waiting for SPS/PPS<br>packetizer_h264 warning: waiting for SPS/PPS<br>packetizer_h264 warning: waiting for SPS/PPS<br><span style="color: rgb(255, 0, 0);">packetizer_h264 debug: found NAL_SPS (sps_id=0)</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)</span><br style="color: rgb(255, 0, 0);"><br>vlc-0.9.4 stoped when it found the NAL_SPS and NAL_PPS.<br><br>i don't know how to solve this problem. <br>
<br>sorry for my bad english.<br><br>best regards.<br>