Package pyvision :: Package surveillance :: Module VideoStreamProcessor :: Class VideoWriterVSP
[hide private]
[frames] | no frames]

Class VideoWriterVSP

source code

AbstractVSP --+
              |
             VideoWriterVSP

A video stream processor that outputs to a new movie file. If you want to display the frame number in the output, chain this VSP after a SimpleVSP object in the series.

Instance Methods [hide private]
 
__init__(self, filename, window='Input', nextModule=None, fourCC_str='XVID', fps=15, size=None, bw=False, no_annotations=False)
Constructor
source code
 
addFrame(self, img) source code
 
_onNewFrame(self, img, fn, **kwargs)
Override this abstract method with the processing your object performs on a per-frame basis.
source code

Inherited from AbstractVSP: __call__

Method Details [hide private]

__init__(self, filename, window='Input', nextModule=None, fourCC_str='XVID', fps=15, size=None, bw=False, no_annotations=False)
(Constructor)

source code 

Constructor

Parameters:
  • filename - The full output filename. Include the extension, such as .avi.
  • window - The window name to use when displaying this VSP's output. Specify None to suppress showing the output, but note that if you modify the current image with annotations, those will be persisted "downstream" to later processors.
  • nextModule - A Video Stream Processor object that should be invoked on every frame after this processor has finished.
  • fourCC_str - The "Four CC" string that is used to specify the encoder.
  • fps - Frames per second. Not all codecs allow you to specify arbitrary frame rates, however.
  • size - A tuple (w,h) representing the size of the output frames.
  • bw - Specify true if you wish for a black-and-white only output.
  • no_annotations - set to True to output the original, non-annotated version of the image
Overrides: AbstractVSP.__init__

addFrame(self, img)

source code 
Parameters:
  • img - A pyvision img to write out to the video.

_onNewFrame(self, img, fn, **kwargs)

source code 

Override this abstract method with the processing your object performs on a per-frame basis. It is recommended that you do not directly call this method. Rather, the VSP is a callable object, and so the __call__ method takes care of invoking this method as well as calling the next module, if any.

Overrides: AbstractVSP._onNewFrame
(inherited documentation)