Setting frame size on v4l2src

Keith Lawson keith at nowhere.ca
Tue Sep 2 16:35:20 PDT 2014


On Tue, Sep 02, 2014 at 06:07:30PM -0400, Keith Lawson wrote:
> On Tue, Sep 02, 2014 at 09:09:08AM -0400, Nicolas Dufresne wrote:
> > 
> > Le 2014-09-01 15:55, Keith Lawson a écrit :
> > >gst-launch -v v4l2src device=/dev/video0  !
> > >'video/x-raw-yuv,width=640,height=480,framerate=30/1' !
> > >xvimagesink
> > 
> > I see two possible way this could fail. Framerate=30 might not be
> > supported by the HW, just remove that field, v4l2 code will pick the
> > best it can. The second, there might be colorspace incompatibility
> > with your XV driver, add videoconvert (ffmpeg colorspace on 2+ years
> > old GStreamer you are using).
> > 
> 
> So today things get even more strange. I went to try removing the framerate and that failed so as a test I removed the cap filter entirely and I get this now: 
> 
> $ gst-launch -v v4l2src device=/dev/video0  ! xvimagesink
> Setting pipeline to PAUSED ...
> ERROR: Pipeline doesn't want to pause.
> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' cannot capture at 605x576
> Additional debug info:
> gstv4l2object.c(2207): gst_v4l2_object_set_format (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> Tried to capture at 605x576, but device returned size 606x576
> Setting pipeline to NULL ...
> Freeing pipeline ...
> $
> 
> I can fix this by using mplayer to view video from the capture card first and then my gst-launch pipeline will work but I'm back to not being able to use the 640x480 filter cap. 
> 
> > Any reason to use GStreamer 0.10 rather then latest statble 1.0 ?
> > 0.10 branch of GStreamer has been maintained for more then 2 years
> > now.
> > 
> 
> I'm on Debian testing and they package some gstreamer1.x packages but gstreamer-tools that gives me gst-launch is only 0.10. I'll try building from source to see if that makes a difference. 
> 
> 

Well apparently I wasn't paying close enough attention to the Debian binaries I was using. They also package gst-launch-1.0 and this pipeline works for me now: 

gst-launch-1.0 -ev v4l2src device=/dev/video0  ! 'video/x-raw,format=YUY2,width=640,height=480,framerate=30/1' ! xvimagesink

However now I'm having an issue with the encoding part. This is based on the gst-launch 0.10 pipeline I was using: 

$ gst-launch-1.0 -ev v4l2src device=/dev/video0  ! 'video/x-raw,format=YUY2,width=640,height=480,framerate=30/1'  ! tee name=t_vid ! queue ! xvimagesink sync=false t_vid. ! queue  ! theoraenc ! queue ! oggmux ! filesink location=test.ogg
0:00:00.245632232 23324      0x1ed4700 ERROR           GST_PIPELINE ./grammar.y:613:gst_parse_perform_link: could not link queue1 to theoraenc0
WARNING: erroneous pipeline: could not link queue1 to theoraenc0

The location of that cap worked with gst-launch 0.10 but with 1.0 it complains about linking elements. 

Maybe I should explain a bit more what I'm trying to accomplish. I'm planning on using this in a Perl application where I want to simultaniously display the video from the capture card and also have the ability to start/stop recording to an OGG or WEBM file. Should I be doing that as one pipeline or separate pipelines for playback and encoding? 

> > Nicolas
> > 
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list