ffmpeg – Add 3sec fade out of the last frame to a video

For example, given a video 1.mp4 (no audio) of 17s, output a 20s video where the last frame fades out.

What I came up with:

  1. Extract the last frame

ffmpeg -sseof -1 -i 1.mp4 -update true last.png

  1. Create a 3s fade-out video

ffmpeg -r 60 -loop 1 -t 3 -i last.png -vf "fade=out:st=0:d=3" 2.mp4 -y

  1. concatenate

ffmpeg -f concat -i list.txt -c copy 3.mp4 -y

where list.txt is

file '1.mp4'
file '2.mp4'

I was wondering if there’s an easier method, e.g. something base on

How to use ffmpeg to fade in/out a veriable frame rate video clip with unknown duration

Read more here: Source link