使用ffmpeg根据时间戳替换单个帧 [英] using ffmpeg to replace a single frame based on timestamp

查看:150
本文介绍了使用ffmpeg根据时间戳替换单个帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CLI ffmpeg是否可以用指定的间隔用另一个图像替换特定的帧?我知道如何从视频中提取所有帧,然后将其重新拼接为另一视频,但是如果可能的话,我希望避免此过程.

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.

我的目标:

  • 提供视频文件input.mp4
  • 给出一个PNG文件image.png,并已知其恰好出现在input.mp4中的特定时间戳上.
  • 使用image.png创建out.mp4替换input.mp4的位置

推荐答案

基本命令是

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

其中 4.40 是要替换的帧的时间戳.

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

这篇关于使用ffmpeg根据时间戳替换单个帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆