Get v4l2src width and height before pipeline runs?

Stefan Sauer ensonic at hora-obscura.de
Mon Oct 31 03:17:24 PDT 2011


On 10/28/2011 10:53 PM, wally_bkg wrote:
> 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.
Unless we figure out wat broek in your setup, you will be stuck with an
old version. The v4l2 api is a bit fragile regarding to what things to
call in which order for which device/driver. In order to try a new
v4l2src, you can always just build git head and only install v4l2src, I
don't think we're using API there that requires a new core version.

Stefan
>   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.
> _______________________________________________
> 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