Video4Linux in YARP

From Wiki for iCub and Friends
Jump to: navigation, search

(thanks to Jonas Ruesch for help with this)

Supported via FFMPEG library

video4linux is currently supported in YARP via ffmpeg.

Run "ccmake ." to turn on compilation with ffmpeg (making sure you have the library present first).

Then make. You should now have this device available:

 Device <ffmpeg_grabber>
    documented by the C++ class FfmpegGrabber
    Wrapped for the network by <grabber>

You can start a server for your camera with something like:

 yarpdev --name /rightEye --framerate 20 --device ffmpeg_grabber --v4l --v4ldevice /dev/video0 --channel 1 --standard ntsc --width 640 --height 480 --time_base_den 29 --time_base_num 1 

Many of the parameters can be omitted.

It is a bit neater to use a .ini file:

 yarpdev --file mycam.ini

where mycam.ini is something like:

 device ffmpeg_grabber
 name /rightEye
 v4ldevice /dev/video0
 width 640
 height 480

Current limitations

A note from Jonas:

 I checked the newest cvs version with the configurable v4l ffmpeg_grabber on a
 camera attached to a tv-card. It works as expected.
 There seems to be one issue left which I think was there already before; when
 starting a v4l device driver (ServerFrameGrabber) the first time, yarpview
 stays blind. The 'solution' is then to start xawtv change to s-video, see the
 camera picture appear, shut down xawtv and restart ServerFrameGrabber. Some
 initalization which does xawtv and we don't?

A note from Paul

 Don't know what this might be.  Finally got to try out a webcam and it works
 fine.  Maybe kernel or v4l version dependant?

A note from Jonas

 The issue seems to be dependent on the tv-card used. Some require the 'xawtv 
 initialization' and some don't.