summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-10-05 01:14:45 +0200
committerJonas Smedegaard <dr@jones.dk>2014-10-05 01:14:45 +0200
commit437949ae89e22979d6f48f3fbe859c7752c4c2e6 (patch)
tree89f3702802173376822e6a080840af4734c85e77 /localvideowebencode
parent17bf49d41aeb11c3d62e3c41875277dc0792187c (diff)
Fix revert to analyze audio separately from video: Apparently MLT silently skips audio analysis of other consumers are added too.
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode30
1 files changed, 14 insertions, 16 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 2c19cc1..bbaa21b 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -483,14 +483,21 @@ _avconv_webm_onlyvideo_vp9="-f webm $_avconv_video $_avconv_vp9 -an}"
_melt_mp4="f=mp4 $_melt_video $_melt_h264 ${silence:+an=1 audio_off=1}${channels:+$_melt_aac}"
_melt_img="f=image2 $_melt_video"
-[ -n "$silence" ] || [ -z "$loudness" ] || [ -n "$_melt_loudness" ] || do_loudness=yes
+if [ -n "$loudness" ] && [ -z "$silence$_melt_loudness" ]; then
+ echo "Analyzing audio dynamics..."
+ $melt $_melt_infiles \
+ $audioprefilters -filter loudness $filters \
+ -consumer xml:$stem.xml video_off=1 all=1
+ _melt_loudness="$(perl -n \
+ -e 'm!<(property) name="results">([^<]+)</\1>! and print $2' \
+ $stem.xml)"
+ echo "Loudness data: $_melt_loudness"
+fi
+
if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
- echo "Analyzing video complexity${do_loudness:+ and audio dynamics}..."
+ echo "Analyzing video complexity..."
if [ -n "$use_vpxenc" ]; then
- $melt $_melt_infiles \
- ${do_loudness:+$audioprefilters -filter loudness} \
- $filters \
- ${do_loudness:+-consumer xml:$stem.xml video_off=1 all=1} \
+ $melt $_melt_infiles $filters \
-consumer avformat:pipe:1 $_melt_yuv4mpeg2 \
| pee \
${webm:+"$vpxenc_chained - $_vpxenc_vp8 \
@@ -498,10 +505,7 @@ if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
${vp9:+"$vpxenc_chained - $_vpxenc_vp9 \
-p 2 --pass=1 --fpf=${stem}_vp9.log -o /dev/null"}
else
- $melt $_melt_infiles \
- ${do_loudness:+$audioprefilters -filter loudness} \
- $filters \
- ${do_loudness:+-consumer xml:$stem.xml video_off=1 all=1} \
+ $melt $_melt_infiles $filters \
-consumer avformat:pipe:1 $_melt_yuv4mpeg2 \
| $avconv_chained $_avconv_yuv4mpeg2_in -i pipe:0 \
${webm:+$_avconv_rawvideo $_avconv_vp8 -an \
@@ -511,12 +515,6 @@ if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
[ -z "$webm" ] || [ -n "$use_avconv_vp8" ] || mv -f ${stem}_vp8-*.log ${stem}_vp8_2pass.log
[ -z "$vp9" ] || [ -n "$use_avconv_vp9" ] || mv -f ${stem}_vp9-*.log ${stem}_vp9_2pass.log
fi
- if [ -n "$do_loudness" ]; then
- _melt_loudness="$(perl -n \
- -e 'm!<(property) name="results">([^<]+)</\1>! and print $2' \
- $stem.xml)"
- echo "Loudness data: $_melt_loudness"
- fi
fi
if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then