ffmpeg - How to add audio to specific time [ffmpeg]
问题描述
So far, I've manage to add audio to the video in ffmpeg but it is playing all along. The enable='between(t,start,end)' option is not working
I have tried googling for possible answers but my approach is different. I wanted to enable/disable the audio repeatedly in the video.
SO far I have this code:
ffmpeg -y -i cut.mp4 -i typing.mp3 -filter_complex "[0:v]drawtext=enable='between(t,0,3)':fontfile=fonts/RobotoBoldCondensed.ttf:text='Finding Nemo...':fontcolor=white:fontsize=24:x=50:y=h-h/5+20[v0]; [1:a]volume=enable='between(t,0,3)'[a3]" -vcodec libx264 -c:a libfdk_aac -map "[v0]" -map "[a3]" -preset ultrafast -async 1 output.mp4
解决方案
默认情况下,音量过滤器保持输入音量。因此,您应该将表达式设置为 0 并反转启用表达式。
volume=0:enable='not(between(t,0,3))'
这将使前 3 秒的音频静音。
推荐阅读
- docker-compose - 无法在 CentOS 上运行自托管哨兵
- c# - C#正则表达式匹配一个词作为一个整体或只有特殊字符作为前缀或后缀
- numpy - 带索引的 Bincount
- primefaces - Primefaces标签焦点在未打开的侧边栏中
- postgresql - Postgres解释分析:总时间大大超过部分总和
- java - Android:onCreate 中的 Intent startActivity 给出了空白屏幕
- django - 将表单数据保存到 models.ForeignKey 字段
- java - 为什么在 swagger api 请求中找不到响应部分?404错误/这是jsp项目
- python - AttributeError:“DataFrame”对象没有属性“rt”
- javascript - 获取功能无限加载(Shopify)