summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-09-02 20:33:16 +0200
committerJonas Smedegaard <dr@jones.dk>2010-09-02 20:33:16 +0200
commit508b84b75b3acb758c093504bc18cf584c07118c (patch)
tree7ee329f5261f8b1d4917c8364bb5e7982650e074
parentabb56bd09d842370cdfe605d2cd61ddb25a64ffa (diff)
Use filebase as fallback title. Adjust bottom text. Add a few comments.
-rwxr-xr-xlocalvideowebencode17
1 files changed, 12 insertions, 5 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 86fd78e..070f150 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -4,6 +4,9 @@
# http://diveintohtml5.org/video.html
# http://camendesign.com/code/video_for_everybody
+# Possible flashplayers:
+# http://www.internetmarketingnotes.com/2010/07/free-embeddable-flash-video-flv-players-for-commercial-use/
+
set -e
# input filename (mandatory)
@@ -16,6 +19,10 @@ width=$(echo "$size" | perl -pe 's/[^x]*x//')
height=$(echo "$size" | perl -pe 's/x[^x]*//')
heightplus=${height:+$(($height+4))}
+# fallback graphics title
+# TODO: implement --title option (set it in environment for now)
+title=${title:-$filebase}
+
# TODO: Check and fail if all needed tools are not available
## Theora/Vorbis/Ogg
@@ -34,7 +41,7 @@ rm "$infile"-*.log
## JPEG preview
ffmpegthumbnailer -s0 -i "$filebase.ogv" -o "$filebase.jpg"
-## TODO: resolve flash player to use
+# TODO: resolve flash player to use
[ -z "$flashplayer" ] || flash=yes
cat >"$filebase.html" <<EOF
@@ -46,13 +53,13 @@ ${webm:+<source src="$filebase.webm" type='video/webm; codecs="vp8, vorbis"' />
}${flash:+<object width="$width" height="$heightplus" type="application/x-shockwave-flash" data="$flashplayer.swf">
<param name="movie" value="$flashplayer.swf" />
<param name="flashvars" value="image=$filebase.jpg&amp;file=$filebase.mp4" />
-}<img src="$filebase.jpg" width="$width" height="$height" ${title:+alt="$title"}
+}<img src="$filebase.jpg" width="$width" height="$height" alt="$title"
title="No video playback capabilities, please download the video below" />
${flash:+</object>
}</video>
<p><strong>Download Video:</strong>
-open classic Format:<a href="$filebase.ogv">"Ogg"</a>,
-${webm:+open modern Format:<a href="$filebase.webm">"WebM"</a>,}
-closed Format:<a href="$filebase.mp4">"MP4"</a>.
+open format <a href="$filebase.ogv">Ogg</a>,
+${webm:+open format <a href="$filebase.webm">WebM</a>,}
+closed Format <a href="$filebase.mp4">MP4</a>.
</p>
EOF