The MediaStreamSink allows video files to be recorded in a more sophisticated manor than is possible using AviStartCapture and AviStopCapture. However, for simple tasks, the methods AviStartCapture and AviStopCapture are better suited, as they are really easy to use. A MediaStreamSink can save image data to video files in various formats and optionally allows you to specify one or more FrameFilters that can analyze and/or transform the image data, before it is written to the video file.

The FrameFilter implementation can also drop certain frames, thus enabling lapse recording applications to be easily authored. The video file format is specified by a MediaStreamContainer, while the format of the image data in the file is determined by a codec, represented as an AviCompressor object. The MediaStreamContainer determines the video file format; the most common MediaStreamContainer is AVI. Many media stream containers allow the specification of an AviCompressor to compress the image data before writing it to the file.


The following code fragment shows how to create a MediaStreamSink to record an AVI file.

// Create the MediaStreamSink. MediaStreamSink aviSink = new MediaStreamSink(); // We do not set aviSink.StreamContainer to record an AVI file, // as AVI is the default file format. // Set DV Video encoder as the codec. foreach( AviCompressor codec in AviCompressor.AviCompressors ) { if( codec.Name == "DV Video Encoder" ) { aviSink.Codec = codec; break; } } // Set a target file name. aviSink.Filename = "video.avi"; // Set the sink. ICImagingControl1.Sink = aviSink; // Start recording. ICImagingControl1.LiveStart();


    Namespace: TIS.Imaging
    Introduced in version 3.0




Property Description

Returns or sets the used AviCompressor.


Returns or sets the name of the target video file.


The FrameFilters property grants access to a FrameFilters collection that can be used to manipulate the filter chain used to transform the image data, before it is written to the video file.


Returns or sets the used MediaStreamContainer.


Method Description

Creates a new MediaStreamSink.

<< Classes