问题
I would like to append 2 seconds of silence to an existing video using ffmpeg. I would like to keep the last frame displayed while the 2 seconds of video playsback not a black screen.
Thank you.
回答1:
Use the tpad and apad filters:
ffmpeg -i input.mp4 -filter_complex "[0:v]tpad=stop_mode=clone:stop_duration=2[v];[0:a]apad=pad_dur=2[a]" -map "[v]" -map "[a]" output.mp4
A faster, but less compatible method is to stream copy the video and use the apad filter if your player and output container format supports dissimilar stream durations:
ffmpeg -i input.mp4 -filter_complex "[0:a]apad=pad_dur=2[a]" -map 0:v -map "[a]" -c:v copy output.mp4
If in doubt use the first command.
来源:https://stackoverflow.com/questions/60133816/how-to-append-2-seconds-of-silence-to-an-existing-movie-mp4-with-ffmpeg