Skip to content

Instantly share code, notes, and snippets.

@kbcarte
Last active July 26, 2022 14:32
Show Gist options
  • Save kbcarte/a50aa7b50178280c463728e87c0cbb24 to your computer and use it in GitHub Desktop.
Save kbcarte/a50aa7b50178280c463728e87c0cbb24 to your computer and use it in GitHub Desktop.
Use ffmpeg to convert mp4 videos to webm with better keyframe spacing for smooth scroll animations.
# OG Yoink: https://stackoverflow.com/a/33855249
# -g 8, was chosen based on this: https://docs.microsoft.com/en-us/windows/win32/wmformat/configuring-video-streams-for-seeking-performance?redirectedfrom=MSDN
ffmpeg -i input_video.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis -g 8 output_video.webm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment