diff options
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-x | localvideowebencode | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/localvideowebencode b/localvideowebencode index b225aac..008140e 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -68,9 +68,10 @@ html favoring open formats with optional non-JavaScript Flash fallback. --webmpreset WebM target preset: 360p 720p 720p50_60 etc. (default: profile-related or 360p) --audio Audio style: - channels compress normalize limit - music max 2 X X - speech 1 X X X + channels compress normalize + music max 2 + hqspeech 1 + speech 1 X X silence 0 (default: none - use input channel count) --stem Stem of output filenames, optionally with path @@ -298,17 +299,18 @@ bitrate_aac=96 case "$audio" in music) channels=2 - # limit (i.e. avoid peaks "clipping") - _melt_audio_filters="-filter ladspa.1077" + ;; + hqspeech) + channels=1 + bitrate_vorbis=48 + bitrate_aac=64 ;; speech) channels=1 bitrate_vorbis=48 bitrate_aac=64 - # expand and compress (i.e. lower volume on silent and loud passages) - _melt_audio_filters_early="-filter ladspa.1075 -filter ladspa.1073" - # limit (i.e. avoid peaks "clipping") - _melt_audio_filters="-filter ladspa.1077" + compress=yes + normalize=yes ;; silence) channels=0 @@ -331,12 +333,16 @@ _melt_ogg="$_melt_video f=ogg vcodec=libtheora${bitrate_fixed:- qscale=5}" _melt_h264="$_melt_video $_melt_h264${bitrate_fixed:- qscale=5}" _melt_webm="$_melt_video vpre=libvpx-${webmpreset:-360p}" _melt_audio="${channels:+ac=$channels}" +# expand and compress (i.e. lower volume on silent and loud passages) +_melt_audio_filters_early="${compress:+-filter ladspa.1075 -filter ladspa.1073}" +# limit (i.e. avoid peaks "clipping") +_melt_audio_filters="${normalize:+-filter ladspa.1077}" _melt_vorbis="$_melt_audio acodec=libvorbis ab=$(($channels*$bitrate_vorbis))k" _melt_aac="$_melt_audio acodec=aac ab=$(($channels*$bitrate_aac))k" # resolve EBU R128 audio normalizing # TODO: normalize each infile separately when xml fed as infile keeps sync -if [ -n "$melt_recent" ] && [ -n "$channels" ]; then +if [ -n "$normalize" ] && [ -n "$melt_recent" ] && [ -n "$channels" ]; then $melt -group $_melt_in $infiles -group $_melt_audio_filters_early -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)" fi |