[gst-devel] How to set capture size for a v4lsrc element?
ye nan
bucketxp at hotmail.com
Thu Mar 30 02:28:03 CEST 2006
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);
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?
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
More information about the gstreamer-devel
mailing list