Stream_Interface
With the stream interface, raw samples (e.g. H264 samples) are pushed to rebuild a stream, e.g. to save it to MP4 or to re-stream it.
This feature requires the Datastead RTSP/RTMP/HTTP/ONVIF DirectShow Source filter to be installed first.
- Set VideoSource = vs_StreamInterface.
- Assign the stream format to StreamInterface_Format (e.g. "h264", "mpegts", "mjpeg", etc.).
-
Specify the frame rate:
- either enable StreamInterface_IsRealTime, so that the samples are time-stamped with the time they are received, and the frame rate is deduced from it,
- or set StreamInterface_IsRealTime = false and assign the frame rate to StreamInterface_FrameRate, e.g. 29.97 (fps), so that the duration of the video clip is computed accordingly.
-
Invoke VideoGrabber.StartPreview() or StartRecording().
- Then periodically invoke StreamInterface_PushData to push the samples, e.g. from a timer or another thread.
The sample code is included in the "StreamInterface" demo project of the package.