Stream_Interface
The stream interface allows to push raw samples (e.g. H264 samples) to rebuilt a stream, e.g. to be saved to MP4 or re-streamed.
Note that this feature requires to first install the Datastead RTSP/RTMP/HTTP/ONVIF DirectShow Source filter .
-
set VideoSource = vs_StreamInterface
-
specify the stream format to the StreamInterface_Format (e.g. "h264", "mpegts", "mjpeg", etc...)
-
specify the frame rate:
-
either enable StreamInterface_IsRealTime , so the time stamping will be the time the sample are received, and the frame rate deduced from it
-
either disable StreamInterface_IsRealTime = false and specify the frame rate to the StreamInterface_FrameRate , e.g. 29.97 (fps), so the real duration of the video clip will be made accordingly.
-
invoke VideoGrabber.StartPreview() or StartRecording()
then invoke periodically StreamInterface_PushData to push the samples, e.g. from a timer or another thread
The sample code is included in the "StreamInterface" demo project included in the package.