[gst-devel] How to set capture size for a v4lsrc element?

Loïc Molinari loic.molinari at gmail.com
Thu Mar 30 03:04:02 CEST 2006


Hi Ye,

Le jeudi 30 mars 2006 à 18:27 +0800, ye nan a écrit :
> Hi,
>   I can do it in the command line, just run the gst-lunch like this:
>   gst-launch-0.10 v4lsrc ! video/x-raw-yuv, width = 320, height = 240 ! 
> ffmpegcolorspace !  ximagesink
>   But how can I implement this in my own programme?
> 
>   I created some elements, including v4lsrc, ffmpegcolorspace, and ximage:
>   videosource  = gst_element_factory_make("v4lsrc", "video_source");
>   videosink    = gst_element_factory_make("ximagesink", "video_sink");
>   videoencconv = gst_element_factory_make("ffmpegcolorspace", 
> "video_convert");
>   I also create a caps for the v4lsrc, and set format with video/x-raw-yuv, 
> width = 320, height = 240:
>   caps = gst_caps_new_simple("video/x-raw-yuv", "width", G_TYPE_INT, 320, 
> "height", G_TYPE_INT, 240, NULL);
>   sinkpad = gst_element_get_pad(videosource  , "sink");
>   gst_pad_set_caps(sinkpad, caps);

You're using a source element, so I guess you don't want to get the sink
but the source pad of v4lsrc.

>   But these can make effect on the capture size of v4l streaming like the 
> command line, it still a extremely small window, maybe only 80x60. Why?

You shouldn't affect the pad anymore and try to link the elements with
your filtering caps using the gst_element_link_filtered function.

Loïc.

-- 
Loïc Molinari <loic.molinari at gmail.com>




More information about the gstreamer-devel mailing list