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

#include <nrt/ImageProc/IO/ImageSink/VideoSink.H>

An ImageSinkType for writing to video files.

The VideoSink is a factory class which will construct for itself a set of video encoders (inheritors of VideoWriterBase). When the out() method is called, a VideoSink will first check to see if it has a video file already associated with the given label. If not, it will create a new one by querying the VideoWriterFactory which will choose the correct encoder based on the extension specified with the –ext parameter. A new file then be opened using that encoder, and then the given frame (and any subsequent frames with the same label) will be written to the file.

Definition at line 67 of file VideoSink.H.

Inheritance diagram for nrt::VideoSink:
nrt::ImageSinkType nrt::Parameter< videosink::prefix, videosink::ext, videosink::quality > nrt::Component nrt::ParameterRegistry

Public Member Functions

 VideoSink (std::string const &instanceID="video")
 
void out (GenericImage img, std::string label="")
 Append a frame to the video file specified by label. More...
 

Static Public Member Functions

static std::string const id ()
 Get the name associated with our –in type.
 
static std::string const description ()
 Get a description to show for –help.
 

Additional Inherited Members

- Protected Member Functions inherited from nrt::Component
virtual void preInit ()
 Called before all sub-Components are init()ed.
 
virtual void postInit ()
 Called after all sub-Components are init()ed.
 
virtual void preStart ()
 Called before all sub-Components are start()ed.
 
virtual void postStart ()
 Called after all sub-Components are start()ed.
 
virtual void run ()
 Called in its own thread after all Components have been start()ed. More...
 
virtual void preStop ()
 Called before all sub-Components are stop()ed.
 
virtual void postStop ()
 Called after all sub-Components are stop()ed.
 
virtual void preUninit ()
 Called before all sub-Components are uninit()ed.
 
virtual void postUninit ()
 Called after all sub-Components are uninit()ed.
 
virtual void notifyParamChanged (nrt::ParameterState const state, ParameterBase const *const param) const
 This method is called by a Parameter when it has been changed. Users should never overload this method.
 
void populateHelpMessage (std::string const &cname, std::unordered_map< std::string, std::unordered_map< std::string, std::vector< std::pair< std::string, std::string > > > > &helplist) const
 
- Protected Attributes inherited from nrt::Component
boost::shared_mutex itsMtx
 Mutex used to protect our internals other than subcomponents and parameters.
 
std::vector< std::shared_ptr
< Component > > 
itsSubComponents
 
boost::shared_mutex itsSubMtx
 
Component *const nrt_component_this
 

Member Function Documentation

void nrt::VideoSink::out ( GenericImage  img,
std::string  label = "" 
)
virtual

Append a frame to the video file specified by label.

If no video file is open for the current label, then a new one will be opened using the label, the –prefix Parameter, and the –ext Parameter as follows:

  • If prefix points to a valid directory: filename = prefix/"video".ext
  • Otherwise, if the second to last token in prefix is a valid directory: filename = prefixvideo.ext
  • Otherwise, an exception is thrown.

Implements nrt::ImageSinkType.


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