Stream Recorder SDK (.Net)  Version 1.0.17
Getting Started with TS Stream Recorder

In order to start recording with TSRecorder SDK, you'll need to add the reference to TSRecorderWr.dll as well as "using TSRecorderWr;" statement.

using TSRecorderWr;
// Create an instance of TSRecorderWr
CTSRecorderWr m_TsRecorder = new CTSRecorderWr();
// Setup events
m_TsRecorder.RecorderEvent += new NotifyRecorderEvent(recorder_RecorderEvent);
m_TsRecorder.ErrorEvent += new NotifyError(recorder_ErrorEvent);
// Initialize recorder
// Configure network
NetSourcePropsWr netSrc = new NetSourcePropsWr();
netSrc.IP = "227.1.1.1";
netSrc.Port = 1234;
// Configure target
FileTargetPropsWr fileTrg = new FileTargetPropsWr();
fileTrg.Dir = @"C:\Movie\";
fileTrg.BaseName = "Test.ts";
fileTrg.SegmentationType = FileSegmentationTypeWr.SegmentationType_Duration;
fileTrg.SegmentDuration = TimeSpan.FromSeconds(10);
fileTrg.GopAlignedSegmentation = true;
// Initialize recorder
m_TsRecorder.Init(netSrc, fileTrg, ProcessingModeWr.CUT_ON_GOP);
...
// Start recording
m_TsRecorder.Start();
// Process events
void recorder_ErrorEvent(Error_Type e, string err)
{
Console.WriteLine(string.Format("{0}: Error Event: {1} - {2}", DateTime.Now, e.ToString(), err));
}
void recorder_RecorderEvent(Recorder_Event ev, string info, long param)
{
Console.WriteLine(string.Format("{0}: Rec Event: {1} - {2} ({3})", DateTime.Now, ev.ToString(), info, param));
}
Untitled 1




 Copyright 2020,    IMPLEOTV SYSTEMS LTD