Skip to main content

Code sample - Video capture to MPEG-2 file using TV Tuner with internal MPEG encoder

Delphi and C# (ActiveX) sample code.

Get list of available MPEG-2 Hardware Encoders

VideoCapture1.Special_Filters_Fill;
for I := 0 to VideoCapture1.Special_Filters_GetCount(SF_Hardware_Video_Encoder) - 1 do
cbMPEGEncoder.Items.Add(VideoCapture1.Special_Filters_GetItem(SF_Hardware_Video_Encoder, i));
VideoCapture1.Special_Filters_Fill();
for (int i = 0; i < VideoCapture1.Special_Filters_GetCount(VisioForge_Video_Capture_5.TxVFSpecFilterType.SF_Hardware_Video_Encoder); i++)
cbMPEGEncoder.Items.Add(VideoCapture1.Special_Filters_GetItem(VisioForge_Video_Capture_5.TxVFSpecFilterType.SF_Hardware_Video_Encoder, i));

Select encoder

VideoCapture1.Video_CaptureDevice_InternalMPEGEncoder_Name := cbMPEGEncoder.Items[cbMPEGEncoder.ItemIndex];
VideoCapture1.Video_CaptureDevice_InternalMPEGEncoder_Name = cbMPEGEncoder.Text;

Use DirectStream_MPEG format for output

VideoCapture1.OutputFormat := Format_DirectStream_MPEG;
VideoCapture1.OutputFormat = VisioForge_Video_Capture_5.TxVFOutputFormat.Format_DirectStream_MPEG;

Set video capture mode

VideoCapture1.Mode := Mode_Video_Capture;
VideoCapture1.Mode = VisioForge_Video_Capture_5.TxVFMode.Mode_Video_Capture;

Start capture

VideoCapture1.Start;
VideoCapture1.Start();

Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.