DirectShow Filters
RTSP/RTMP DirectShow Source Filter SDK v1.7
Description
The Datastead RTSP/RTMP DirectShow Source filter SDK is designed to let you build DirectShow graphs that can receive live RTSP and RTMP streams.
The source filter decompresses the audio and video streams and exposes the corresponding audio and video output pins.
It is thread-safe, multiple instances can be used concurrently in the same application.
The filter can be simply configured by passing the RTSP/RTMP URL through the standard IFileSourceFilter interface.
The optional filter settings can be passed as arguments added to the end of the RTSP URL.
Per-developer license, no runtime fees (you can distribute the application you have developed with no restrictions).
Note:
The Datastead RTSP/RTMP DirectShow Source filter SDK uses libraries from the FFmpeg project under the LGPLv2.1 or later, written and copyrighted by third-party developers.
Datastead does not own FFmpeg, the FFmpeg owners can be found here.
The instructions to get source code of the FFmpeg libraries used by this filter, and eventually to rebuild these FFmpeg dlls, are specified in the "FFmpeg_LGPL_dlls.htm" included under the "FFmpeg_REDIST" folder of the package.
Download
DatasteadRTSPSourceSDKEval_1.7.msi (recommended) : evaluation package with MSI installer, installs the SDK in "\Program Files\Datastead Software\RTSP-RTMP DirectShow Source SDK (evaluation)", the filter is registered automatically during the install.
DatasteadRTSPSourceEval_v1.7.zip : .ax DirectShow filter file, DLLs and documentation, require a manual install with regsvr32.exe
These evaluation packages have the following limitations:
- the video appears successively normal, colored or top-down,
- the audio level decreases then increases progressively.
These limitations are removed in the licensed version.
RTSPSrcTest.zip : minimal sample code (graph building and pin rendering) in a Visual Studio test project.
License
The license is a per-developer license, no runtime fees. You can distribute the application you have developed with no restrictions.
By purchasing a license you are granted a non-exclusive, royaty-free right to distribute the filter with your end-user application(.exe) without limitation of the number of end-user computers.
Support
The license includes 2 years of free upgrades and e-mail support.
We support the DirectShow filter and we update periodically the filter with the new releases of FFmpeg. We do not support the FFmpeg libraries used by the filter.
The filter can be installed either manually with regsvr32.exe, either automatically from the .msi installer, we recommend the .msi method.
Automatic install with the DatasteadRTSPSourceSDKEval.msi package
- run DatasteadRTSPSourceSDKEval.msi
The SDK is installed in "C:\Program Files\Datastead Software\RTSP-RTMP DirectShow Source SDK (evaluation)".
The filter is registered automatically by the msi installer.
The SDK folder contains:
- the documentation
- the DatasteadRTSPSourceRedist.msi, that can distributed to deploy the filter with your application
- to install DatasteadRTSPSourceRedist.msi automatically during the deployment, look at the install_redist_from_command_line_without_user_dialog.cmd that shows how to install it automatically from the command line.
Manual install of the DatasteadRTSPSourceEval_v1.7.zip package with regsvr32.exe
Install:
- unzip the package to a folder,
- run regsvr32.exe c:\unzipfolder\DatasteadRTSPSource.ax as administrator to register the filter (use the "/s" parameter for a silent registering)
Uninstall:
- run regsvr32.exe /u c:\unzipfolder\DatasteadRTSPSource.ax to unregister the filter (as administrator on Vista and later)
Alternatively you can run REGISTER_FILTER.cmd and _UNREGISTER_FILTER.cmd, that will invoke regsvr32.exe (right-click "run as Administrator" on Vista and later).
Usage
Filter CLSID: {55D1139D-5E0D-4123-9AED-575D7B039569}
Programmatically:
- add the "Datastead RTSP/RTMP DirectShow Source" filter to the graph,
- query the IFileSourceFilter interface,
- pass the RTSP URL (followed by the optional parameters, if any) to the filter by invoking FileSourceFilter.Load ("rtsp://...", NULL)
- render the desired pin(s) and run the graph.
Click here to download the Visual Studio C++ demo project.
From GraphEdit:
- insert the "Datastead RTSP/RTMP DirectShow Source" filter,
- when the popup appears to select a file, press the "Esc" key, or click "Cancel",
- right-click on the filter properties, enter the RTSP URL (followed by the optional parameters, if any),
- wait a few seconds for the filter to connect(*), then render the desired pin(s) and run the graph.
(*) while the filter connects to the URL, the graph seems frozen, just try to click on the graph area, when the mouse responds this means that the URL is opened (or the connection failed after the timeout).
From the TVideoGrabber SDK:
From MainDemo.exe:
- in the "video source" tab, select "video file or URL" as video source,
- enter the RTSP URL in the "video source = file or URL" groupbox,
- if the RTSP URL has audio, go to the "audio" tab and check "audio device rendering",
- go back to the "video source" tab and click "Start preview".
Programmatically as IP camera:
- set VideoGrabber.VideoSource = vs_IPCamera,
- set VideoGrabber.IPCameraURL = "rtsp://..." // specify the RTSP URL to use,
- invoke VideoGrabber.StartPreview()
Programmatically as an URL source:
- set VideoGrabber.VideoSource = vs_VideoFileOrURL,
- set VideoGrabber.VideoSource_FileOrURL = "rtsp://..." // specify the RTSP URL to use,
- invoke VideoGrabber.StartPreview()
Optional filter settings
The filter settings are passed as parameters at the end of the RTSP URL, and identified by a ">" character before the name of each parameter.
e.g. to specify a a max frame of 15.0 fps and a video width of 320 (the video height will be calculated automatically) for an Axis IP camera M1054:
rtsp://user:password@192.168.1.130/axis-media/media.amp?videocodec=h264&audio=1>maxframerate=15.0>width=320
>buffer
Duration of the initial buffering in milliseconds.
By default a buffering of 1 second (bufffer=1000) is used.
It is possible to decrease or increase the initial buffering duration, e.g. to specify an initial buffering of 500ms:rtsp://user:pass@192.168.1.140:8500/live/mpeg4>buffer=500
>maxframerate
Specifies the maximal frame rate used by the filter to deliver the video samples.0.0 (default): if maxframerate is not specified the samples are delivered as fast as possible, depending on the RTSP source frame rate and the available network bandwidth,
> 0.0 = the filter limits the delivery frame rate to the specified values (e.g. 29.97, 25.0, 10.0, etc...)
E.g. for a max video frame rate of 5 fps:
rtsp://user:pass@192.168.1.140/axis-media/media.amp>maxframerate=5.0
>width and/or >height
By default the video pin outputs the native video size of the video frame.
It is possible to specify a custom video size:
- either by specifying both the video width and video height,
- either by specifying only the video width, in this case the video height is calculated automatically depending on the native aspect ratio,
- either by specifying only the video height, in this case the video width is calculated automatically depending on the native aspect ratio.
This is useful e.g. to reduce the video size, and/or to reduce the CPU load of the downstream filters.
- e.g. to specify a video size of 320x240:
rtsp://user:pass@192.168.1.140:8500/live/mpeg4>width=320>height=240
- e.g. to specify a video width of 640 so the height is calculated automatically:
rtsp://user:pass@192.168.1.22/axis-media/media.amp>width=640
>timeout
Specifies the maximum connection/receive timeout expressed in milliseconds. If not specified the default timeout is 10000 (10s).
e.g. to specify a timeout of 20 seconds: rtmp://192.168.2.40/mystreamingsource/live>timeout=20000
>maxanalyzeduration
Specifies the maximum stream analyze duration in milliseconds when the URL is loaded.
e.g.: rtmp://192.168.2.40/mystreamingsource/live>buffer=4000>maxanalyzeduration=2000
>audsamplespersec
Lets specify the audio bit rate manually.
Using this parameter is usually not required, unless miscongured URL on the RTMP server.
e.g.: rtmp://192.168.2.40/mystreamingsource/live>buffer=500>audsamplespersec=48000
Basler IP cameras: random disconnection
- upgrade firwmare to version 3.4.