I'd like to add some images at the end of a mp4 file via ffmpeg:
Any help would be greatly appreciated.
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It only takes a minute to sign up.Sign up to join this community
Use this command:
ffmpeg -i "video" -loop 1 -t 3 -i "image" -f lavfi -t 3 -i anullsrc -filter_complex "[0:v] [0:a] [1:v] [2:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" output.mp4
t value with the duration that you want the image to stay. I've supplied the common encoding parameters. Replace those as needed.
For an image sequence, use
ffmpeg -i "video" -f image2 -framerate n -i "image" -f lavfi -t 3 -i aevalsrc=0 -filter_complex "[0:v] [0:a] [1:v] [2:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -strict -2 -map "[v]" -map "[a]" output.mp4
n in framerate with the rate that you want.
Refer to this command:
ffmpeg -y -i input.mp4 -loop 1 -framerate 25 -t 3 -i foo.jpg -t 3 -f lavfi -i aevalsrc=0 -i bar.png -filter_complex '[1:0]scale=640:480[curtain];[0:0][0:1][curtain][2:0] concat=n=2:v=1:a=1[out];[out][3:0]overlay=W-w-25:H-h-25' -max_muxing_queue_size 1000 output.mp4 -loglevel 'trace'
this will add an image at end of the mp4 ,and add watermake to the mp4.