How to append 2 seconds of silence to an existing movie MP4 with ffmpeg?

◇◆丶佛笑我妖孽 提交于 2020-03-25 13:41:59

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!