Video devices and video files


Detailed Description

Classes and functions to manage video streams and present them as images.


Modules

 Video buffers
 Video frames

Classes

class  CVD::V4LControl
 exposes the V4L2 API to set parameters on a capture device. More...

Functions

template<class T>
VideoBuffer< T > * CVD::open_video_source (std::istream &in)
template<class T>
VideoBuffer< T > * CVD::open_video_source (const std::string &src)


Function Documentation

template<class T>
VideoBuffer<T>* CVD::open_video_source ( std::istream &  in  )  [inline]

opens a video device described by a video source url given from an input stream.

See open_video_source(const std::string &) for details on the url syntax.

Definition at line 283 of file videosource.h.

template<class T>
VideoBuffer<T>* CVD::open_video_source ( const std::string &  src  )  [inline]

opens a video device described by a video source url.

This allows to decide at runtime what kind of video input your program is using. Basic use is to call open_video_source<T>(url) to get a VideoBuffer<T>*.

The url syntax is the following:

url      := protocol ':' [ '[' options ']' ] // identifier
protocol := "files" | "file" | "v4l2" | "v4l1" | "jpegstream" | "dc1394" | "qt"
options  := option [ ',' options ]
option   := name [ '=' value ]

identifier and values can be quoted literals with escapes, all other text is unquoted. Some Examples:

Open a DiskBuffer2 for *.pgm in /local/capture/:

files:///local/capture/ *.pgm

Open a DiskBuffer2 that loops and uses a ReadAheadVideoBuffer wrapper with 40 frame buffer, with 30 fps:

files:[read_ahead=40, fps=30, on_end=loop]///local/capture/ *.pgm

Open a V4L2 device at /dev/video0:

v4l2:///dev/video0

Open a V4L2 device with fields on input 2:

v4l2:[input=2,fields]///dev/video0

Open firewire camera 1 with 3 dma bufs and default brightness/exposure and fps:

dc1394:[dma_bufs=3]//1

Open an avi file relative to the current directory:

file://../../stuff/movie.avi

Open the first QuickTime camera and show the settings dialog

qt:[showsettings=1]//0

Open an HTTP camera. First create a named pipe from the shell, and start grabbing video:

mkfifo /tmp/video
wget http//my.camera/file_representing_video -O /tmp/video
then open a source with:
jpegstream:///tmp/video
If the argument is provided from a ahell such as BASH, then then redirection can be used:
jpegstream://<(wget http//my.camera/file_representing_video -O - )

Options supported by the various protocols are:

'files' protocol (DiskBuffer2):  identifier is glob pattern
        fps = <number>
        read_ahead [= <number>] (default is 50 if specified without value)
        on_end = repeat_last | unset_pending | loop (default is repeat_last)

'file' protocol (VideoFileBuffer): identifier is path to file
       read_ahead  [= <number>] (default is 50 if specified without value)
       on_end = repeat_last | unset_pending | loop (default is repeat_last)

'v4l1' protocol (V4L1Buffer): identifier is device name
       size = vga | qvga | pal | ntsc | <width>x<height>  (default is 0x0)

'v4l2' protocol (V4LBuffer): identifier is device name
       size = vga | qvga | pal | ntsc | <width>x<height>  (default vga)
       input = <number>
       interlaced | fields [= <bool> ]
	   verbose [ = <bool> ]

'dc1394' protocol (DVBuffer): identifier is camera number
       fps = <number> (default 30)
       dma_bufs | dma_buffers = <number> (default 3)
       brightness | bright = <number> (default -1)
       exposure | exp = <number> (default -1)

'qt' protocol (QTBuffer): identifier is camera number
      size = vga | qvga | <width>x<height>  (default vga)
      showsettings = 0 | 1 (default 0)

'jpegstream' protocol (ServerPushJpegBuffer): identifier is path to file
       read_ahead  [= <number>] (default is 50 if specified without value)

Definition at line 396 of file videosource.h.


Generated on Wed Feb 18 10:23:03 2009 for CVD by  doxygen 1.5.3