Camera: fix VFR video timestamps and close ffmpeg stderr
CI / test (push) Failing after 49s

- Pass -enc_time_base demux to ffmpeg so VFR video keeps the source timing
- Read the encoder's stderr only on failure, and always close the pipe
- Mirror the same ffmpeg flag and stderr close in test_camera.py
This commit is contained in:
nandi committed 2026-11-28 19:28:05 -08:00
1 parent 52b42890d6
commit 6cb0562654
2 files changed
+15 -4

No files matched your search

+2
View File
@@ -304,6 +304,7 @@ class TestCameraHelpers(unittest.TestCase):
"ffmpeg", "-y", "-loglevel", "error",
"-f", "matroska", "-i", "-",
"-fps_mode", "passthrough",
"-enc_time_base", "demux",
"-video_track_timescale", "1000",
"-c:v", "libx264", "-preset", "superfast", "-crf", "22", "-bf", "0",
"-pix_fmt", "yuv420p",
@@ -315,6 +316,7 @@ class TestCameraHelpers(unittest.TestCase):
proc.stdin.close()
rc = proc.wait(timeout=15)
err = proc.stderr.read().decode("utf-8", "replace")
proc.stderr.close()
self.assertEqual(rc, 0, msg="ffmpeg failed: " + err)
info = json.loads(subprocess.check_output([