published: python3 sdh-lint.py sdh.srt run: python3 sdh-lint.py sdh.srt no findings exit=0 edge: an empty file also prints no findings and exits 0, and a CRLF+BOM file with a music note and curly apostrophe is clean published: python3 sdh-lint.py bad.srt run: 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 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