iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::VideoWriterBase Class Referenceabstract

#include <nrt/ImageProc/IO/ImageSink/VideoWriters/details/VideoWriterBase.H>

A base class for video writers.

VideoWriterBase is an abstract base class for video file writers. A class which inherits from VideoWriterBase can be registered with the VideoSink (and thus, the ImageSink) framework, allowing users to easily write video files handled by your class.

In order to make a new video file writer, you should derive from this class (implementing all of the necessary pure-virtual methods) and then register the class using the NRT_REGISTER_VIDEO_READER(CLASSNAME) macro. Additionally, you must implement:

  • A static std::string id() method which returns the file extensions that your video writer can encode. Multiple choices can be specified by separating them with a '|' character, e.g. "mpg|mpeg".
  • A static std::string description() method which returns a helpful description of your video writer/format.

Optionally, you should also consider implementing a reader class which derives from VideoReaderBase so that users can read as well as write your new video format.

See Also
VideoSink
ImageSink

Definition at line 62 of file VideoWriterBase.H.

Inherited by nrt::MgzJVideoWriter.

Public Member Functions

virtual void open (std::string const &filename, int quality=7)=0
 Open the given filename, and prepare to append frames. More...
 
virtual void appendFrame (GenericImage img)=0
 Append a frame to the current running video.
 
virtual void close ()=0
 Close the file, and prepare to be open()'d again.
 

Member Function Documentation

virtual void nrt::VideoWriterBase::open ( std::string const &  filename,
int  quality = 7 
)
pure virtual

Open the given filename, and prepare to append frames.

The given quality should be between [1..10], and describes the requested tradeoff between file size and image quality. Requesting a quality of 1 should result in the smallest possible file size, at the cost of poor image quality. A quality of 10 should result in the best possible quality video, at the possible expense of a large file.


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