Help forcing decodebin to output certain caps

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Jan 10 12:26:43 PST 2013


On Thu, 2013-01-10 at 08:59 -0800, gimmeamilk wrote:

Hi,

> I'm trying to use uridecodebin to extract h264 video in byte-stream format
> from a mp4 file, using something roughly like this:
> 
> gst-launch uridecodebin uri=file://myvid.mp4
> caps="video/x-h264,stream-format=byte-stream" ! fakesink
> 
> The fakesink is receiving the h264 ok, but the stream format is not
> byte-stream; it's still avc, as it was in the mp4. The pipeline produced is: 
> 
> filesrc ! typefind ! qtdemux ! multiqueue ! h264parse ! fakesink
> 
> What should I be doing to make the decode bin finish on the caps I specify?

Ok, so:

1) uridecodebin in general outputs whatever it outputs. *Usually* you
can't force it to output something it wouldn't output otherwise. You
can, however, plug converters of some sort after it, followed by a
capsfilter, which should force the converter to output to whatever
format you need.

2) You can 'short-circuit' autoplugging inside uridecodebin/decodebin2
via various signals, see gst-inspect uridecodebin . Using e.g. the
autoplug-continue signal you can make it pass through video/x-h264 caps
directly instead of trying to decode it.

3) ... ! h264parse ! video/x-h264,stream-format=byte-stream ! ... should
do what you want (might also want to add alignment=au if you need one
buffer per frame).

 Cheers 
  -Tim



More information about the gstreamer-devel mailing list