Skip to content

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 .

  1. set VideoSource = vs_StreamInterface

  2. specify the stream format to the StreamInterface_Format (e.g. "h264", "mpegts", "mjpeg", etc...)

  3. specify the frame rate:

  4. either enable StreamInterface_IsRealTime , so the time stamping will be the time the sample are received, and the frame rate deduced from it

  5. 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.

  6. 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.