summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-10-09 14:20:26 +0200
committerJonas Smedegaard <dr@jones.dk>2014-10-09 14:34:10 +0200
commitc1da53f97c418affa9e3a2dbe765073896751504 (patch)
treef3b5894139dc31ec56bf41d59dd35025f10c5967
parentb511e81d3aa38ae9e74474979274636d13a7ebdd (diff)
Encode MPEG-4 with mp3 audio (using lame library) instead of AAC: Arguably all free AAC encoders are worse than Lame.
-rwxr-xr-xlocalvideowebencode10
1 files changed, 9 insertions, 1 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 168026d..552213f 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -197,6 +197,10 @@ if [ -n "$use_avconv_vp8$use_avconv_vp9$use_vpxenc" ]; then
[ -z "$use_oggenc$use_opusenc" ] || use_wav=yes
[ -z "$use_avconv_ogg$use_avconv_opus" ] || use_matroska=yes
fi
+# Avoid AAC if possible: Lame arguably better than any free AAC encoder
+# Argument for AAC: Safari possibly lacks mp3 support in video container
+#use_aac=yes
+[ -n "$use_aac" ] || use_mp3=yes
# resolve quality/speed hints
multipass=yes
@@ -363,6 +367,7 @@ fi
# default per-codec-channel bitrates
quality_vorbis=3
bitrate_opus=48
+bitrate_mp3=64
bitrate_aac=64
case "$audio" in
@@ -373,12 +378,14 @@ case "$audio" in
stereo=yes
quality_vorbis=1
bitrate_opus=32
+ bitrate_mp3=48
opusapp=voip
;;
speech)
mono=yes
quality_vorbis=1
bitrate_opus=32
+ bitrate_mp3=48
compress=yes
[ -z "$melt_recent" ] || _melt_loudness="$loudness_data"
limit=yes
@@ -466,6 +473,7 @@ _oggenc_vorbis="$_oggenc_downmix -q $quality_vorbis"
_melt_opus="$_melt_downmix acodec=libopus ab=$((channels*bitrate_opus))k${opusapp:+ application=$opusapp}"
_avconv_opus="$_avconv_downmix -c:a libopus -b:a $((channels*bitrate_opus))k${opusapp:+ -application $opusapp}"
_opusenc_opus="$_opusenc_downmix --bitrate $((channels*bitrate_opus))"
+_melt_mp3="$_melt_downmix acodec=libmp3lame ab=$((channels*bitrate_mp3))k"
_melt_aac="$_melt_downmix acodec=aac ab=$((channels*bitrate_aac))k"
# container options
@@ -491,7 +499,7 @@ _avconv_webm_keepvideo_opus="-f webm $_avconv_video -c:v copy ${silence:+-an}${c
_melt_webm_vp9="f=webm $_melt_video $_melt_vp9 ${silence:+an=1 audio_off=1}${channels:+$_melt_opus}"
_avconv_webm_vp9="-f webm $_avconv_video $_avconv_vp9 ${silence:+-an}${channels:+$_avconv_opus}"
_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_mp4="f=mp4 $_melt_video $_melt_h264 ${silence:+an=1 audio_off=1}${channels:+${use_mp3:+$_melt_mp3}${use_aac:+$_melt_aac}}"
_melt_img="f=image2 $_melt_video"
if [ -n "$loudness" ] && [ -z "$silence$_melt_loudness" ]; then