diff options
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-x | localvideowebencode | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/localvideowebencode b/localvideowebencode index 8949f76..4254093 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -458,7 +458,7 @@ for format in $(echo "$formats" | sed -e 's/,/ /g'); do theora|ogg) ogg=yes;; avc|h264|mp4) mp4=yes;; vp8|webm) webm=yes;; - vp9) vp9=yes;; + vp9) webm_vp9=yes;; *) exit1 "Unknown format \"$format\".";; esac done @@ -687,7 +687,7 @@ _ffmpeg_webm_keepvideo="-f webm $_ffmpeg_video -c:v copy ${silence:+-an}${channe _ffmpeg_webm_keepvideo_opus="-f webm $_ffmpeg_video -c:v copy ${silence:+-an}${channels:+$_ffmpeg_opus}" _melt_webm_vp9="f=webm $_melt_video $_melt_vp9 ${silence:+an=1 audio_off=1}${channels:+$_melt_opus}" _ffmpeg_webm_vp9="-f webm $_ffmpeg_video $_ffmpeg_vp9 ${silence:+-an}${channels:+$_ffmpeg_opus}" -_ffmpeg_webm_onlyvideo_vp9="-f webm $_ffmpeg_video $_ffmpeg_vp9 -an" +_ffmpeg_webm_vp9_onlyvideo="-f webm $_ffmpeg_video $_ffmpeg_vp9 -an" _melt_mp4="f=mp4 $_melt_video $_melt_avc ${silence:+an=1 audio_off=1}${channels:+${use_mp3:+$_melt_mp3}${use_aac:+$_melt_aac}}" _ffmpeg_mp4="-f mp4 $_ffmpeg_video $_ffmpeg_avc ${silence:+-an}${channels:+${use_mp3:+$_ffmpeg_mp3}${use_aac:+$_ffmpeg_aac}}" _ffmpeg_mp4_onlyvideo="-f mp4 $_ffmpeg_video $_ffmpeg_avc -an" @@ -707,30 +707,30 @@ if [ -n "$loudness" ] && [ -z "$silence$_melt_loudness" ]; then echo >&2 "Loudness data: $_melt_loudness" fi -if [ -n "${webm:+$multipass_vp8}${vp9:+$multipass_vp9}${mp4:+$multipass_avc}" ]; then - if [ -n "${webm:+$use_vpxenc}${vp9:+$use_vpxenc}" ]; then +if [ -n "${webm:+$multipass_vp8}${webm_vp9:+$multipass_vp9}${mp4:+$multipass_avc}" ]; then + if [ -n "${webm:+$use_vpxenc}${webm_vp9:+$use_vpxenc}" ]; then echo >&2 "Analyzing video complexity, as discrete processes..." $melt $_melt_infiles $filters $_melt_stdout \ | pee \ ${webm:+"$vpxenc_chained - $_vpxenc_vp8 \ -p 2 --pass=1 --fpf=${stem}_vp8.log -o /dev/null"} \ - ${vp9:+"$vpxenc_chained - $_vpxenc_vp9 \ + ${webm_vp9:+"$vpxenc_chained - $_vpxenc_vp9 \ -p 2 --pass=1 --fpf=${stem}_vp9.log -o /dev/null"} \ ${mp4:+${use_ffmpeg_avc:+$_ffmpeg_rawvideo $_ffmpeg_avc -an \ -pass 1 -passlogfile ${stem}_avc /dev/null}} - elif [ -n "${webm:+$use_ffmpeg_vp8}${vp9:+$use_ffmpeg_vp9}${mp4:+$use_ffmpeg_avc}" ]; then + elif [ -n "${webm:+$use_ffmpeg_vp8}${webm_vp9:+$use_ffmpeg_vp9}${mp4:+$use_ffmpeg_avc}" ]; then echo >&2 "Analyzing video complexity, integrated with ffmpeg" $melt $_melt_infiles $filters $_melt_stdout \ ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ pass=1 passlogfile=${stem}_vp8}} \ - ${vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ + ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ pass=1 passlogfile=${stem}_vp9}} \ ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 \ pass=1 passlogfile=${stem}_vp8}} \ | $ffmpeg_chained $_ffmpeg_stdin \ ${webm:+${use_ffmpeg_vp8:+$_ffmpeg_rawvideo $_ffmpeg_vp8 -an \ -pass 1 -passlogfile ${stem}_vp8 /dev/null}} \ - ${vp9:+${use_ffmpeg_vp9:+$_ffmpeg_rawvideo $_ffmpeg_vp9 -an \ + ${webm_vp9:+${use_ffmpeg_vp9:+$_ffmpeg_rawvideo $_ffmpeg_vp9 -an \ -pass 1 -passlogfile ${stem}_vp9 /dev/null}} \ ${mp4:+${use_ffmpeg_avc:+${use_ffmpeg_avc:+$_ffmpeg_rawvideo $_ffmpeg_avc -an \ -pass 1 -passlogfile ${stem}_avc /dev/null}}} @@ -739,14 +739,14 @@ if [ -n "${webm:+$multipass_vp8}${vp9:+$multipass_vp9}${mp4:+$multipass_avc}" ]; $melt $_melt_infiles $filters \ ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ pass=1 passlogfile=${stem}_vp8}} \ - ${vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ + ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ pass=1 passlogfile=${stem}_vp9}} \ ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 \ pass=1 passlogfile=${stem}_vp8}} fi fi -if [ -n "${webm:+$use_vpxenc$use_ffmpeg_vp8$use_oggenc}${vp9:+$use_vpxenc$use_ffmpeg_vp9$use_opusenc}${mp4:+$use_ffmpeg_avc}" ]; then +if [ -n "${webm:+$use_vpxenc$use_ffmpeg_vp8$use_oggenc}${webm_vp9:+$use_vpxenc$use_ffmpeg_vp9$use_opusenc}${mp4:+$use_ffmpeg_avc}" ]; then echo >&2 "Encoding video${channels:+ and extracting audio}, as discrete files..." $melt $_melt_infiles \ ${channels:+$audioprefilters \ @@ -769,11 +769,11 @@ if [ -n "${webm:+$use_vpxenc$use_ffmpeg_vp8$use_oggenc}${vp9:+$use_vpxenc$use_ff ${singlepass_vp8:+-p 1} \ ${multipass_vp8:+-p 2 --pass=2 --fpf=${stem}_vp8.log} \ -o ${stem}${channels:+_silent}.webm"}} \ - ${vp9:+${use_ffmpeg_vp9:+"$ffmpeg_chained \ - $_ffmpeg_stdin $_ffmpeg_webm_onlyvideo_vp9 \ + ${webm_vp9:+${use_ffmpeg_vp9:+"$ffmpeg_chained \ + $_ffmpeg_stdin $_ffmpeg_webm_vp9_onlyvideo \ ${multipass_vp9:+-pass 2 -passlogfile ${stem}_vp9} \ ${stem}_vp9${channels:+_silent}.webm"}} \ - ${vp9:+${use_vpxenc:+"$vpxenc_chained - $_vpxenc_vp9 \ + ${webm_vp9:+${use_vpxenc:+"$vpxenc_chained - $_vpxenc_vp9 \ ${singlepass_vp9:+-p 1} \ ${multipass_vp9:+-p 2 --pass=2 --fpf=${stem}_vp9.log} \ -o ${stem}_vp9${channels:+_silent}.webm"}} \ @@ -795,7 +795,7 @@ if [ -n "${webm:+$use_vpxenc$use_ffmpeg_vp8$use_oggenc}${vp9:+$use_vpxenc$use_ff $_ffmpeg_webm_keepvideo ${stem}.webm fi fi - if [ -n "${vp9:+$use_vpxenc$use_ffmpeg_vp9$use_opusenc}" ] && [ -n "$channels" ]; then + if [ -n "${webm_vp9:+$use_vpxenc$use_ffmpeg_vp9$use_opusenc}" ] && [ -n "$channels" ]; then echo >&2 "Encoding Opus audio and muxing with VP9 video..." if [ -n "$use_opusenc" ]; then $opusenc $_opusenc_wav_in $_opusenc_opus -o - $stem.wav \ @@ -832,7 +832,7 @@ else ${ogg:+-consumer avformat:$stem.ogv $_melt_ogg} \ ${webm:+-consumer avformat:$stem.webm $_melt_webm \ ${multipass_vp8:+pass=2 passlogfile=${stem}_vp8}} \ - ${vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ + ${webm_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ ${multipass_vp9:+pass=2 passlogfile=${stem}_vp9}} \ ${mp4:+-consumer avformat:$stem.mp4 $_melt_mp4 ${multipass_vp8:+pass=2 passlogfile=${stem}_vp8}} @@ -852,7 +852,7 @@ __height="${_height:+ height=\"$_height\"}" __heightplus=${_height:+ height=\"$((_height+4))\"} _source_ogg="<source src=\"$stem.ogv\" type=\"video/ogg\" />" _source_webm="<source src=\"$stem.webm\" type=\"video/webm\" />" -_source_vp9="<source src=\"${stem}_vp9.webm\" type='video/ogg; codecs=\"vp9, opus\"' />" +_source_webm_vp9="<source src=\"${stem}_vp9.webm\" type='video/ogg; codecs=\"vp9, opus\"' />" _source_mp4="<source src=\"$stem.mp4\" type=\"video/mp4\" />" [ -z "$flashplayer" ] || flash=yes [ -n "$mp4" ] || [ -z "$flash" ] || error1 "Cannot enable flash when mp4 format is disabled." @@ -861,14 +861,14 @@ _param_name="<param name=\"movie\" value=\"$flashplayer.swf\" />" _param_flashvars="<param name=\"flashvars\" value=\"image=$stem.jpg&file=$stem.mp4\" />" __oggfile=${ogg:+open format <a href=\"$stem.ogv\">Ogg/Thera</a>} __webmfile=${webm:+open format <a href=\"$stem.webm\">WebM/VP8</a>} -__vp9file=${vp9:+open format <a href=\"${stem}_vp9.webm\">WebM/VP9</a>} +__webm_vp9_file=${vp9:+open format <a href=\"${stem}_vp9.webm\">WebM/VP9</a>} __mp4file=${mp4:+closed format <a href=\"$stem.mp4\">MPEG-4/AVC</a>} cat >"$stem.html" <<EOF <!-- Video for Everybody, Kroc Camen of Camen Design --> <video$__width$__height preload controls> ${mp4:+$_source_mp4 -}${vp9:+$_source_vp9 +}${webm_vp9:+$_source_webm_vp9 }${webm:+$_source_webm }${ogg:+$_source_ogg }${flash:+$_object_flash @@ -879,7 +879,7 @@ $_param_flashvars ${flash:+</object> }</video> <p><strong>Download Video:</strong><ul> -${vp9:+<li>$__vp9file +${webm_vp9:+<li>$__webm_vp9_file }${webm:+<li>$__webmfile }${ogg:+<li>$__oggfile }${mp4:+<li>$__mp4file |