ffmpegmlt

pass ffmpeg options through mlt xml


I'm looking at an MLT XML file that I created with kdenlive and would like to tweak the command line options passed to ffmpeg.

If I understand correclty, this is the part that I need to edit:

 <consumer f="mp4" g="15" channels="2" crf="15" progressive="1" target="thetargetfile.mp3" threads="0" real_time="-3" format_options="-stillimage" mlt_service="avformat" vcodec="libx264" ab="256k" movflags="+faststart" bf="2" preset="faster" acodec="aac" in="0" out="18263"/>

Now, I would like to pass an additional flag to ffmpeg, in my case -stillimage for still image optimization of the output (my file is a recorded slideshow presentation, so there's really no excuse for it being hundreds of MB large).

Is there an option in that allows to just pass arbitrary flags to ffmpeg, or how else would I go about performing such an optimization?


Solution

  • This looks to be an XY problem.

    The proximate issue is, how to pass on stillimage. The underlying issue is, how to reduce file size of a slideshow.

    For stillimage, it is a type of tuning of the encoder, so the format would be tune="stillimage". See https://www.mltframework.org/plugins/ConsumerAvformat/#tune-3

    However, that tuning will produce a modest benefit, or possibly no benefit at all.

    The two key parameters creating a larger file are

    g="15" ... crf="15"
    

    Such a low CRF value is wasteful unless the resolution is fairly low (< 360p). Keep it at around 23. With such a low g value, a lot of keyframes are generated which will bloat file size. For a slideshow, a default of 250 is usually fine.