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 communityUse 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
Replace the 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
Replace the n
in framerate with the rate that you want.
ffmpeg.exe -i input.mp4 -loop 1 -t 3 -i d.png -f lavfi -t 3 -i anullsrc -filter_complex "[0:v] [1:v] concat=n=2:v=1 [v]" -c:v libx264 -strict -2 -map "[v]" output.mkv
Note that for some reason ffmpeg will run forever when outputting to mp4 but works fine outputting to mkv. It's easy to then copy .mkv to .mp4 with ffmpeg -i output.mkv -codec copy output.mp4
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.
-framerate
)? Why do you specify -loglevel 'trace'
? That doesn't seem necessary for the command to complete properly.
Jun 29, 2017 at 22:50