YARP
Yet Another Robot Platform
Example for grabber (grabber_audiovisual)

Instantiates grabber device implemented by yarp::dev::ServerFrameGrabber. More...

+ Collaboration diagram for Example for grabber (grabber_audiovisual):

Instantiates grabber device implemented by yarp::dev::ServerFrameGrabber.

# wrap an audiovisual source for the network
device grabber
subdevice ffmpeg_grabber
source tiny.avi
# the movie has images and sound; let's send them on different ports
# (or could use shared-ports flag to put them on same port)
name /visual
name2 /audio

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

yarpdev --file grabber_audiovisual.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("grabber_audiovisual.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
subdevicename (or nested configuration) of device to wrap
ffmpeg_grabber.device
ffmpeg_grabber.wrapped
ffmpeg_grabber.sourcemedia file to read fromdefault.avi
ffmpeg_grabber.loopmedia should loop (default)
ffmpeg_grabber.noloopmedia should not loop
ffmpeg_grabber.syncsync on image or audio (if have to choose)?image
ffmpeg_grabber.nodelaymedia will play in simulated realtime unless this is present
ffmpeg_grabber.pacesimulated realtime multiplier factor (must be <1 right now)1.0
ffmpeg_grabber.v4lif present, read from video4linux
ffmpeg_grabber.v4l1if present, read from video4linux
ffmpeg_grabber.v4l2if present, read from video4linux2
ffmpeg_grabber.ieee1394if present, read from firewire
no_dropif present, use strict policy for sending data
stampif present, add timestamps to data
namename of port to send data on/grabber
shared-portsIf present, send audio and images on same port
name2Name of second port to send data on, when audio and images sent separately/grabber2
single_threadedif present, operate in single threaded mode
frameratemaximum rate in Hz to read from subdevice0
See also
yarp::dev::ServerFrameGrabber