Initial commit

master
ehashman 8 years ago
commit 9cb6612efc
  1. 66
      encode.sh
  2. 15
      make-avi.sh
  3. 14
      make-flv.sh
  4. 26
      make-mp4.sh
  5. 15
      make-mpg.sh
  6. 15
      make-ogg.sh
  7. 12
      make-template.sh
  8. 22
      make-thumbs.sh

@ -0,0 +1,66 @@
#!/bin/bash
#####
# TODO: b4taylor
# * Progress printing
export ffmpeg=/users/pbarfuss/ffmpeg
export ffmpegopts="$3"
if [ $# != "3" ] ; then
echo "Usage: encode input-video.format output_prefix opts";
exit 1;
fi
mkdir "encodes" 2> /dev/null
if [ ! -d "encodes" ] ; then
echo "Could not create directory: encodes"
exit 1
fi
mkdir "timings" 2> /dev/null
if [ ! -d "timings" ] ; then
echo "Could not create directory: timing"
exit 1
fi
TIC=`date +%s`
# Job1: avi (xvid, mp3)
# ./make-avi.sh $1 $2 &
# broken
# Job2: mp4 (h264, aac)
./make-mp4.sh $1 $2 &
# Job3: mpg (mpeg2, mp2)
# ./make-mpg.sh $1 $2 &
# worthless
# Job4: ogg (theora, vorbis)
# ./make-ogg.sh $1 $2 &
# broken
# Job5: flv
./make-flv.sh $1 $2 &
wait
./make-thumbs.sh $1 $2
TOC=`date +%s`
LOG="$2.log"
for i in timings/$2*.log ; do
echo $i >> $LOG
cat $i >> $LOG
rm $i
done
{
echo "$1"
echo "Total: `expr $TOC - $TIC`"
} >> $LOG
mv $LOG "timings"

@ -0,0 +1,15 @@
V_BIT_RATE=768k
A_BIT_RATE=128k
LOG="timings/$2-avi.log"
TIC=`date +%s`
$ffmpeg -i $1 $ffmpegopts -v -1 -y \
-vcodec libxvid -b "$V_BIT_RATE" \
-acodec libmp3lame -ac 1 -ab "$A_BIT_RATE" \
"encodes/$2.avi"
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG

@ -0,0 +1,14 @@
V_BIT_RATE=768k
A_BIT_RATE=128k
LOG="timings/$2-flv.log"
TIC=`date +%s`
$ffmpeg -i "$1" $ffmpegopts -v -1 -y \
-f flv -b "$V_BIT_RATE" \
-ac 1 -ab "$A_BIT_RATE" \
"encodes/$2.flv"
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG

@ -0,0 +1,26 @@
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" \
-vpre slow_firstpass \
"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" \
-vpre slow \
-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

@ -0,0 +1,15 @@
V_BIT_RATE=768k
A_BIT_RATE=128k
LOG="timings/$2-mpg.log"
TIC=`date +%s`
$ffmpeg -i "$1" $ffmpegopts -v -1 -y \
-vcodec mpeg2video -b "$V_BIT_RATE" \
-acodec mp2 -ac 1 -ab "$A_BIT_RATE" \
"encodes/$2.mpg"
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG

@ -0,0 +1,15 @@
V_BIT_RATE=768k
A_BIT_RATE=128k
LOG="timings/$2-mkv.log"
TIC=`date +%s`
$ffmpeg -i "$1" $ffmpegopts -y -v -1 \
-f ogg \
-b "$V_BIT_RATE" \
-ac 1 -ab "$A_BIT_RATE" -aq 60 \
"encodes/$2.ogg"
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG

@ -0,0 +1,12 @@
V_BIT_RATE=768kb
A_BIT_RATE=128kb
#TODO: Change logname
LOG=`mktemp`
TIC=`date +%s`
#TODO: Encoding job here
TOC=`date +%s`
echo "`expr $TOC - $TIC`" >> $LOG

@ -0,0 +1,22 @@
V_BIT_RATE=768kb
A_BIT_RATE=128kb
#No logging for this script
#LOG=`mktemp`
#TIC=`date +%s`
$ffmpeg -itsoffset -20 -i $1 -y -v -1 \
-f rawvideo \
-vcodec mjpeg -vframes 1 -s 90x60 \
-an \
"encodes/$2-thumb-small.jpg" 2> /dev/null
$ffmpeg -itsoffset -20 -i $1 -y -v -1 \
-f rawvideo \
-vcodec mjpeg -vframes 1 -s 720x480 \
-an \
"encodes/$2-thumb-large.jpg" 2> /dev/null
#TOC=`date +%s`
#echo "`expr $TOC - $TIC`" >> $LOG
Loading…
Cancel
Save