The ffmpeg gotchas that cost me the most renders while automating my video edits
Been automating my own rough cuts for a few months and most of the wasted time wasn't the interesting parts, it was ffmpeg behaving exactly as documented while I assumed otherwise. Writing these down in case they save someone else the renders.
-ss and -t must both come before -i when you're also changing speed. Put -t after the input and the trim still happens but the speed change silently doesn't apply to what you think it does. I lost a whole afternoon to an edit that was the right length and the wrong tempo, with no error anywhere.
ffprobe's stream dimensions are not the decoder's output dimensions. Phone footage carries a rotation matrix. ffprobe reports 1920x1080 with rotation=90, the decoder hands you 1080x1920, and if you size your composition off the probe you build the whole thing landscape for a vertical video. Probe display dimensions, or swap width/height yourself when rotation is 90 or 270.
silencedetect is the reliable clock, transcript timestamps are not. ASR word onsets drift 50-100ms and — this one I only learned last week from someone in another thread — the onset lands on the consonant, so cutting at a word onset chops the attack off the word. It sounds clipped even though every word is technically present. Anchor edges in the actual silence, use the transcript only to decide which silences are legal cut points.
Fade audio 30ms at every segment boundary. Concatenating cuts without it gives you a click at every join. Costs nothing, fixes it entirely: afade in at the start and out at the end of each segment.
Extract per segment, then concat losslessly. Trying to do a complex multi-segment trim in one filter graph was where I generated my most creative bugs. Cut each piece separately, concat demuxer at the end.
h264 needs even dimensions. Obvious once you hit it, invisible until you scale something to an odd number and the encoder refuses.
Whole thing is open source if it's useful — https://github.com/ranahaani/i-hate-editing — but the list above is the part worth having regardless of what you're building.
What else belongs on this list? I'm sure I've got more of these ahead of me.
Posted Sep 8, 2026, 11:48 AM UTC