Skip to content

Instantly share code, notes, and snippets.

@brunurd
Created January 31, 2025 14:15
Show Gist options
  • Save brunurd/0b7928e6608c522128d6b9845b9c0514 to your computer and use it in GitHub Desktop.
Save brunurd/0b7928e6608c522128d6b9845b9c0514 to your computer and use it in GitHub Desktop.
Video conversions and optmizations with FFMPEG
# 1080p/24fps mp4
ffmpeg -i ${INPUT} -vf "scale=1920:-1" -r 24 -c:v libx264 -crf 23 -preset fast -an ${OUTPUT}
# 720p/24fps mp4
ffmpeg -i ${INPUT} -vf "scale=720:-1" -r 24 -c:v libx264 -crf 23 -preset fast -an ${OUTPUT}
# 1080p/24fps webm
ffmpeg -i ${INPUT} -vf "scale=1080:-1" -r 24 -c:v libvpx-vp9 -b:v 0 -crf 30 -an ${OUTPUT}
# 720p/24fps webm
ffmpeg -i ${INPUT} -vf "scale=720:-1" -r 24 -c:v libvpx-vp9 -b:v 0 -crf 30 -an ${OUTPUT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment