- 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:
1 parent
52b42890d6
commit
6cb0562654
2 files changed
+15
-4
No files matched your search
+13
-4
@@ -2019,6 +2019,8 @@ class CameraEngine:
|
||||
"-",
|
||||
"-fps_mode",
|
||||
"passthrough",
|
||||
"-enc_time_base",
|
||||
"demux",
|
||||
"-video_track_timescale",
|
||||
"1000",
|
||||
"-c:v",
|
||||
@@ -2163,10 +2165,17 @@ class CameraEngine:
|
||||
if wt is not None:
|
||||
wt.join(timeout=15.0)
|
||||
rc = proc.wait(timeout=15.0)
|
||||
if rc != 0 and proc.stderr is not None:
|
||||
err = proc.stderr.read().decode("utf-8", "replace").strip()
|
||||
if err and self.on_error:
|
||||
self.on_error("Video encode error: " + err)
|
||||
if proc.stderr is not None:
|
||||
try:
|
||||
if rc != 0:
|
||||
err = proc.stderr.read().decode("utf-8", "replace").strip()
|
||||
if err and self.on_error:
|
||||
self.on_error("Video encode error: " + err)
|
||||
finally:
|
||||
try:
|
||||
proc.stderr.close()
|
||||
except Exception:
|
||||
pass
|
||||
return path, frames
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user