From bff1a1470ead9032ab51e1896c0d1c4bb8407058 Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 23 Oct 2026 11:28:16 -0600 Subject: [PATCH] review: also drop ffmpeg's "Last message repeated N times" summary With stderr piped, ffmpeg collapses identical messages into one copy plus a summary line, which still failed the verdict. Co-Authored-By: Claude Opus 5.5 --- modules/videos/common.py | 5 ++++- modules/videos/test/test_common.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/videos/common.py b/modules/videos/common.py index b93123c4..6ae98dc9 100644 --- a/modules/videos/common.py +++ b/modules/videos/common.py @@ -164,7 +164,10 @@ def tail_decode_command(video_path: Path, seconds: int = None) -> Tuple[str | Pa # The null muxer complains about duplicate timestamps after the frames have decoded; it is not damage. -TAIL_DECODE_IGNORED_ERRORS = re.compile(r'^\[null @ \w+] Application provided invalid, non monotonically increasing dts') +# A repeat summary only counts the previous message, whose first copy is still judged. +TAIL_DECODE_IGNORED_ERRORS = re.compile( + r'^\[null @ \w+] Application provided invalid, non monotonically increasing dts' + r'|^\s*Last message repeated \d+ times\s*$') def _tail_decode_verdict(return_code: int, stderr: bytes | str) -> Tuple[bool, str]: diff --git a/modules/videos/test/test_common.py b/modules/videos/test/test_common.py index 911e5b1a..0e76f188 100644 --- a/modules/videos/test/test_common.py +++ b/modules/videos/test/test_common.py @@ -676,6 +676,10 @@ NULL_MUXER_DTS = b'[null @ 0x5555faf7fa70] Application provided invalid, non mon # Duplicate timestamps are reported by the null muxer, not a decoder; the stream decoded. (0, NULL_MUXER_DTS, True, ''), (0, NULL_MUXER_DTS * 3, True, ''), + # ffmpeg collapses identical messages into a summary line when stderr is not a terminal. + (0, NULL_MUXER_DTS + b' Last message repeated 118 times\n', True, ''), + (0, NULL_MUXER_DTS + b' Last message repeated 118 times\n[h264 @ 0x1] Invalid NAL unit size\n', False, + '[h264 @ 0x1] Invalid NAL unit size'), (0, NULL_MUXER_DTS + b'[h264 @ 0x1] Invalid NAL unit size\n', False, '[h264 @ 0x1] Invalid NAL unit size'), (0, b'[h264 @ 0x1] error while decoding MB 3 4\n', False, '[h264 @ 0x1] error while decoding MB 3 4'), (1, NULL_MUXER_DTS, False, ''),