summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"