[vlc-devel] Re: VLC h.264 RTP stream capture fix

Derk-Jan Hartman hartman at videolan.org
Thu Mar 23 21:35:41 CET 2006

On 23-mrt-2006, at 10:54, Erwan LE BRAS wrote:
> Hello,
> in this post, you gave some explaination why vlc can't
> capture h.264 streams (but still play them well):
> http://forum.videolan.org/viewtopic.php?t=16006&highlight=nondated 
> +packet
> Can you give me some explanations where this should be
> handled in the source code ? I am not new to mpeg4 and
> h.264 (I used to be an envivio coder), but a bit new
> to VLC. I found the calling path
> StreamRead->es_out_Send->EsOutSend->input_DecoderDecode- 
> >DecoderDecode->DecoderDecode->sout_InputSendBuffer->
>  block_Release if p_buffer->i_pts <= 0.
> Can you give me some advice or direction where I could
> put my code that reconstruct dts from pts ?
> thanks,
> Erwan

You need to fix the packetizer for h264. See modules/packetizer/ 
h264.c There are examples for mpeg4 in modules/packetizer/mpeg4video.c
The problem though is that to do this you need to "buffer" a certain  
amount of data, in order to create a history to base the calculations  
on. With H264 in theory allowing an unlimited amount of B-frames,  
that is a bit of a problem.

Also there is the issue of AVC vs. H264. Or rather the way it is  
stored in Apple's mp4 files vs. what raw h264 streams seem to use. I  
was told that including all the intermediate headers etc is quite  
complicated. A similar discussion on how to handle this issue was  
recently on the ffmpeg-devel mailing list. I believe the thread was  
called "H264 muxing in mp4".


This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list