code does not use libv4l for pixel format conversion

Bug #346060 reported by mungewell
2
Affects Status Importance Assigned to Milestone
python-v4l2capture
Fix Released
Undecided
Fredrik Portström

Bug Description

As the subject suggests, you can use libv4l to act as a 'magic shim' to do the conversion from pixel formats that you don't know about. This would also mean that you don't have to do you own YUYV->RGB code.

see:
http://hansdegoede.livejournal.com/3636.html

Just need to change your ioctl calls to v4l2_ioctl.

Cheers,
mungewell.

Revision history for this message
Fredrik Portström (portstrom) wrote :

libv4l is now supported, and the code to convert YUYV->RGB is not used when using libv4l.

Changed in python-v4l2-capture:
assignee: nobody → rheo
status: New → Fix Released
Revision history for this message
mungewell (simon-mungewell) wrote :

Cool... I can confirm that this works with a Logitec Notebook Pro webcam, which only outputs MJPG.
--
> ./list_devices.py
/dev/video0
    driver: uvcvideo
    card: UVC Camera (046d:08c3)
    bus info: 0000:00:1d.1

> ./capture_picture.py
Saved image.jpg (Size: 864 x 480)
--

Strangely the other system I used only captured at:
 320x240
 640x480

Cheers,
Mungewell.

Revision history for this message
mungewell (simon-mungewell) wrote :

Just a quick note that it doesn't gracefully warn if 'libv4l-dev' is not installed.
--
simon@myth:~/python-v4l2-capture$ ./setup.py build
running build
running build_ext
building 'v4l2capture' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c v4l2capture.c -o build/temp.linux-i686-2.5/v4l2capture.o
v4l2capture.c:19:21: error: libv4l2.h: No such file or directory
v4l2capture.c: In function ‘my_ioctl’:
v4l2capture.c:55: warning: implicit declaration of function ‘v4l2_ioctl’
v4l2capture.c: In function ‘Video_device_unmap’:
v4l2capture.c:76: warning: implicit declaration of function ‘v4l2_munmap’
v4l2capture.c: In function ‘Video_device_dealloc’:
v4l2capture.c:89: warning: implicit declaration of function ‘v4l2_close’
v4l2capture.c: In function ‘Video_device_init’:
v4l2capture.c:105: warning: implicit declaration of function ‘v4l2_open’
v4l2capture.c: In function ‘Video_device_create_buffers’:
v4l2capture.c:267: warning: implicit declaration of function ‘v4l2_mmap’
v4l2capture.c:268: warning: assignment makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
--

Cheers,
Mungewell.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.