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. Dim aviSink As New MediaStreamSink ' We do not set aviSink.StreamContainer to record an AVI file, ' as AVI is the default file format. ' Set the DV Video Encoder as the codec. Dim n As Integer n = ICImagingControl1.AviCompressors.FindIndex("DV Video Encoder") aviSink.Codec = ICImagingControl1.AviCompressors(n) ' Set a target file name. aviSink.FileName = "video.avi" ' Set the sink. ICImagingControl1.Sink = aviSink ' Start recording. ICImagingControl1.LiveStart
Introduced in IC Imaging Control 3.0
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.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.