【问题标题】:ffmpeg drawbox on a given frame给定帧上的ffmpeg drawbox
【发布时间】:2013-06-24 18:13:17
【问题描述】:

我有数千个矩形框要添加到视频中。现在我正在使用这个命令:

ffmpeg.exe -i small.ts -vf drawbox=10:10:50:50:red,drawbox=100:100:200:200:green small_with_box.ts

但是,我不想在整个框架上添加框,而是在给定的框架上添加框。有谁知道我该怎么做?

【问题讨论】:

    标签: filter ffmpeg frame


    【解决方案1】:

    drawbox 视频过滤器支持timeline editing。您可以查看哪些过滤器支持时间线编辑:

    $ ffmpeg -filters
    …
    Filters:
      T. = Timeline support
      .S = Slice threading
      A = Audio input/output
      V = Video input/output
      N = Dynamic number and/or type of input/output
      | = Source or sink filter
    …
     .. deshake          V->V       Stabilize shaky video.
     T. drawbox          V->V       Draw a colored box on the input video.
     T. drawgrid         V->V       Draw a colored grid on the input video.
    

    您可以看到drawboxdrawgrid 支持时间线,但deshake 目前不支持。

    使用示例。这将放置第 28-32 帧中的红色框,以及从 60 秒开始的绿色框。另请参阅有关其他函数的表达式评估的文档。

    ffmpeg -i small.ts -vf "drawbox=enable='between(n,28,32)' : x=10 : y=10 : w=50 \
    : h=50 : color=red,drawbox=enable='gte(t,60)' : x=100 : y=100 : w=200 : \
    h=200 : color=green" -codec:a copy small_with_box.ts
    

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 2015-04-27
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-31
      • 2017-05-01
      • 2015-05-19
      相关资源
      最近更新 更多