Skip to content

ffmpeg: How to speed up video AND audio.

You need ffmpeg version 2.x – download from here if you don’t have it: or compile the latest version from source:

Here’s a script I use to resize my GoPro videos and speed them up by 4 times:

The max value for ‘atempo’ is 2, so you have to string two of them together in order to get 4 times speed increase.

for i in $SOURCE*.MP4; do
 echo "Processing $i";
 $FFMPEG -i $i -vcodec mpeg4 -vtag XVID -b:v $BITRATE -bf 2 -s $SIZE -pass 1 -passlogfile $i -an -threads 0 -f rawvideo -y /dev/null;
 #$FFMPEG -i $i -vcodec mpeg4 -vtag XVID -b:v $BITRATE -bf 2 -s $SIZE -vf setpts=0.15*PTS -pass 2 -passlogfile $i -an -threads 0 -f avi -y $DEST$i.avi;
 $FFMPEG -i $i -vcodec mpeg4 -vtag XVID -b:v $BITRATE -bf 2 -s $SIZE  -filter_complex "[0:v]setpts=0.125*PTS[v];[0:a]atempo=2.0,atempo=2.0,atempo=2.0[a]" -map "[v]" -map "[a]" -pass 2 -passlogfile $i -an -threads 0 -f avi -y $DEST$i.avi;
Published inLinux

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *