diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-10-05 00:10:20 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-10-05 00:10:20 +0200 |
commit | 92a2b37926aa66a7f4c0c700d54577fddff3046e (patch) | |
tree | 811207903187ac9974894c8a961044d027aee37a | |
parent | ba1500b47e6e751e437d4f1ff74af87c2ee8520e (diff) |
Probe channels unconditionally, to always apply audio bitrate.
-rwxr-xr-x | localvideowebencode | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/localvideowebencode b/localvideowebencode index 52452e1..efdc405 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -380,11 +380,8 @@ case "$audio" in ;; *) exit1 "Unknown audio style \"$audio\".";; esac -# inspect channels only if potentially needing downmix/silence -if [ -n "$stereo$mono$silence" ]; then - channels=$(avprobe -v warning -show_streams "$infile_first" \ - | perl -ne 's/channels=// and print $_' || echo -1) -fi +channels=$(avprobe -v warning -show_streams "$infile_first" \ + | perl -ne 's/channels=// and print $_' || echo -1) # adapt channel count and flags to reflect actual downmix/silence need if [ -n "$stereo" ]; then if [ $channels -gt 2 ]; then @@ -405,7 +402,7 @@ elif [ -n "$silence" ]; then silence= fi fi -[ -z "$channels" ] || [ $channels -gt 0 ] || channels= +[ -z "$silence" ] || channels= if [ -n "$stereo$mono$silence" ]; then # melt cannot downmix with (stereo?) filters applied (bug#763911) if [ -n "$audioprefilters$compress$loudness$limit$filters" ]; then @@ -453,10 +450,10 @@ _melt_h264="vcodec=libx264 vpreset=$speedpreset_h264 vprofile=baseline${x264tune _melt_vorbis="$_melt_downmix acodec=libvorbis aq=$quality_vorbis" _avconv_vorbis="$_avconv_downmix -c:a libvorbis -aq $quality_vorbis" _oggenc_vorbis="$_oggenc_downmix -q $quality_vorbis" -_melt_opus="$_melt_downmix acodec=libopus${channels:+ ab=$(($channels*$bitrate_opus))k}${opusapp:+ application=$opusapp}" -_avconv_opus="$_avconv_downmix -c:a libopus${channels:+ -b:a $(($channels*$bitrate_opus))k}${opusapp:+ -application $opusapp}" -_opusenc_opus="$_opusenc_downmix ${channels:+--bitrate $((channels*bitrate_opus))}" -_melt_aac="$_melt_downmix acodec=aac${channels:+ ab=$(($channels*$bitrate_aac))k}" +_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_aac="$_melt_downmix acodec=aac ab=$(($channels*$bitrate_aac))k" # container options _melt_yuv4mpeg2="f=yuv4mpegpipe $_melt_video pix_fmt=yuv420p an=1 audio_off=1" |