=== 0. versions (2026-11-21) === ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers Python 3.12.3 === 1. build the scene and the good SDH file === end 19.46 durs {'l1': 1.81, 'l2': 2.915, 'l3': 1.431, 'l4': 1.0, 'l5': 1.46} h264,video,19.480000 aac,audio,18.260000 === 2. sdh.srt (good file) === 1 00:00:00,500 --> 00:00:01,900 [knocking at the door] 2 00:00:02,000 --> 00:00:03,960 [Mara] Come in, it is open. 3 00:00:04,200 --> 00:00:07,265 [Joel] Sorry I am late. The traffic was awful. 4 00:00:08,000 --> 00:00:10,931 -[Mara] Did you bring the files? -[Joel] Right here. 5 00:00:12,000 --> 00:00:13,600 [phone ringing] 6 00:00:13,600 --> 00:00:16,600 [soft humming tone plays] 7 00:00:16,800 --> 00:00:18,410 [Joel] Let me answer that. === 3. sdh-lint.py: control (good file must give no findings) and bad.srt (7 injected faults, so 7 findings) === $ python3 sdh-lint.py sdh.srt no findings exit=0 $ python3 sdh-lint.py bad.srt cue 1: label not in square brackets: '(knocking at the door)' cue 2: label not in square brackets: 'MARA: Come in, it is open.' cue 3: line of 67 characters, the limit is 42: '[Joel] Sorry I am late. The traffic was awful on the highway today.' cue 4: hyphen followed by a space (use '-' directly before the text): '- [Mara] Did you bring the files?' cue 5: speaker ID or sound effect in italics: '[phone ringing]' cue 7: three dots instead of the single ellipsis character U+2026 cue 7: starts at 16.800s before the previous cue ends at 17.200s exit=1 === 4. do the cue windows hold sound? (controls: two windows where nothing was placed) === window mean volume cue 1 0.50- 1.90 s -23.0 dB [knocking at the door] cue 2 2.00- 3.96 s -22.3 dB [Mara] Come in, it is open. cue 3 4.20- 7.26 s -16.3 dB [Joel] Sorry I am late. cue 4 8.00- 10.93 s -20.0 dB -[Mara] Did you bring the file cue 5 12.00- 13.60 s -28.5 dB [phone ringing] cue 6 13.60- 16.60 s -12.9 dB [soft humming tone plays] cue 7 16.80- 18.41 s -15.6 dB [Joel] Let me answer that. control: gap, nothing placed 11.0- 11.9 s -91.0 dB control: gap between cues 2, 3 3.9- 4.2 s -91.0 dB === 5. Koldflux subtitle checker (live, headless Chromium); sdh-short.srt = sdh.srt with the first cue ended at 1.500 s instead of 1.900 s === { "sdh.srt": { "cues": "7", "chars": "213", "avg_cps": "13.7", "longest": "32", "overlaps": "0", "over20": "0", "msg": "7 cues read" }, "sdh-short.srt": { "cues": "7", "chars": "213", "avg_cps": "14.0", "longest": "32", "overlaps": "0", "over20": "1", "msg": "7 cues read" }, "bad.srt": { "cues": "7", "chars": "236", "avg_cps": "15.0", "longest": "67", "overlaps": "1", "over20": "2", "msg": "7 cues read" } } === 6. published commands, each run on the test file and on one edge input (details in commands.log) === published: python3 sdh-lint.py sdh.srt run: python3 sdh-lint.py sdh.srt; python3 sdh-lint.py bad.srt no findings cue 1: label not in square brackets: '(knocking at the door)' cue 2: label not in square brackets: 'MARA: Come in, it is open.' cue 3: line of 67 characters, the limit is 42: '[Joel] Sorry I am late. The traffic was awful on the highway today.' cue 4: hyphen followed by a space (use '-' directly before the text): '- [Mara] Did you bring the files?' cue 5: speaker ID or sound effect in italics: '[phone ringing]' cue 7: three dots instead of the single ellipsis character U+2026 cue 7: starts at 16.800s before the previous cue ends at 17.200s exit=1 edge: bad.srt with 7 injected faults: findings printed, exit 1 published: ffmpeg -i sdh.srt sdh.vtt run: ffmpeg -y -v error -i sdh.srt sdh.vtt; ffmpeg -y -v error -i edge-mixed.srt edge.vtt; head -8 sdh.vtt; echo ---; cat edge.vtt [Mara] Come in, it is open. --- WEBVTT 00:00.500 --> 00:02.000 [coughs] I can’t stay long. 00:02.500 --> 00:04.000 [door slams] 00:04.500 --> 00:06.500 ♪ [Joel singing] La la la ♪ exit=0 edge: edge-mixed.srt: UTF-8 BOM, CRLF line endings, a music note and a curly apostrophe published: ffmpeg -i demo.mp4 -vf "subtitles=sdh.srt" -c:a copy burned.mp4 run: ffmpeg -y -v error -an -i demo.mp4 -c:v copy demo-noaudio.mp4; ffmpeg -y -v error -i demo.mp4 -vf 'subtitles=sdh.srt' -c:a copy burned.mp4; ffmpeg -y -v error -i demo-noaudio.mp4 -vf 'subtitles=sdh.srt' -c:a copy burned-noaudio.mp4; for f in burned.mp4 burned-noaudio.mp4; do echo $f; ffprobe -v error -show_entries stream=codec_type,codec_name -of csv=p=0 $f; done burned.mp4 h264,video aac,audio burned-noaudio.mp4 h264,video exit=0 edge: demo-noaudio.mp4 (same picture, audio removed with -an): -c:a copy with no audio stream published: ffmpeg -i demo.mp4 -i sdh.srt -map 0 -map 1 -c copy -c:s mov_text -metadata:s:s:0 language=eng -disposition:s:0 +hearing_impaired sdh-soft.mp4 run: ffmpeg -y -v error -i demo.mp4 -i sdh.srt -map 0 -map 1 -c copy -c:s mov_text -metadata:s:s:0 language=eng -disposition:s:0 +hearing_impaired sdh-soft.mp4; ffmpeg -y -v error -i demo.mp4 -i sdh.srt -map 0 -map 1 -c copy -c:s srt -metadata:s:s:0 language=eng -disposition:s:0 +hearing_impaired sdh-soft.mkv; ffmpeg -y -v error -i demo-noaudio.mp4 -i sdh.srt -map 0 -map 1 -c copy -c:s mov_text -disposition:s:0 +hearing_impaired soft-noaudio.mp4; for f in sdh-soft.mp4 sdh-soft.mkv soft-noaudio.mp4; do echo $f; ffprobe -v error -show_entries stream=index,codec_type,codec_name:stream_disposition=hearing_impaired:stream_tags=language -of compact=p=0 $f; done sdh-soft.mp4 index=0|codec_name=h264|codec_type=video|disposition:hearing_impaired=0|tag:language=und index=1|codec_name=aac|codec_type=audio|disposition:hearing_impaired=0|tag:language=und index=2|codec_name=mov_text|codec_type=subtitle|disposition:hearing_impaired=1|tag:language=eng sdh-soft.mkv index=0|codec_name=h264|codec_type=video|disposition:hearing_impaired=0 index=1|codec_name=aac|codec_type=audio|disposition:hearing_impaired=0 index=2|codec_name=subrip|codec_type=subtitle|disposition:hearing_impaired=1|tag:language=eng soft-noaudio.mp4 index=0|codec_name=h264|codec_type=video|disposition:hearing_impaired=0|tag:language=und index=1|codec_name=mov_text|codec_type=subtitle|disposition:hearing_impaired=1|tag:language=und exit=0 edge: same command into .mkv with -c:s srt, and a demo without audio (-map 0 has no audio to carry) published: python3 sdh-to-plain.py sdh.srt plain.srt run: python3 sdh-to-plain.py sdh.srt plain.srt; python3 sdh-to-plain.py edge-mixed.srt edge-plain.srt; cat edge-plain.srt 4 cues written 2 cues written 1 00:00:00,500 --> 00:00:02,000 I can’t stay long. 2 00:00:04,500 --> 00:00:06,500 ♪ [Joel singing] La la la ♪ exit=0 edge: edge-mixed.srt: a cue with a sound effect and dialogue, a cue that is only a sound effect, a sung line with an inline label === 7. frame from burned.mp4 at 9.5 s (two-speaker cue) === $ ffmpeg -y -v error -ss 9.5 -i burned.mp4 -frames:v 1 -q:v 3 caption-frame.jpg exit=0 done 2026-11-21T07:09:22Z