Putting h264 file inside a container

Tim Müller tim at centricular.com
Sun Aug 3 15:29:23 PDT 2014


On Mon, 2014-08-04 at 00:50 +0300, iltaren wrote:

Hi,

> 
>    Sorry probably i am asking really stupid question. But i am new to
> gstreamer, I try to put h264 file inside matroska container without re
> encoding. 
> 
> my commands was this
> raspivid -vf -t 10000 -qp 21 -w 1296 -h 972 -fps 20 -n -ih -o
> test.h264
> gst-launch-1.0 -v filesrc location=test.h264 ! h264parse !
> matroskamux ! filesink location=test.mkv
> Setting pipeline to PAUSED ...
> Pipeline is PREROLLING ...
> /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps =
> video/x-h264, width=(int)1296, height=(int)972, parsed=(boolean)true,
> stream-format=(string)avc, alignment=(string)au,
> codec_data=(buffer)01640028ffe1000f27640028ac2b402883dfdc03c489a801000528ee05f2c0
> ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0:
> GStreamer encountered a general stream error.
> Additional debug info:
> gstbaseparse.c(3038): gst_base_parse_loop
> (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
> streaming stopped, reason not-negotiated
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
> 
> 
> i didnt understand what is wrong with putting inside container without
> re enconding. (I tried without -ih flag for raspivid too) . With
> another program copying stream to container work without problem.

What's the output of

  gst-inspect-1.0 matroskamux | grep Version

?

Older versions of matroskamux required the framerate field to be present
on the input video caps, but this was removed some time ago.

You could try this:

   .... h264parse ! video/x-h264,framerate=25/1 ! matroskamux ! ..

or you could build this plugin:

https://github.com/thaytan/gst-rpicamsrc

which is a GStreamer source element that does more or less the same as
raspivid, but you can feed the output directly to h264parse+matroskamux.

Cheers
 -Tim

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



More information about the gstreamer-devel mailing list