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

HaroldJRoth dlafferty at gmail.com
Sat Nov 6 14:44:35 CET 2010



Tim-Philipp Müller-2 wrote:
> 
> 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
> 

Thanks for the heads up.  I'll be sure to put one between decoderbin2 and
the videoscale.

Apart from that, does it matter that the caps isn't fully specified?  E.g.
I've not set the height or framerate.

Also, at link, does the decoderbin2 get forced to create a videopad that
meets the downstream caps requirements?
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Simple-Q-How-to-set-Caps-programmatically-when-assembly-a-pipeline-in-C-tp3029913p3029989.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list