Two-Pixel Size Mismatch Crashed an ffmpeg Pipeline for Three Days Straight
A developer's automated Instagram video pipeline failed every morning for three consecutive days, with ffmpeg returning the cryptic exit code 234. The root cause turned out to be a source video measuring 1078×1920 pixels — just two pixels narrower than the standard 9:16 ratio. Because the subprocess call lacked output capture, ffmpeg's actual error message was silently discarded, leaving only the misleading numeric code visible. The scale filter calculated a height of 1924 pixels, which exceeded the pad filter's 1920-pixel target, causing an invalid-argument rejection since pad adds borders but cannot crop. The fix involved supplying both dimensions explicitly to the scale filter and using ffmpeg's automatic centering (-1:-1) for the pad step, ensuring the pipeline handles any aspect ratio without breaking.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in