Skip to content

Instantly share code, notes, and snippets.

@freder
Created November 16, 2017 13:25
Show Gist options
  • Save freder/64bd161265b8bfd3dd9ad811cccf477f to your computer and use it in GitHub Desktop.
Save freder/64bd161265b8bfd3dd9ad811cccf477f to your computer and use it in GitHub Desktop.
ffmpeg web video
#!/bin/sh
IN_FILE=ani_output_rotation_y2.mov
BITRATE=2500K
# TODO: https://github.com/chuyskywalker/easy-web-video-encode/blob/master/encode.sh
OUT_FILE=$(basename $IN_FILE .mov).webm
ffmpeg -y -i $IN_FILE -vf scale=600:-1 -an -c:v libvpx -quality good -qmin 10 -qmax 40 -b:v $BITRATE -auto-alt-ref 0 $OUT_FILE
OUT_FILE=$(basename $IN_FILE .mov).mp4
ffmpeg -y -i $IN_FILE -vf scale=600:-1 -an -c:v libx264 -preset slow -b:v $BITRATE $OUT_FILE
# OUT_FILE=$(basename $IN_FILE .mov).ogv
# ffmpeg -y -i $IN_FILE -vf scale=600:-1 -an -c:v libtheora -b:v $BITRATE $OUT_FILE
# -q:v 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment