#!/bin/sh -e if=$1 of=$2 # No. CPU cores: threads=8 # Video bitrate: vb=400k # Audio bitrate: ab=128k ffmpeg -i "$if" \ -threads $threads \ -f webm \ -an \ -vcodec libvpx \ -b:v $vb \ -pass 1 \ -passlogfile "$of.ffmpeg2pass" \ -y /dev/null ffmpeg -i "$if" \ -threads $threads \ -f webm \ -acodec libvorbis \ -ab $ab \ -vcodec libvpx \ -b:v $vb \ -pass 2 \ -passlogfile "$of.ffmpeg2pass" \ -y "$of"