Created
May 27, 2021 19:25
-
-
Save positlabs/8671e7b9eefdf480b53390d5128e7d05 to your computer and use it in GitHub Desktop.
webm conversion for spark preview videos
This file contains hidden or 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
#!/bin/bash | |
# https://trac.ffmpeg.org/wiki/Encode/VP9 | |
# Converts video file to webm using two-pass encoding | |
# Installation on Mac: add script to /usr/local/bin | |
# Usage: | |
# webm ./path/to/video.mp4 | |
# Outputs ./path/to/video.mp4.webm | |
# Max size is 720 pixels wide. Change -vf scale to adjust | |
# Set -crf to lower number for higher quality, longer encode time, and larger files. https://developers.google.com/media/vp9/settings/vod#quality | |
# -an strips audio, -c:a libopus copies audio | |
ffmpeg -i $1 -vf scale=720:-1 -c:v libvpx-vp9 -b:v 0 -crf 32 -pass 1 -an -f null /dev/null | |
ffmpeg -i $1 -vf scale=720:-1 -c:v libvpx-vp9 -b:v 0 -crf 32 -pass 2 -an $1.webm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment