H264 stream to MP4 file without the first bytes on the H264 stream

Tim Müller tim at centricular.com
Sun Feb 5 10:39:59 UTC 2017


On Fri, 2017-02-03 at 03:14 -0800, ivan-perez wrote:

Hi,

> I have a very simple pipeline which converts a H264 stream into a MP4
> file.
> It looks like this:
> 
>     gst-launch-1.0 -e -v fdsrc
>       ! video/x-h264,stream-format=avc,alignment=au,...
>       ! h264parse
>       ! mp4mux
>       ! filesink location=test.mp4

So where does the data come from? What does the H.264 generation? Do
you have the option of feeding H.264 in byte-stream (annex b) format
instead?

The problem here is that you can't really send stream-format=avc over a
stream such as a pipe or such. You need to maintain the packetisation
of the avc frames, and streams won't do that (it might look like it
mostly works, but you can't rely on it unless you force a packet-based
transport).

If you can send the data in byte-stream format instead then h264parse
can sync onto a running stream in the middle. I might be mis-
understanding the problem though, I'm just guessing here.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list