# SRT pre-upload checklist From the ToolBrivio guide: https://toolbrivio.com/articles/srt-file-guide.html Tested October 20, 2026 with ffmpeg 7.1.5 on Debian 13. ffmpeg accepted most faults below without a warning, so do not treat "it converted" as a pass. ## 1. Structure and encoding - [ ] Run `sh srtcheck.sh captions.srt` (script below). Expect `utf-8: ok`, no other flags, and the cue count you expect. - [ ] Not valid UTF-8? Convert: `iconv -f WINDOWS-1252 -t UTF-8 captions.srt > captions.utf8.srt` (pick the real source encoding). - [ ] First bytes `ef bb bf`? Strip the BOM unless your target player needs it: `sed '1s/^\xEF\xBB\xBF//' in.srt > out.srt` (GNU sed). - [ ] Period timestamps? `sed -E 's/([0-9]{2}:[0-9]{2}:[0-9]{2})\.([0-9]{3})/\1,\2/g' in.srt > out.srt` - [ ] ASS tags like `{\an8}`? Strip for plain SRT/VTT targets: `sed 's/{\\an[0-9]}//g' in.srt > out.srt` - [ ] Bad numbering or missing blank lines? `ffmpeg -i in.srt out.srt` cleans both. ## 2. Timing (needs ears and the picture) - [ ] Overlap flagged? Decide where the line really ends and edit it by hand. - [ ] End before start flagged? Retime by hand. Do not "fix" it with an ffmpeg rewrite: that produced a half-second cue at the wrong time in our test. - [ ] Check one line near the start and one near the end against the video. Same error at both points = offset: `ffmpeg -itsoffset -2 -i late.srt fixed.srt` (negative = earlier). Growing error = drift: retime in a subtitle editor. ## 3. Output - [ ] MP4 soft subs: `-map 0 -map 1 -c:v copy -c:a copy -c:s mov_text`. Confirm with `ffprobe -v error -count_packets -show_entries stream=index,codec_name,nb_read_packets out.mp4`. - [ ] WebVTT: `ffmpeg -i captions.utf8.srt captions.vtt`, then: - `head -1 captions.vtt` prints `WEBVTT` - `grep -c -- '-->' captions.srt captions.vtt` counts match - [ ] Watch the finished video on the real destination before you publish. ## srtcheck.sh ```sh #!/bin/sh # srtcheck.sh FILE.srt -- quick structural checks for an SRT file f="$1" printf 'first 3 bytes: '; head -c 3 "$f" | od -An -tx1 iconv -f UTF-8 -t UTF-8 "$f" >/dev/null 2>&1 && echo "utf-8: ok" || echo "utf-8: INVALID ($(iconv -f UTF-8 -t UTF-8 "$f" 2>&1 >/dev/null | tail -1))" grep -nE '^[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3} -->' "$f" | sed 's/^/dot timestamp: line /' grep -n '{\\' "$f" | sed 's/^/ASS tag: line /' sed '1s/^\xEF\xBB\xBF//' "$f" | tr -d '\r' | awk -F' --> ' ' function t(x){gsub(/[,.]/,":",x); split(x,a,":"); return a[1]*3600+a[2]*60+a[3]+a[4]/1000} /-->/ { if (NR>2 && p2!="") print "no blank line before cue at line " NR-1 s=t($1); e=t($2); n++ if (e<=s) print "end <= start: line " NR if (n>1 && s