Skip to content

The Datastead RTSP/RTMP/HTTP/ONVIF DirectShow source filter

Capturing live streams and IP cameras requires installing our optional RTSP/RTMP/HTTP/ONVIF DirectShow source filter.

The filter does not need to be registered: the filter binaries (included in x86 and x64 subfolders) can simply be unzipped, either under the application.exe folder or in any folder specified as ExtraDLLPath (see also the installation information).

This filter decodes live streams through most of the common live protocols (ONVIF, RTSP, RTMP, UDP, RTP, SDP, HTTP, MMS, etc.) and, at the same time, can save the native frames received (H264, H265/HEVC, AAC, etc.) to .MP4, .FLV, .AVI, .MKV or .MOV containers without transcoding.

If a new file name is specified during the recording, the filter closes the previous file and opens the new one without losing frames between the 2 files.

When the filter is used in TVideoGrabber, TVideoGrabber configures it; however, most of the specific filter parameters can be controlled by adding and combining them at the end of the URL, as follows:

VideoGrabber.VideoSource = vs_IPCamera;
VideoGrabber.IPCameraURL = "rtsp://192.168.5.1/live.sdp>autoreconnect=0";
VideoGrabber.StartPreview ();

Another example, preview/recording of any ONVIF URL:

VideoGrabber.VideoSource = vs_IPCamera;
VideoGrabber.IPCameraURL = "onvif://192.168.5.1>buffer=0>autoreconnect=0";
VideoGrabber.SetAuthentication (at_IPCamera, "user", "password");
VideoGrabber.RecordingInNativeFormat = true;
VideoGrabber.RecordingMethod = rm_MP4;
VideoGrabber.StartRecording ();

The possible optional parameters are listed in the "Parameter Identifiers" section of the help: https://www.datastead.com/docs/rtsp/.

While the source is running, the settings and status values of the filter can also be read or changed with ONVIF_GetBool / ONVIF_SetBool, ONVIF_GetInt / ONVIF_SetInt, ONVIF_GetDouble / ONVIF_SetDouble and ONVIF_GetStr / ONVIF_SetStr, according to the suffix of the identifier (_bool, _int, _double, _str).