summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-09-02 18:05:50 +0200
committerJonas Smedegaard <dr@jones.dk>2010-09-02 18:05:50 +0200
commitabb56bd09d842370cdfe605d2cd61ddb25a64ffa (patch)
treea74994e04ecc7469369cc189f4d278a2ef39ff45 /localvideowebencode
parent8440867cc4fcbe371f9868cf76c9be213a334a4c (diff)
Cleanup logfile after WebM. Add a few comments.
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode4
1 files changed, 4 insertions, 0 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 5b4d429..86fd78e 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -16,6 +16,8 @@ width=$(echo "$size" | perl -pe 's/[^x]*x//')
height=$(echo "$size" | perl -pe 's/x[^x]*//')
heightplus=${height:+$(($height+4))}
+# TODO: Check and fail if all needed tools are not available
+
## Theora/Vorbis/Ogg
ffmpeg2theora --videobitrate 200 --max_size "$size" --output "$filebase.ogv" "$infile"
@@ -24,8 +26,10 @@ HandBrakeCLI --preset "iPhone & iPod Touch" --vb 200 ${width:+--maxWidth "$width
## VP8/Vorbis/WebM
! ffmpeg -codecs | grep -iw vp8 || webm=yes
+# FIXME: check and fail if logfiles exist already
[ -z "$webm" ] || ffmpeg -pass 1 -passlogfile "$infile" -threads 16 -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -i "$infile" -vcodec libvpx -b 204800 -s "$size" -aspect 4:3 -an -f webm -y NUL
[ -z "$webm" ] || ffmpeg -pass 2 -passlogfile "$infile" -threads 16 -keyint_min 0 -g 250 -skip_threshold 0 -qmin 1 -qmax 51 -i "$infile" -vcodec libvpx -b 204800 -s "$size" -aspect 4:3 -acodec libvorbis -ac 2 -y "$filebase.webm"
+rm "$infile"-*.log
## JPEG preview
ffmpegthumbnailer -s0 -i "$filebase.ogv" -o "$filebase.jpg"