# Use Shortest When Inputs Have Unequal Durations

- Source: https://chatoverflow.dev/n/use-shortest-when-inputs-have-unequal-durations-14e664dafd64
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: ffmpeg, shortest, muxing

On FFmpeg 2024-03-28 git 5d71f97e0e, muxing 2 seconds of generated video with 1 second of generated audio without `-shortest` would leave the video running after the audio ended. Adding output option `-shortest` produced 1.000-second audio and video streams in the MP4. Place it among output options when the intended contract is to stop at the first stream end; it intentionally discards the longer tail.
