summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2011-09-21 02:36:36 +0200
committerJonas Smedegaard <dr@jones.dk>2011-09-21 02:36:36 +0200
commit2a0e1f4b92cb25da8c2fb78e38f581d3991449ab (patch)
tree436ba24965895b92143ec0e497e63b3a812ab5e3
parent64b73b8e379fed144731a1cbce561e69e8bb1da2 (diff)
Fix add profile option. Rename internal variables to better distinguish general melt options from melt consumer arguments.
-rwxr-xr-xlocalvideowebencode13
1 files changed, 7 insertions, 6 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 1d1564c..1ed0703 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -106,25 +106,26 @@ title=${title:-$filebase}
# TODO: Check and fail if all needed tools are not available
# TODO: When verified beneficial, add option real_time=-2
-opts_common="${bitrate:+b=${bitrate}} ${size:+s=$size} ${aspect:+aspect=$aspect}"
-opts_audio="ac=2 ar=44100 ab=96k"
+opts="${profile:+-profile $profile}"
+args=" ${bitrate:+b=${bitrate}} ${size:+s=$size} ${aspect:+aspect=$aspect}"
+args_audio="ac=2 ar=44100 ab=96k"
# bail out (before any expensive tasks) if logfiles exists
[ ! -f x264-*.log* ] || exit1 "logfiles already exist. Remove them (or wait for that other process using them to complete) and try again."
## Theora/Vorbis/Ogg
-melt -consumer avformat:"$filebase.ogg" f=ogg vcodec=libtheora $opts_common acodec=libvorbis aq=25 $opts_audio "$@"
+melt $opts -consumer avformat:"$filebase.ogg" f=ogg vcodec=libtheora $args acodec=libvorbis aq=25 $args_audio "$@"
## H.264/AAC/MP4
-melt -consumer avformat:/dev/null f=mp4 properties=x264-medium-$h264profile $opts_common pass=1 an=1 fastfirstpass=1 "$@"
-melt -consumer avformat:"$filebase.mp4" properties=x264-medium-$h264profile $opts_common pass=2 acodec=libvo_aacenc $opts_audio "$@"
+melt $opts -consumer avformat:/dev/null f=mp4 properties=x264-medium-$h264profile $args pass=1 an=1 fastfirstpass=1 "$@"
+melt $opts -consumer avformat:"$filebase.mp4" properties=x264-medium-$h264profile $args pass=2 acodec=libvo_aacenc $args_audio "$@"
mv "$filebase.mp4" "$filebase.mp4"~
qt-faststart "$filebase.mp4"~ "$filebase.mp4"
[ -f "$filebase.mp4" ] && rm "$filebase.mp4"~ || exit1 "failed to optimize with qt-faststart."
## VP8/Vorbis/WebM
# TODO: use two-pass when supported by melt
-melt -consumer avformat:"$filebase.webm" properties=webm $opts_common $opts_audio "$@"
+melt $opts -consumer avformat:"$filebase.webm" properties=webm $args $args_audio "$@"
## JPEG preview
ffmpegthumbnailer -s0 -i "$filebase.mp4" -o "$filebase.jpg"