#!/bin/bash BITRATE=$2 FILE=$1 ffmpeg -i $1 -codec:v libx264 -profile:v high -preset slower -b:v ${BITRATE:=2000}k -vf scale=-1:720 -threads 0 -codec:a aac -strict experimental "${FILE%%.*}"-web.mp4 ffmpeg -i $1 -c:v libvpx -quality good -cpu-used 0 -b:v ${BITRATE:=2000}k -qmin 10 -qmax 42 -maxrate 500k -bufsize 1500k -threads 8 -vf scale=-1:720 -c:a libvorbis -b:a 192k -f webm "${FILE%%.*}"-web.webm