pipi cucu

This commit is contained in:
2026-04-02 00:14:43 -03:00
parent 73b824f6c3
commit 76ff720906
5 changed files with 217 additions and 27 deletions

View File

@@ -111,9 +111,14 @@ def extract_scene_frames(input_path, output_dir, scene_threshold=0.10,
except ffmpeg.Error as e:
# ffmpeg may exit non-zero on growing files (corrupt tail) but still
# produce valid frames. Return the stderr for parsing anyway.
log.debug("ffmpeg exited with error (may still have valid frames)")
stdout = e.stdout or b""
stderr = e.stderr or b""
err_text = stderr.decode("utf-8", errors="replace")
# Log the last meaningful line so we can see the real cause
for line in reversed(err_text.splitlines()):
if line.strip() and not line.startswith(" "):
log.debug("ffmpeg scene error: %s", line.strip())
break
stdout = e.stdout or b""
return stdout.decode("utf-8", errors="replace"), stderr.decode("utf-8", errors="replace")