class documentation

class MJPEGStreamWithTimestamp(lt.outputs.MJPEGStream): (source)

View In Hierarchy

An MJPEG stream where the frame time can be recorded with the frame.

This can be used to capture when the image was taken by the sensor if known rather than take the time it is added into the ring buffer.

Method add_frame Add a JPEG to the MJPEG stream.
def add_frame(self, frame: bytes, timestamp: datetime | None = None): (source) ΒΆ

Add a JPEG to the MJPEG stream.

Modify the standard function to have an option to send in the capture time.

Parameters
frame:bytesThe frame to add
timestamp:datetime | NoneThe time the frame was captured.
Raises
ValueErrorif the supplied frame does not start with the JPEG start bytes and end with the end bytes.