Quick start from the TVideoGrabber SDK

To use the filter with the Datastead TVideoGrabber SDK just ignore all the other chapters in this documentation, you just need to install the filter and then use the following TVideoGrabber sample code, in the examples below for an Axis IP Camera.

Note:

The TvideoGrabber SDK starts by default the RTSP filter asynchronously, so invoking StartPreview() or StartRecording() returns true if the URL syntax is connect and exits immediately without waiting for the connection to complete, a notification occurs later when the preview or recording starts by the OnPreviewStarted or OnRecordingStarted events (a connection that fails is reported by the OnLog event)

(to make the connection to be sychrone and wait when invoking StartPreview, disable the VideoGrabber.OpenURLAsync property)


Preview or an ONVIF camera:

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "onvif://192.168.0.25"

VideoGrabber.SetAuthentication (at_IPCamera, "onvifuser", "onvifpassword");

VideoGrabber.StartPreview()


Recording of an ONVIF camera, without preview (saves CPU):

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "onvif://192.168.0.25"

VideoGrabber.SetAuthentication (at_IPCamera, "onvifuser", "onvifpassword");
VideoGrabber.VideoRenderer = vr_None;
VideoGrabber.FrameGrabber = fg_Disabled;
VideoGrabber.RecordingMethod = rm_MP4;

VideoGrabber.StartRecording()


Preview or an RTSP URL:

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "rtsp://192.168.0.25/axis-media/media.amp?videocodec=h264"

VideoGrabber.SetAuthentication (at_IPCamera, "root", "admin");

VideoGrabber.StartPreview()


Preview + audio rendering:

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "rtsp://192.168.0.25/axis-media/media.amp?videocodec=h264&audio=1"

VideoGrabber.SetAuthentication (at_IPCamera, "root", "admin");

VideoGrabber.AudioDeviceRendering = true

VideoGrabber.StartPreview()


Preview + MP4 recording (video only):

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "rtsp://192.168.0.25/axis-media/media.amp?videocodec=h264"

VideoGrabber.SetAuthentication (at_IPCamera, "root", "admin");

VideoGrabber.RecordingMethod = rm_MP4

VideoGrabber.RecordingFileName = "c:\thefolder\thefilename.MP4" (*)

VideoGrabber.StartRecording()


Preview + audio rendering + MP4 audio/video recording:

VideoGrabber.VideoSource = vs_IPCamera

VideoGrabber.IPCameraURL = "rtsp://192.168.0.25/axis-media/media.amp?videocodec=h264&audio=1"

VideoGrabber.SetAuthentication (at_IPCamera, "root", "admin");

VideoGrabber.AudioDeviceRendering = true

VideoGrabber.RecordingMethod = rm_MP4

VideoGrabber.AudioRecording = true

VideoGrabber.RecordingFileName = "c:\thefolder\thefilename.MP4" (*)

VideoGrabber.StartRecording()



Generating a new file name on the fly:

(we suppose the recording is currently running)


VideoGrabber.RecordToNewFileNow("c:\thefolder\thenewfilename.mp4", true)


To let TvideoGrabber generate the file names automatically pass an empty string as file name.



To pause the recording, pass a "nul" file name with the same extension and without file path, e.g:

VideoGrabber.RecordToNewFileNow("nul.mp4", true)


Pausing/resuming the recording:

(we suppose the recording is currently running)


To pause the recording, invoke:


DatasteadRtspSourceConfig.Action (RTSP_Action_PauseRecording, "");


To resume the recording, invoke:


DatasteadRtspSourceConfig.Action (RTSP_Action_ResumeRecording, "");


43