summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-10-03 03:05:00 +0200
committerJonas Smedegaard <dr@jones.dk>2014-10-03 14:47:03 +0200
commit407bbf57e766855d4fb22d3493723e1fcde51f30 (patch)
tree5d38a0682f9e1c1238ba2756ae057fb80e9ed85f /localvideowebencode
parentb5fd27d2ca5bdd4074bfaabdd44cdad74753edde (diff)
Merge audio and video analyze steps.
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode25
1 files changed, 14 insertions, 11 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 7ff187c..9925c86 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -440,24 +440,23 @@ _avconv_webm_vp9="-f webm $_avconv_video $_avconv_vp9 $_avconv_opus"
_melt_mp4="f=mp4 $_melt_video $_melt_h264 $_melt_aac"
_melt_img="f=image2 $_melt_video"
-# resolve EBU R128 audio normalizing
-if [ -n "$loudness" ] && [ -z "$_melt_loudness" ]; then
- echo "Analyzing loudness data..."
- $melt ${_melt_sample:-$infiles} $audioprefilters -filter loudness -consumer xml:$stem.xml $_melt_audio video_off=1 all=1
- _melt_loudness="$(perl -ne 'm!<property name="results">([^<]+)</property>! and print $1' $stem.xml)"
- echo "Loudness data: $_melt_loudness"
-fi
-
+[ -z "$loudness" ] || [ -n "$_melt_loudness" ] || do_loudness=yes
if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
- echo "Analyzing complexity for WebM..."
+ echo "Analyzing video complexity${do_loudness:+ and audio dynamics}..."
if [ -n "$use_vpxenc" ]; then
- $melt ${_melt_sample:-$infiles} $filters \
+ $melt ${_melt_sample:-$infiles} \
+ ${do_loudness:+$audioprefilters -filter loudness} \
+ $filters \
+ ${do_loudness:+-consumer xml:$stem.xml $_melt_audio video_off=1 all=1} \
-consumer avformat:pipe:1 $_melt_yuv4mpeg2 \
| pee \
${webm:+"$vpxenc - $_vpxenc_vp8 -p 2 --pass=1 --fpf=${stem}_vp8.log -o /dev/null"} \
${vp9:+"$vpxenc - $_vpxenc_vp9 -p 2 --pass=1 --fpf=${stem}_vp9.log -o /dev/null"}
else
- $melt ${_melt_sample:-$infiles} $filters \
+ $melt ${_melt_sample:-$infiles} \
+ ${do_loudness:+$audioprefilters -filter loudness} \
+ $filters \
+ ${do_loudness:+-consumer xml:$stem.xml $_melt_audio video_off=1 all=1} \
-consumer avformat:pipe:1 $_melt_yuv4mpeg2 \
| $avconv $_avconv_yuv4mpeg2_in -i pipe:0 \
${webm:+$_avconv_rawvideo $_avconv_vp8 -an -pass 1 -passlogfile ${stem}_vp8 /dev/null} \
@@ -465,6 +464,10 @@ if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
[ -z "$webm" ] || mv -f ${stem}_vp8-*.log ${stem}_vp8_2pass.log
[ -z "$vp9" ] || mv -f ${stem}_vp9-*.log ${stem}_vp9_2pass.log
fi
+ if [ -n "$do_loudness" ]; then
+ _melt_loudness="$(perl -ne 'm!<property name="results">([^<]+)</property>! and print $1' $stem.xml)"
+ echo "Loudness data: $_melt_loudness"
+ fi
fi
if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then