Installation+Composite+USB+interface

A brief guide on how-to install the [|Conceptronics Composite to USB interface] under Ubuntu.

=**Installation**=

1. Plug-in the USB stick. Check if it is properly connected: code lsusb code Check for 'Afatech'. Example: 'Bus 001 Device 005: ID 1b80:e34e Afatech'.

2. The next steps need to be done as root (sudo su). Insert the em28xx module, with configuration card 9, or 13. The first is the configuration for the 'Pinnacle Dazzle DVC 90', which works well for the Conceptronics USB stick and mplayer to record frames, but does not work for OpenCV interfacing. The last is the 'Terratec Prodigy XS', and can be used to interface both with mplayer and OpenCV. code modprobe em28xx card=9 code 3. Insert the device type: code echo 1b80 e34e > /sys/bus/usb/drivers/em28xx/new_id code 4. Now /dev/video0 is created, and can be used by video capture applications. An example is given below: code mplayer tv://-tv driver=v4l2:width=640:height=480 code If you have multiple devices (for example a webcam), the USB device will not be the default /dev/video0 and you have to explicitly mention the device path when opening the video stream. For example: code mplayer tv:// -tv driver=v4l2:device=/dev/video1:width=640:height=480 code Note that if you use the NTSC standard, you will get a green overlay over the image. The composite video must be PAL standard to work properly.

5. Video can be recorded uncompressed by adding the following option: code mplayer tv:// -tv driver=v4l2:width=640:height=480 -vo pnm code The individual frames are then saved as *.pnm files. Deinterlacing options can be viewed by typing: code mplayer -pphelp code An example of a deinterlacing filter when recording raw video: code mplayer tv:// -tv driver=v4l2:width=640:height=480 -vf pp=ci -vo pnm code

=Interfacing the USB module with OpenCV=

Interfacing to OpenCV requires the following steps:

1. Plug-in the USB stick. Check if it is properly connected: code lsusb code Check for 'Afatech'. Example: 'Bus 001 Device 005: ID 1b80:e34e Afatech'.

2. The next steps need to be done as root (sudo su). Insert the em28xx module, with configuration card 13. This is an important difference to the steps above! code modprobe em28xx card=13 code 3. Insert the device type: code echo 1b80 e34e > /sys/bus/usb/drivers/em28xx/new_id code 4. Now /dev/video0 is created, and can be used by video capture applications. Check if it is working: code mplayer tv://-tv driver=v4l2:width=640:height=480 code 5. To interface with OpenCV you need to load an additional library: code export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so code 6. Start the OpenCV program! Make sure you set the resolution to 640x480. An example file is attached here, which just interfaces to the camera and displays the frame.