Last active
August 13, 2024 01:51
-
-
Save JoelLisenby/a3bb5b60c400283c286550e6c3bdd407 to your computer and use it in GitHub Desktop.
ffmpeg video encoding for web (chrome, firefox, safari, etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# h265 | |
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p output.mp4 | |
# h265 with colorspace specified | |
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4 | |
# h265 with colorspace specified and no audio | |
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -an output.mp4 | |
# webm | |
ffmpeg -i input.mp4 -c:v libvpx-vp9 -vf scale=1280:720 -pix_fmt yuv420p -minrate 5M -b:v 1M output.webm | |
# webm with colorspace specified | |
ffmpeg -i input.mp4 -c:v libvpx-vp9 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -minrate 5M -b:v 1M output.webm | |
# webm with colorspace specified and bitrate limited to 2000k / crf 30 and no audio | |
ffmpeg -i input.mp4 -c:v libvpx-vp9 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -crf 30 -b:v 2000k -an output.webm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment