one behind duplicated, and the correct
This commit is contained in:
@@ -263,6 +263,7 @@ class StreamManager:
|
||||
def _read_stdout():
|
||||
frame_num = start_number
|
||||
offset = self.current_global_offset
|
||||
last_pts = -1.0
|
||||
buf = b""
|
||||
raw_fd = proc.stdout.fileno()
|
||||
while True:
|
||||
@@ -288,6 +289,12 @@ class StreamManager:
|
||||
log.warning("No timestamp for scene frame %d", frame_num)
|
||||
pts_time = 0.0
|
||||
|
||||
# Skip flush frames (within 100ms of previous = duplicate)
|
||||
if pts_time - last_pts < 0.1:
|
||||
log.debug("Skipping flush frame at pts=%.3f", pts_time)
|
||||
continue
|
||||
last_pts = pts_time
|
||||
|
||||
frame_id = f"F{frame_num:04d}"
|
||||
frame_path = self.frames_dir / f"{frame_id}.jpg"
|
||||
frame_path.write_bytes(jpeg_data)
|
||||
|
||||
Reference in New Issue
Block a user