[FFmpeg-user] ffmpeg compand knobs problem

Beeblebrox zaphod at berentweb.com
Tue May 13 18:56:31 CEST 2014


Hello.

After a recent discussion on this mail list regarding fluctuating volume in
a video (human voices), it was suggested I use compand. Indeed, compand
seems the tool for this. From SoX documentation:
"If mixed audio seems loud enough at some points but too quiet in others
then dynamic range compression should be applied to correct this - see the
compand effect."

I have searched for and found a number of different settings for the
compand knobs. I have tried several permutations of those settings, but I
am now stuck because of conflicting results:

1. I created a sub-sample of a previously concat-merged mpeg2 video.
(ffmpeg -i in.mpg -ss 00:00:00 -t 00:03:00 out.mpg)

2. I then ran several compand variations on the sample output. The result
of the run + compand settings are below. all runs had volume=2 set as well.
NO=> No vol adjustment + distortion
compand=.3|.3:1|1:-54/-90|-36/-36|-24/-24|0/-12:6:0:-90:.1
NO=> No vol adjustment + distortion
compand=.05|.2:.05|.2:-54/-90|-36/-36|-24/-24|0/-12:6:0:-60:.1
NO=> Vol OK, distortion intolerable
compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:.1
YES=> Vol OK, No distortion
compand=.05|.2:.05|.2:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-60:.1

3. Now to the run that matters on the actual full video, using the compand
parameters which gave the good output. Resulting video has horrendous
audio, worse than anything encountered on the sample runs.

4. Another oddity I noticed was file size reduction percentage. The
complete ffmpeg command was
ffmpeg -i day7.mpg -c:a libfdk_aac -af 'volume=2,
compand=.05|.2:.05|.2:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-60:.1' -c:v
libx264 -preset slow -crf 32 -f mp4 day7.mp4
But notice the greatly different % in file reduction:
test: 4.4M t.mpg -> 3.8M t.mp4 = 14% reduction
actual: 3.1G day7.mpg -> 262M day7.mp4 = 84% reduction

My Q: Why does compand deliver a good result on a video segment but
completely bomb on the full video run? Is an 84% filesize reduction
abnormal, and thus the possible source of audio corruption?

Thanks and Regards
-- 
FreeBSD_amd64_11-Current_RadeonKMS


More information about the ffmpeg-user mailing list