IC Imaging Control .NET

MediaStreamSink.MediaStreamSink Method

MediaStreamSink.MediaStreamSink Method

Creates a new MediaStreamSink.
Public Sub MediaStreamSink( codec As AviCompressor, filename As String ) As MediaStreamSink
Public MediaStreamSink MediaStreamSink( AviCompressor codec, String filename );
Parameter Description

Specifies the codec to be used by the MediaStreamSink.


Specifies the filename, to used by the MediaStreamSink when writing an AVI file.


Introduced in version 3.1


The following code fragment shows how to select a codec and create a MediaStreamSink to record an AVI file. After doing so a two second AVI file is recorded.

AviCompressor Codec = null; //Set DV Video encoder as codec. foreach( AviCompressor codec in ICImagingControl1.AviCompressors ) { if( codec.Name == "DV Video Encoder" ) { Codec = codec; break; } } // Create the MediaStreamSink using the selected codec and a filename. MediaStreamSink MSSink = new MediaStreamSink(Codec, "Test.AVI"); // Set the sink. ICImagingControl1.Sink = MSSink; // Start recording for two seconds. ICImagingControl1.LiveStart(); System.Threading.Thread.Sleep(2000); ICImagingControl1.LiveStop();
Dim Compressor As AviCompressor Compressor = Nothing ' Set DV Video encoder as codec. For Each codec As AviCompressor In IcImagingControl1.AviCompressors If codec.Name = "DV Video Encoder" Then Compressor = codec Exit For End If Next ' Create the MediaStreamSink using the selected codec and a filename. Dim MSSink As New MediaStreamSink(Compressor, "Test.AVI") ' Set the sink IcImagingControl1.Sink = MSSink 'Start recording for two seconds. IcImagingControl1.LiveStart() System.Threading.Thread.Sleep(2000) IcImagingControl1.LiveStop()
See also: ICImagingControl, ICImagingControl.LivePrepare, ICImagingControl.LiveStart, ICImagingControl.LiveVideoRunning

<< MediaStreamSink

Get in touch with us

About The Imaging Source

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.

Automated Imaging Association ISO 9001:2015 certified

Contact us