[gst-devel] Simple Q: How to set Caps programmatically when assembly a pipeline in C

Tim-Philipp Müller t.i.m at zen.co.uk
Sat Nov 6 13:37:34 CET 2010


On Sat, 2010-11-06 at 05:23 -0700, HaroldJRoth wrote:

> gst-launch filesrc location=videotestsrc.ogg ! decodebin2 ! videoscale !
> video/x-raw-yuv, width=50 ! queue ! appsrc
> 
> E.g. I want to scale the video output coming from decodebin2 to a width and
> format, then I want to pass it through a queue to my appsrc element.
> ...
> GstCaps* videoCaps = gst_caps_new_simple ("video/x-raw-yuv",
>              "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2',
> '0'),
>              "width", G_TYPE_INT, 50,
>              NULL);

FWIW, you may also need to add an ffmpegcolorspace element between
decodebin2 and your caps filter, unless you know for sure that all
decoders you'll ever use will output video in I420 format.

 Cheers
  -Tim






More information about the gstreamer-devel mailing list