如何在ffmpeg中进行融合来减少帧数 [英] How do I reduce frames with blending in ffmpeg

查看:821
本文介绍了如何在ffmpeg中进行融合来减少帧数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将某些文件转换为ProRes. 转换中相当重要的一部分是:

I am trying to convert some files into ProRes. One fairly important part of the conversion is:

  • 将帧数从60减少到30
  • 每2帧融合到一个帧中,并实现更加流畅的移动. (一种简单的运动模糊)

我已经尝试过-blend命令,但是无法将其识别为命令.

I have tried the -blend command, however it was not recognized as a command.

-i source.mp4 -r 30 -vcodec prores_ks -profile:v 0 Output.mov

如何在ffmpeg中进行融合来减少帧数?

How do I reduce frames with blending in ffmpeg?

推荐答案

尝试

ffmpeg -h

ffmpeg --help

,您将获得短暂帮助.请阅读. :)

and you'll have a short help. Please read it. :)

尝试

ffmpeg -filters

,您将获得可用过滤器列表

and you'll have a list of available filters

尝试

ffmpeg -help filter=name

,您将获得此过滤器的语法和参数

and you'll have syntax and parameters for this filter

我已经需要做这样的事情,以降低帧速率. 如果你这样做

I already needed to do something like this, reducing framerate. If you do

ffmpeg -i "input" -r outputframerate [video encoding options...] [-y] "output"

注意:方括号[]中的内容是可选的.

您将进行简单的帧率更改,并可能丢失输入帧. 而且,尤其是您不想得到的东西.

You'll have a simple framerate change, with a possible loss of input frames. And, it's especially what you don't want to get.

要更改帧速率而又不丢失输入帧,则必须使用视频过滤器.

To have a framerate change without a loss of input frames, you'll have to use a video filter.

tblend 过滤器混合连续的帧.如果源帧速率是目标帧速率的整数倍(例如:60→30、75→15、75→25等),则使用此过滤器

The tblend filter blends successive frames. It is the filter to use if source framerate is an integer multiply of destination framerate (eg : 60→30, 75→15, 75→25, ...)

ffmpeg -i "input" -vf tblend=all_mode=average [video encoding options...] -r outputframerate⁽¹⁾ [-y] "output"

⁽¹⁾如果我自己还没有测试过此滤波器,那么我确定必须将输出帧速率设置为某处. tblend过滤器没有fps参数.也许它只是融合了两个连续的帧?您应该检查这一点,然后尝试一下?

⁽¹⁾ If haven't tested this filter myself, and I'm sure the output framerate must be set somewhere. The tblend filter has no fps parameter. Maybe it just blends 2 successive frames ? You should check this point, and make some tries ?

还有另一个帧速率更改器,更适合用于任何I/O帧速率:

There exists another framerate changer, more adapted to be used with any i/o framerates :

插值:使用运动插值的帧率转换.

因此,键入:

ffmpeg -i "input" -vf minterpolate=fps=outputframerate [video encoding options...] [-y] "output"

其他minterpolate参数具有足够的默认值,以确保良好的混合.用

The other minterpolate parameters have good enough defaut values, to make sure a good blend. Check them with a

ffmpeg -help filter=minterpolate

如果要在minterpolate链中添加一些参数,则必须使用':'作为参数分隔符. 假设您要使用运动插值模式 = blend,而不是默认的运动补偿插值(mci),请输入:

If you want to add some parameters in the minterpolate chain, you'll have to use a ':' as parameter separator. Let's say you want to use motion interpolation mode = blend, instead of the default motion compensated interpolation (mci), type :

ffmpeg -i "input" -vf minterpolate=fps=outputframerate:mi_mode=blend [video encoding options...] [-y] "output"

如果要使用许多视频过滤器,则不得链接-vf选项.最后一个将覆盖之前的那些.您必须(对于过滤器参数为':')使用','作为过滤器分隔符.例如:

If you want to use many videos filters, you must not chain -vf options. The last one will override the ones before. You must (as ':' for filter parameters) use ',' as filters separator. Ex :

ffmpeg -i "input" -vf minterpolate=fps=outputframerate:mi_mode=blend,filter2=param1=value1:param2=value2[...] [video encoding options...] [-y] "output"

给定过滤器的顺序很重要.

The order of given filters are important.

事情已经完成

ffmpeg版本3.2.14-1〜deb9u1版权所有(c)2000-2019 FFmpeg开发人员

ffmpeg version 3.2.14-1~deb9u1 Copyright (c) 2000-2019 the FFmpeg developers

这篇关于如何在ffmpeg中进行融合来减少帧数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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