
A MediaStreamContainer describes a video file format. The most common video file format is AVI.
A list of valid MediaStreamContainer objects can be obtained from ICImagingControl.MediaStreamContainers.
The following code fragment shows how to create a MediaStreamSink to record an AVI file:
[C#]
// Create the MediaStreamSink. MediaStreamSink aviSink = new MediaStreamSink(); // Set AVI as the video file format. foreach( MediaStreamContainer msc in ICImagingControl1.MediaStreamContainers ) { if( msc.Name == "AVI" ) { aviSink.StreamContainer = msc; break; } } // Set DV Video encoder as the codec. foreach( AviCompressor codec in ICImagingControl1.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();
[VB.NET]
' Create the MediaStreamSink. Dim aviSink As New MediaStreamSink ' Set AVI as the video file format. For Each msc As MediaStreamContainer In IcImagingControl1.MediaStreamContainers If msc.Name = "AVI" Then aviSink.StreamContainer = msc Exit For End If Next ' Set DV Video encoder as the codec. For Each codec As AviCompressor In IcImagingControl1.AviCompressors If codec.Name = "DV Video Encoder" Then aviSink.Codec = codec Exit For End If Next ' Set the target file name. aviSink.Filename = "video.avi" ' Set the sink. IcImagingControl1.Sink = aviSink ' Start recording. IcImagingControl1.LiveStart()
Namespace: TIS.Imaging
Introduced in IC Imaging Control 3.0
| Property | Description | ||
| CustomCodecSupported | Returns whether this MediaStreamContainer allows an AviCompressor to be used to compress the recorded video. |
||
| ID | Returns a string containing the GUID of this MediaStreamContainer |
||
| Name | Returns the name of the MediaStreamContainer. |
||
| PreferredFileExtension | Returns the default file extension for video files that have been saved using this MediaStreamContainer. |
||