[FFmpeg-devel] One pass volume normalization (ebur128)

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Jul 15 08:44:51 CEST 2013


Jan Ehrhardt in gmane.comp.video.ffmpeg.devel (Mon, 15 Jul 2013 06:47:48
+0200):
>OK, you've got some points for using volumedetect. The question is if
>you still get those differences, taken into account that disk speed
>might be a limiting factor. Our recordings are on a SD card and should
>stay there. Any one-pass scheme has the definite advantage that the disk
>has to be accessed only once for reading the input file (and, no, SD
>cards do not normally have a disk cache).

I did a little test on a 2GB Sony MPEG recording. Transcoding using the
R128 input took (on my i5) 178 seconds. Volumedetection on the same file
only took 8 seconds and when I applied a volume=-6dB on the source file
I was 166 seconds further. Net difference: 8 + 166 = 174 versus 178 is
little bit more than a 2% speed gain.

[two pass]
>I would rather not do that, even if it delivers another 5% (or something
>like that) speed increase. Everything that breaks the process into more
>steps is bound to lead to errors.

When I copied the Sony recording to the SD card, I realised it was even
a little more complicated. MPEG files can be combined using concat, but
for instance MP4 files cannot. We talked about that back in October
2012: http://permalink.gmane.org/gmane.comp.video.ffmpeg.user/41031

I have now expanded that commandline with volume normalization for both
the [a0] and [a1] audio tracks. Breaking it up for two pass encoding
would in fact mean three pass in that case: (1) voldetect a0, (2)
voldetect a1, (3) the transcoding. Way too complicated to justify a 2-3%
speed gain.

>Would it be possible to insert the momentary value for volumedetect in
>the metadata and use that as input in af_volume.c? One pass
>normalization based on volumedetect should be faster than what we have
>now.
>
>How would we achieve that?

There is potential for about a 6-7% speed gain (166/178) if we can
inject the momentary value for 'mean volume' into the metadata and use
that for one pass normalization. I would really be interested.

And then we would finally have an equivalent for MEncoders volnorm
filter.

Jan



More information about the ffmpeg-devel mailing list