FFMPEG filter之Timeline editing

有些filter是支持enable参数的。比如drawtext,对于这些支持enable参数的filter,这个参数通过判断一些逻辑问题,来判断当帧是否进入这个filter。

如果逻辑是零,那就不改变帧的信息,把帧传入filtergraph中当前filter 的下一个filter中;

如果逻辑是非零,那当前帧就进入该filter,接受这个filter的处理,处理完该帧后再传给下一个filter
enableoption支持的逻辑表达式中的值有:

  • ‘t’
    timestamp expressed in seconds, NAN if the input timestamp is unknown
  • ‘n’
    sequential number of the input frame, starting from 0
  • ‘pos’
    the position in the file of the input frame, NAN if unknown
  • ‘w’
  • ‘h’
    width and height of the input frame if video

和其他filter的option一样,enableoption遵循一些原则。如下:
eg1:使用drawtext filter 在第3秒到第5秒之间加入文字:

drawtext=enable='between(t,3,5)'

eg2:使用curves filter从第三秒开始:

curves  = enable='gte(t,3)' : preset=cross_process

想要知道哪些filter支持enableoption,可以使用:ffmpeg -filters命令,凡是filter有 T的都支持timeline editing

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值