Assorted FFMPEG scripts for compressing and cutting videos.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
csc-media/make-mp4.sh

27 lines
722 B

V_BIT_RATE=768k
A_BIT_RATE=128k
LOG="timings/$2-mp4.log"
TIC=`date +%s`
$ffmpeg -i $1 -v -1 -y $ffmpegopts -strict experimental \
-pass 1 -threads 0 -y \
-vcodec libx264 -f mp4 -b "$V_BIT_RATE" -bt "$V_BIT_RATE" \
-fpre ./libx264-slow_firstpass.ffpreset \
-an \
"encodes/$2-first.mp4"
$ffmpeg -i $1 -v -1 -y $ffmpegopts -strict experimental \
-pass 2 -threads 0 \
-vcodec libx264 -f mp4 -b "$V_BIT_RATE" -bt "$V_BIT_RATE" \
-fpre libx264-slow.ffpreset \
-acodec aac -ac 1 -ab "$A_BIT_RATE" \
"encodes/$2.mp4"
mv "ffmpeg2pass-0.log" "$2-ffmpeg2pass-0.log"
mv "x264_2pass.log" "$2-x264_2pass.log"
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG