大家论坛

 找回密码
 注册
查看: 2521|回复: 1

[讨论] How to show overlay image in a certain time span with ffmpeg

[复制链接]

1295

主题

1308

帖子

1310

金币

大家网研究生四年级

Rank: 25Rank: 25Rank: 25Rank: 25Rank: 25

积分
5457
发表于 2018-8-5 15:36 | 显示全部楼层 |阅读模式
I'm adding an overlay image to a video, which works, but I'd like to show it only in a certain time span:
ffmpeg -i video2.mp4 -i logo.png -filter_complex \"[0:v][1:v]overlay=10:10:enable=between(t\,0\,30)" -codec:a copy out2.mp4
This shows the error
key 'enable' not found
本人工科计算机专业程序媛一枚,感谢大家论坛并奉献本人收集的计算机资料,若本贴不能下载请回复,其他事由请点击这里
回复

使用道具 举报

1295

主题

1308

帖子

1310

金币

大家网研究生四年级

Rank: 25Rank: 25Rank: 25Rank: 25Rank: 25

积分
5457
 楼主| 发表于 2018-8-5 15:37 | 显示全部楼层
The syntax looks right to me. Use single quotes so you don't have to escape the expression:

ffmpeg -i input.mp4 -i watermark.png -filter_complex \
"[0:v][1:v] overlay=10:10:enable='between(t,1,2)'" output.mp4
If you don't have an enable option, make sure you use an ffmpeg version 2.0 or higher. Timeline editing is only supported there (see Changelog).

If you want multiple images overlaid, use something like this:

ffmpeg -i input.mp4 -i watermark.png -i watermark2.png -filter_complex \
"[0:v][1:v] overlay=10:10:enable='between(t,1,2)' [tmp]; [tmp][2:v] overlay=20:20:enable='between(t,2,3)'" output.mp4
本人工科计算机专业程序媛一枚,感谢大家论坛并奉献本人收集的计算机资料,若本贴不能下载请回复,其他事由请点击这里
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则



诚聘英才|移动端|Archiver|版权声明|大家论坛 ( 京ICP备06071611号,京公网安备11010802018363号 )

GMT+8, 2020-1-18 11:34 , Processed in 0.077750 second(s), 8 queries , Redis On.

Powered by Discuz!

© Comsenz Inc.

快速回复 返回顶部 返回列表