YARP
Yet Another Robot Platform
Example for ffmpeg_grabber (ffmpeg_grabber_video4linux)

Instantiates ffmpeg_grabber device implemented by FfmpegGrabber. More...

+ Collaboration diagram for Example for ffmpeg_grabber (ffmpeg_grabber_video4linux):

Instantiates ffmpeg_grabber device implemented by FfmpegGrabber.

# read from a video4linux source
device ffmpeg_grabber
v4l2
v4ldevice /dev/video0
width 640
height 480

If this text is saved in a file called ffmpeg_grabber_video4linux.ini then the device can be created by doing:

yarpdev --file ffmpeg_grabber_video4linux.ini

Of course, the configuration could be passed just as command line options, or as a yarp::os::Property object in a program:

Property p;
p.fromConfigFile("ffmpeg_grabber_video4linux.ini");
// of course you could construct the Property object on-the-fly
PolyDriver dev;
dev.open(p);
if (dev.isValid()) { /* use the device via view method */ }

Here is a list of properties checked when starting up a device based on this configuration file. Note that which properties are checked can depend on whether other properties are present. In some cases properties can also vary between operating systems. So this is just an example

PROPERTYDESCRIPTIONDEFAULT
device
sourcemedia file to read fromdefault.avi
loopmedia should loop (default)
noloopmedia should not loop
syncsync on image or audio (if have to choose)?image
nodelaymedia will play in simulated realtime unless this is present
pacesimulated realtime multiplier factor (must be <1 right now)1.0
v4lif present, read from video4linux
v4l1if present, read from video4linux
v4l2if present, read from video4linux2
v4ldevicedevice name/dev/video0
time_base_num
channel
standard
widthwidth of image640
heightheight of image480
audiooptional audio device
See also
FfmpegGrabber