one behind duplicated, and the correct

This commit is contained in:
2026-04-03 11:54:22 -03:00
parent 101ed10ca1
commit 074925c360
2 changed files with 16 additions and 1 deletions

View File

@@ -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)