Open magicgoose opened 6 years ago
Surprisingly, when I use ffmpeg's drmeter
filter, it's consistently ~1.2x slower. Looks like it's not ready yet.
$ time ffmpeg -hide_banner -i test.flac -af drmeter -map 0:a -f wav -y /dev/null
…
real 0m3.046s
$ time simple_dr_meter --no-log test.flac
…
real 0m2.573s
test.flac is about 1 hour long, stereo, in CDDA resolution.
I tried the drmeter filter on ffmpeg but it seems that its not accurate. Sometimes it works just fine (compared to the official tt meter app), both left and right values are correct. But sometimes it just doesn't work. Either one of the values it off by 1 or 2 or just both are wrong. I tried many files and codecs but the result kept being random.
Here are some photos where I tested all dr meters I could find side by side (with the exact same file)
Perhaps if someone knows C can fix it? Here is the file https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/af_drmeter.c
I get constantly drmeter filter speed faster that this python code. I also improved precision issues in filter itself.
@richardpl that's good to hear! In that case maybe I could finally switch to ffmpeg for this task and drastically reduce python dependencies (numpy, etc).
Me too, I would like to reduce a lot of dependencies in my own audio tools. Hence, I also tried ffmpeg built-in drmeter and can conclude the same as 1nikolas above. And with some audio files, it even produces negative values ! So, sometimes ago, I created a ticket here https://trac.ffmpeg.org/ticket/10232 to report the problem with a sample file. But so far, no answer.
Any news, folks?
not really, I mostly lost interest in this topic but occasionally when I'm curious to check those values for some reason, this script of mine still works fine (important to remember that these values do not correlate very well with the actual perceived distortion, etc. although when it's <= 3 then it would almost guarantee obvious problems...)
Windows command to calculate DR if anyone needs it:
$ ffmpeg -i input.flac -vn -af drmeter -f null -
The ffmpeg bug mentioned here (https://trac.ffmpeg.org/ticket/10232) seems indeed fixed. I've just installed ffmpeg 6.1.1 on my mac and no more negative DR values.
Which parts of the report can be collected with FFMPEG, and which parts still require Python? DR is possible to get via drmeter
, what about Peak and RMS values? I see that ffmpeg -i input.flac -vn -af astats -f null -
returns Overall section where Peak level dB matches the result from the report, but RMS level dB does not.
https://www.ffmpeg.org/ffmpeg-filters.html#drmeter