To repeat the first frame of a video, for example, filling it in order to compensate for a longer sound, you can use the following pipeline.
ffmpeg -i video.mp4 -vframes 1 -f image2 image.jpg ffmpeg -loop 1 -i image.jpg -t 5 pad.mkv ffmpeg -i pad.mkv -i video.mp4 -i audio.mp3 -filter_complex '[0:v] [1:v] concat' -c:a copy -map 2:a out.mkv
(The Concat filter is preferred over the concatenation input, since the codecs of the video and clip add-ons may differ.)
In contrast, the sound of paddings with silence at the beginning is inserted in only one line.
ffmpeg -i video.mp4 -i audio.mp3 -map 0:v -filter_complex 'aevalsrc=0:duration=5 [pad],[pad] [1:a] concat=v=0:a=1' -c:v copy out.mkv
Is it possible to compress video completion in one execution of ffmpeg?
source share