问题
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