HN2new | past | comments | ask | show | jobs | submitlogin

ffmpeg is fantastic. I'm an iOS dev and when I put something on Github, I first record the iOS simulator with QuickTime. Then I convert the resulting .mov file with ffmpeg:

    ffmpeg -i example.mov -r 15 example.gif
Voilà, an animated gif. Quality is atrocious but it gets the message across, plus the filesize is not too big.


If you're prepared to run ffmpeg twice (allowing it to analyze the GIF), the quality will be significantly better: https://cassidy.codes/blog/2017/04/25/ffmpeg-frames-to-gif-o...


No need to run it twice.

Basic syntax is

    ffmpeg -i video -filter_complex "[0]split[vid][pal];[pal]palettegen[pal];[vid][pal]paletteuse" out.gif
ffmpeg 4.0 and later will automatically insert fifo buffers for the main video while one copy is analyzed to generate the palette.


Great tip, thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: