using ffmpeg to replace a single frame based on timestamp

廉价感情. 提交于 2021-01-01 02:15:47

问题


Is it possible to CLI ffmpeg to replace a specific frame at a specified interval with another image? I know how to extract all frames from a video, and re-stitch as another video, but I am looking to avoid this process, if possible.

My goal:

  • Given a video file input.mp4
  • Given a PNG file, image.png and given its known to occur at exactly a specific timestamp within input.mp4
  • create out.mp4 with image.png replacing that position of input.mp4

回答1:


The basic command is

ffmpeg -i video -i image \
       -filter_complex \
         "[1]setpts=4.40/TB[im];[0][im]overlay=eof_action=pass" -c:a copy out.mp4

where 4.40 is the timestamp of the frame to be replaced.



来源:https://stackoverflow.com/questions/50256904/using-ffmpeg-to-replace-a-single-frame-based-on-timestamp

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