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;
CTSRecorderWr m_TsRecorder = new CTSRecorderWr();
m_TsRecorder.RecorderEvent += new NotifyRecorderEvent(recorder_RecorderEvent);
m_TsRecorder.ErrorEvent += new NotifyError(recorder_ErrorEvent);
NetSourcePropsWr netSrc = new NetSourcePropsWr();
netSrc.IP = "227.1.1.1";
netSrc.Port = 1234;
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;
m_TsRecorder.Init(netSrc, fileTrg, ProcessingModeWr.CUT_ON_GOP);
...
m_TsRecorder.Start();
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));
}