Skip to content

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 .

  1. set VideoSource = vs_StreamInterface

  2. assign 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 samples are received, and the frame rate deduced from it

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

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