Hello,

ffmpeg -i "in.mp4" -vf scale=680:-2 "out.gif" 

Tell me how to keep the original WxH when gif is less than 680px?

Ie to achieve the same effect:

 gifsicle -O3 --resize-fit-width 680 -i in.gif > out.gif convert in.gif -resize "680x>" out.gif 

If not how, then how to get a grain effect with a gifsicle like in ffmpeg. Such a gif weighs significantly less.

enter image description here enter image description here

    1 answer 1

    Can. Read about expressions in filters: http://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation and about the scale filter itself

    In your case, there will be something like:

     ffmpeg -i "in.mp4" -vf scale='min(680\,iw):-2' "out.gif" 
    • one
      [libx264 @ 0xa6e1200] width not divisible by 2 (499x500) "scale='min(680\,trunc(iw/2)*2)':-2" - iormark