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:
lsusb
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.
modprobe em28xx card=9
3. Insert the device type:
echo 1b80 e34e > /sys/bus/usb/drivers/em28xx/new_id
4. Now /dev/video0 is created, and can be used by video capture applications. An example is given below:
mplayer tv://-tv driver=v4l2:width=640:height=480
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:
mplayer tv:// -tv driver=v4l2:device=/dev/video1:width=640:height=480
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:
mplayer tv:// -tv driver=v4l2:width=640:height=480 -vo pnm
The individual frames are then saved as *.pnm files. Deinterlacing options can be viewed by typing:
mplayer -pphelp
An example of a deinterlacing filter when recording raw video:
mplayer tv:// -tv driver=v4l2:width=640:height=480 -vf pp=ci -vo pnm

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:
lsusb
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!
modprobe em28xx card=13
3. Insert the device type:
echo 1b80 e34e > /sys/bus/usb/drivers/em28xx/new_id
4. Now /dev/video0 is created, and can be used by video capture applications. Check if it is working:
mplayer tv://-tv driver=v4l2:width=640:height=480
5. To interface with OpenCV you need to load an additional library:
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so
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.