Last active
May 16, 2019 05:00
-
-
Save nanmu42/a1e41028e876c4c911d0439cb0b07dfb to your computer and use it in GitHub Desktop.
ffmpeg compressing video for web browser
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
#!/usr/bin/env bash | |
# preset veryslow: more time for more compressing rate | |
# -movflags +faststart optimizes for web browser so video can be played sooner. | |
# crf: small = better quality + bigger size; sane option between 17–28 | |
SRC="$1" | |
CRF="$2" | |
ffmpeg -i "$SRC" -vcodec libx264 -crf "$CRF" -movflags +faststart -preset veryslow -profile:v high -level 4.1 web_libx264_crf_${CRF}_faststart_veryslow.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
Ref: