Send timestamp with simulation frames
This commit is contained in:
parent
7ba2c03f61
commit
764306544c
1 changed files with 4 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ import io
|
|||
import logging
|
||||
import re
|
||||
import time
|
||||
from datetime import datetime
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Optional, Self, overload
|
||||
|
|
@ -467,9 +468,10 @@ class SimulatedCamera(BaseCamera):
|
|||
last_frame_t = time.time()
|
||||
|
||||
frame = self.generate_frame()
|
||||
self.mjpeg_stream.add_frame(_frame2bytes(frame))
|
||||
timestamp = datetime.fromtimestamp(last_frame_t)
|
||||
self.mjpeg_stream.add_frame(_frame2bytes(frame), timestamp)
|
||||
ds_frame = frame.resize((320, 240), resample=Image.Resampling.NEAREST)
|
||||
self.lores_mjpeg_stream.add_frame(_frame2bytes(ds_frame))
|
||||
self.lores_mjpeg_stream.add_frame(_frame2bytes(ds_frame), timestamp)
|
||||
|
||||
@lt.action
|
||||
def discard_frames(self) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue