From aa95dd51dc1ca1f3bbada79053c886e092ca8488 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 2 Sep 2010 14:06:01 +0200 Subject: Add new script localvideowebencode. --- localvideowebencode | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 localvideowebencode (limited to 'localvideowebencode') diff --git a/localvideowebencode b/localvideowebencode new file mode 100755 index 0000000..65b8384 --- /dev/null +++ b/localvideowebencode @@ -0,0 +1,41 @@ +#!/bin/sh + +# Origin: http://diveintohtml5.org/video.html +# See also: http://camendesign.com/code/video_for_everybody + +set -e + +# input filename (mandatory) +infile="$1"; shift +filebase=$(echo "$infile" | perl -pe 's/\.[^.]*//') + +# output size in WIDTHxHEIGHT (optional, default: 320x200) +size=${1:-320x200} +width=$(echo "$size" | perl -pe 's/[^x]*x//') +height=$(echo "$size" | perl -pe 's/x[^x]*//') + +## Theora/Vorbis/Ogg +ffmpeg2theora --videobitrate 200 --max_size "$size" --output "$filebase.ogv" "$infile" + +## H.264/AAC/MP4 +#HandBrakeCLI --preset "iPhone & iPod Touch" --vb 200 ${width:+--width "$width"} --two-pass --turbo --optimize --input "$infile" --output "$filebase.mp4" +HandBrakeCLI --preset "iPhone & iPod Touch" --vb 200 ${width:+--maxWidth "$width"} ${height:+--maxHeight "$height"} --two-pass --turbo --optimize --input "$infile" --output "$filebase.mp4" + +## VP8/Vorbis/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 +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" + +cat >"$filebase.html" < + + + + + + + +

Download video as MP4, WebM, or Ogg.

+
+ +EOF -- cgit v1.2.3