Get v4l2src width and height before pipeline runs?

wally_bkg wb666greene at gmail.com
Fri Oct 28 13:53:55 PDT 2011


Edward Hervey wrote:
> 
>   Why aren't you using the v4l2src/v4l2sink elements ? If you have
> issues with them, please explain it in detail and/or file a bug report.
> 

I have vrl2src elements at the start of my pipeline that ends with an
appsink, this worked fine with fixed video frame sizes, but now that I've
removed that restriction in the image processing algorithm the question is
how do I get the frame size from v4l2 without setting the pipeline to
playing? 

I've had lots of issues with the gstreamer v4l2src tuner interface and never
could get it to reliably set the norm and select the input across the
various v4l2 capture devices on hand.  As to bug reports, the answer was
always to try a newer version, but when I tried the Ubuntu 10.04 gstreamer
PPA it broke all things multimedia and wasted a fair amount of time
recovering.  At that point it became easier to just use v4l2 calls to set
the norm and select the input, then build the pipeline.

Grossly simplified my code is

V4l2src->ffmpegcolorspace->fixed caps filter->appsink
duplicate the appsink buffer data
do some image processing on the duplicated buffer data
appsrc->xvimagesink (for realtime viewing, of the processed data)
appsrc->mp4 encoding->filesink ( original data to allow non-realtime
processing afterwards)

Works quite well with fixed caps.  I'm stuck on how to get the frame height
and width without fixed caps before the pipeline runs.   I have to build a
bunch of tables that depend on the frame size and takes a couple of seconds
to do (perhaps not the most efficient recursive code, but it only runs
once).

I could work around this by pre-building tables of the possibilities
(640x480, 704x480, & 720x480 so far, depending on the capture device, fixed
caps was just set to 640x480) but the real issue is I'd like the v4l2
timestamps from the driver to use to synchronize A/D data from another
process running on the same machine.  I asked about this earlier but got no
response:

http://gstreamer-devel.966125.n4.nabble.com/Getting-V4l2-timestamps-from-v4l2src-td3915764.html

Dealing with various frame sizes is at this point only needed to test my
changes (which I quickly did by changing the fixed caps  to match the
different capture card possibilities) in anticipation of someday using HD
video.  The timestamps to synchronize the A/D data with the video is an
action item.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Get-v4l2src-width-and-height-before-pipeline-runs-tp3942212p3949188.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list