libcvd
Public Member Functions | List of all members
CVD::VideoFileBuffer< T > Class Template Reference

A video buffer to play frames from a video file. More...

#include <videofilebuffer.h>

Inheritance diagram for CVD::VideoFileBuffer< T >:
Inheritance graph
[legend]
Collaboration diagram for CVD::VideoFileBuffer< T >:
Collaboration graph
[legend]

Public Member Functions

 VideoFileBuffer (const std::string &file, bool verbose=false)
 Construct a VideoFileBuffer to play this file. More...
 
 VideoFileBuffer (const std::string &file, const std::string &fmt, bool verbose=false)
 
 VideoFileBuffer (const std::string &file, const std::string &fmt, bool verbose, const std::map< std::string, std::string > &o)
 
virtual ImageRef size ()
 The size of the VideoFrames returned by this buffer.
 
virtual bool frame_pending ()
 Is there a frame waiting in the buffer? This function does not block. More...
 
virtual void on_end_of_buffer (VideoBufferFlags::OnEndOfBuffer behaviour)
 What should the buffer do when it reaches the end of the list of files? More...
 
virtual void seek_to (double t)
 Go to a particular point in the video buffer (only implemented in buffers of recorded video) More...
 
virtual VideoFileFrame< T > * get_frame ()
 Returns the next frame from the buffer. This function blocks until a frame is ready.
 
virtual void put_frame (VideoFrame< T > *f)
 Tell the buffer that you are finished with this frame. More...
 
double frame_rate ()
 What is the (expected) frame rate of this video buffer, in frames per second?
 
std::string file_name ()
 What is the path to the video file?
 
- Public Member Functions inherited from CVD::LocalVideoBuffer< T >
 LocalVideoBuffer (typename VideoBufferType::Type t)
 
- Public Member Functions inherited from CVD::VideoBuffer< T >
 VideoBuffer (VideoBufferType::Type _type)
 Construct the buffer with the known semantics.
 
virtual void flush ()
 Flush all old frames out of the video buffer, on a flushable buffer, causing the next get_frame() to sleep until a frame arrives. More...
 
VideoBufferType::Type type ()
 Returns the type of the video stream. More...
 
- Public Member Functions inherited from CVD::RawVideoBuffer
virtual RawVideoBuffersource_buffer ()
 Which video grabber provides the source images for this video grabber. More...
 
RawVideoBufferroot_buffer ()
 Follow the chain of video grabbers back as far as at will go. More...
 

Detailed Description

template<typename T>
class CVD::VideoFileBuffer< T >

A video buffer to play frames from a video file.

This uses the ffmpeg library (http://ffmpeg.sourceforge.net/) to play a wide range of video formats, including MPEG (1, 2 and 4) and AVI (including DivX and DV) files. Provides frames of type CVD::VideoFileFrame and throws exceptions of type CVD::Exceptions::VideoFileBuffer

Parameters
TThe pixel type of the video frames. Currently only CVD::Rgb<CVD::byte> > and CVD::byte> are supported.

Constructor & Destructor Documentation

◆ VideoFileBuffer()

template<typename T >
CVD::VideoFileBuffer< T >::VideoFileBuffer ( const std::string &  file,
bool  verbose = false 
)
inline

Construct a VideoFileBuffer to play this file.

Parameters
fileThe path to the video file

Member Function Documentation

◆ frame_pending()

template<typename T >
virtual bool CVD::VideoFileBuffer< T >::frame_pending ( )
inlinevirtual

Is there a frame waiting in the buffer? This function does not block.

See is_live and is_flushable.

Implements CVD::LocalVideoBuffer< T >.

◆ on_end_of_buffer()

template<typename T >
virtual void CVD::VideoFileBuffer< T >::on_end_of_buffer ( VideoBufferFlags::OnEndOfBuffer  behaviour)
inlinevirtual

What should the buffer do when it reaches the end of the list of files?

Parameters
behaviourThe desired behaviour

◆ put_frame()

template<typename T >
virtual void CVD::VideoFileBuffer< T >::put_frame ( VideoFrame< T > *  f)
inlinevirtual

Tell the buffer that you are finished with this frame.

Typically the VideoBuffer then destroys the frame.

Parameters
fThe frame that you are finished with.

Implements CVD::LocalVideoBuffer< T >.

◆ seek_to()

template<typename T >
virtual void CVD::VideoFileBuffer< T >::seek_to ( double  )
inlinevirtual

Go to a particular point in the video buffer (only implemented in buffers of recorded video)

Parameters
tThe frame time in seconds

Reimplemented from CVD::LocalVideoBuffer< T >.


The documentation for this class was generated from the following file: