Skip to content

Instantly share code, notes, and snippets.

@techtonik
Last active May 6, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techtonik/539cc47e4466c2b57aaeb85d069e1294 to your computer and use it in GitHub Desktop.
Save techtonik/539cc47e4466c2b57aaeb85d069e1294 to your computer and use it in GitHub Desktop.
glretrace.exe -s - input.trace | ffmpeg -r 75 -f image2pipe -vcodec ppm -i pipe: -r 25 -qscale 3.1 -y output.ogg
# get palette
ffmpeg -y -i output.ogg -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png
# write gif
ffmpeg -i output.ogg -i palette.png -filter_complex "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
# links:
# - https://en.wikibooks.org/wiki/OpenGL_Programming/Video_Capture
# - https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality/556031#556031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment