A friend handed me a 900-track folder last month: mostly 2000s electronic singles, tagged inconsistently, bitrates ranging from 128 to 320 kbps. He wanted a playlist for a long drive and complained several tracks “sound flat” in the car. I didn’t trust the bitrate column, so I ran a spectral cut-off check instead of listening to all 900.
The tool is ffmpeg plus a one-liner that measures energy above 16 kHz. A genuine 320 kbps MP3 of a full-band recording usually has content up to ~20 kHz. A 128 kbps file re-encoded to 320 has a hard wall near 16 kHz, because the lossy step already threw those bands away. Here’s the loop I used:
for f in *.mp3; do
ffmpeg -v error -i "$f" -af "highpass=f=16000,astats=metadata=1:reset=0" -f null - 2>&1 \
| awk -v file="$f" '/RMS level dB/ {print file, $NF; exit}'
done
Anything with an RMS above 16 kHz below about -75 dB is suspect. I flagged 61 files. Not proof, but a strong hint. For those, I opened a spectrogram (ffmpeg -i in.mp3 -lavfi showspectrumpic=s=1024x512 out.png) and eyeballed the top edge. 47 of the 61 had the telltale flat shelf.
Why this works: MP3 encoders discard high-frequency detail aggressively at low bitrates using psychoacoustic masking. Re-encoding at 320 kbps doesn’t restore what’s gone; it just spends bits on a signal that no longer has those bands. The cost of my method is false positives: tracks that were always dark or low-passed at mastering (some lo-fi, some older synth recordings) look the same. I checked those by ear before moving anything.
Where it fails: vinyl rips with surface noise can carry fake high-frequency energy, so they pass the check even if the source was a 128 kbps download. Very quiet ambient tracks can read below the threshold at 320 kbps legitimately. And the script doesn’t catch re-encodes from 192 to 320, which have a softer roll-off. I missed a few of those until I started comparing the roll-off slope, not just the level.
My friend kept the 47 flagged tracks but moved them to a “car only” playlist, where road noise hides the difference. That felt like the honest fix.
What’s your threshold for calling a file a re-encode, and do you check slope or just the cut-off frequency?


0 条评论
还没有评论,写下第一条。