#!/bin/sh -e if=$1 of=$2 # No. CPU cores: threads=8 # Video bitrate: vb=400k # Audio bitrate: ab=128k ffmpeg -i "$if" \ -f mp4 \ -acodec libfaac \ -ab $ab \ -threads $threads \ -vcodec libx264 \ -vpre libx264-ipod640 \ -b:v $vb \ -passlogfile "$of.ffmpeg2pass" \ -y "$of"