How do I reduce frames with blending in ffmpeg

后端 未结 2 871
别那么骄傲
别那么骄傲 2020-12-31 09:40

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

  • reducing frames from 60 to 30
  • blending every 2 frames
相关标签:
2条回答
  • 2020-12-31 10:18

    Simple frame dropping:

    ffmpeg -i input.mov -r 30 output.mov
    

    Interpolate frames with the minterpolate filter:

    ffmpeg -i input.mov -vf minterpolate=fps=30 output.mov
    
    • See link above as there are many additional options.

    Interpolate frames with the framerate filter:

    ffmpeg -i input.mov -vf framerate=fps=30 output.mov
    
    • See link above as there are many additional options.
    0 讨论(0)
  • 2020-12-31 10:29

    Try

    ffmpeg -h
    

    or

    ffmpeg --help
    

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

    Try

    ffmpeg -filters
    

    and you'll have a list of available filters

    Try

    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"
    

    Note : Things in brackets [] are optionnal.

    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.

    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"
    

    ⁽¹⁾ 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 ?


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

    minterpolate : Frame rate conversion using Motion Interpolation.

    So, type :

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

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

    ffmpeg -help filter=minterpolate
    

    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"
    

    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.


    Things have been done with

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

    0 讨论(0)
提交回复
热议问题