Stream_Interface
The stream interface allows you to push raw samples (e.g. H264 samples) to rebuild a stream, e.g. to be saved to MP4 or re-streamed.
Note that this feature requires you to first install the Datastead RTSP/RTMP/HTTP/ONVIF DirectShow Source filter .
-
set VideoSource = vs_StreamInterface
-
assign 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 samples are received, and the frame rate deduced from it
-
or set StreamInterface_IsRealTime = false and assign the frame rate to the 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 included in the package.