Gstreamer, libv4l and YUV420

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Gstreamer, libv4l and YUV420

Erik Andrén
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm developing a driver for stv06xx based webcams (Quickcam Web,
Dexxa Webcam, Quickcam Express etc.)

Some of these webcams contain a vv6410 sensor producing a raw bayer
image with a 356x292 resolution.

As the camera only supports bayer natively the libv4l [1] library is
used to convert the format to rgb or yuv.

RGB works fine but I'm having trouble to get yuv conversion working
together with gstreamer. This is due to that the U V plane widths
are rounded up by 8 in gstv4l2src.c

libv4l delivers 356*292+(356*292/2) = 155928 byte frames but
gstreamer expects 356+292+(360*292/2) = 156512 byte frames and thus
bails out.

If I've understood things correctly, gstreamer expects us to pad
each line with two bytes, but the v4l2 standard [2] says that the
driver may choose to ignore padding and this is as of current not
honoured by gstreamer.

I've hacked gstv4l2src.c to only round up by 4 but I still get an
corrupt image. My take is that the rounding by 8 is presumed
elsewhere in the gstreamer stack. Other yuv420 consuming
applications (skype for instance) work correctly and doesn't expect
this alignment.

My questions are as following:
1. Why is the rounding by 8 taking place? Is this defined somewhere
in yuv420 specification?
2. How do we resolve this issue? AFAICS the gstreamer stack is
currently violating the specs as it expects the padding. Would this
be easy to fix?

Best regards,
Erik Andrén

[1] http://hansdegoede.livejournal.com/3636.html
[2]
http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec/c2030.htm#V4L2-PIX-FORMAT
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknOg20ACgkQN7qBt+4UG0HCqgCggMIUpBcX+c/jpMspsv6xbJJT
t2IAnjgA+Z7i4nJX91V++zu3sEjW/KIu
=uZ5G
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer, libv4l and YUV420

Donny Viszneki
On Sat, Mar 28, 2009 at 4:07 PM, Erik Andrén <[hidden email]> wrote:
> I'm developing a driver for stv06xx based webcams (Quickcam Web,
> Dexxa Webcam, Quickcam Express etc.)

I'm not sure if this will make any difference to you, but using v4l
(not v4l2) with my Logitech QuickCam Express works fine with
GStreamer. My image is not corrupted in any way, although it's quite
blurry because the lens has come off :O

lsusb yields:
Bus 002 Device 002: ID 046d:0870 Logitech, Inc. QuickCam Express

--
http://codebad.com/

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer, libv4l and YUV420

Erik Andrén
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Donny Viszneki wrote:

> On Sat, Mar 28, 2009 at 4:07 PM, Erik Andrén <[hidden email]> wrote:
>> I'm developing a driver for stv06xx based webcams (Quickcam Web,
>> Dexxa Webcam, Quickcam Express etc.)
>
> I'm not sure if this will make any difference to you, but using v4l
> (not v4l2) with my Logitech QuickCam Express works fine with
> GStreamer. My image is not corrupted in any way, although it's quite
> blurry because the lens has come off :O
>
> lsusb yields:
> Bus 002 Device 002: ID 046d:0870 Logitech, Inc. QuickCam Express
>

But then you're using the old quickcam.ko kernel module, right?
The old module only supports v4l and did all of it's format
conversion in the driver, something we're trying to avoid by
utilizing libv4l.

Thanks,
Erik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknPH9MACgkQN7qBt+4UG0EQPACdH4VdvKRQJlQKZy0RfsrzFBgf
eucAn3gAJlOq3IFkImaxoV7mdXwbnoLe
=FvQh
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel