3 ms·
> I sometimes come across mp3 files with a high bitrate, but they sound bad which suggest that they were re-encoded from a bad/low-bitrate source. You could tr
by bheadmaster 2y ago
> I sometimes come across mp3 files with a high bitrate, but they sound bad which suggest that they were re-encoded from a bad/low-bitrate source.
You could try re-compressing the mp3 file to lower and lower bitrates and check the amplitude of differences. Since mp3 is a lossy codec, there will always be a slight difference, but you should see a sudden increase in difference when you surpass the "true" encoding bitrate.
You could probably write a script for it using ffmpeg and some other tools to generate a bitrate-difference chart.
- hgomersall 2y agoDoes this work if the encoders are different? Are encoders aware that you are transcoding rather than working on raw waveform data? Presumably if working on waveform data the higher bitrates will seek to maintain the artifacts due to the earlier transcoding. Can one rely this much on the behaviour of an encoder?
- bheadmaster 2y ago> Does this work if the encoders are different? I have no idea, honestly. I've tested my script (from a sibling comment of yours) with twolame [0] encoder, and I don't know if the results are good enough to indicate 64kbps true bitrate: user@host:~/temp$ ./main.sh 36-twolame-reencoded.mp3 320: 0.032303 256: 0.045563 224: 0.059769 192: 0.074631 160: 0.204269 128: 0.229187 112: 0.309540 96: 0.302414 80: 0.310181 64: 0.367279 56: 1.133713 48: 1.106262 40: 0.444473 32: 1.030777 [0] https://www.twolame.org/ https://www.twolame.org/
- Joel_Mckay 2y agoNot all mp3 codecs are the same, and some include a feature called perceptual compression. Thus, the predominate features of the audio one actually hears are preserved over high-frequency overtones most people find unpleasant. Thus, the self-similarity of the small file is improved, while the perceived sound quality is better at lower bit-rates (note not all psychoacoustic models are the same). This is why some encoders sound like garbage even at relatively high encoded quality levels. Lets be clear, most people can't hear the difference (e.x. digital synth music makes smaller files with duplicate audio), and others simply adapt to poor sound quality given they hit the $2.34 hardware mixer chip interpolation limitations long before the audio codecs limits (e.x. Bluetooth can be really iffy). Don't worry about it, and maybe pick up a stringed instrument if you want a quality experience =3
- bheadmaster 2y agoOkay, I got nerd sniped [0]. Here's the script I've made: https://gist.github.com/paskozdilar/6095fe73c80ad21fda3f518177699149 This isn't an exact method, so it will only print bitrates and their respective "difference" parameter. In general, as the difference parameter rises, you're more likely to have reached the "true" mp3 quality, and a sudden jump in difference parameter is an almost certain indicator of true quality. E.g. for a System Of A Down song "36", encoded at 320kbps, I get the following output: user@hostname:~/temp$ ./main.sh 36.mp3 320: 0.075272 256: 0.121475 224: 0.160858 192: 0.193726 160: 0.237717 128: 0.308029 112: 0.363953 96: 0.409012 80: 0.454941 64: 0.578598 56: 1.105850 48: 1.081100 40: 0.629898 32: 1.223129 Here, we have a jump immediately after 320kbps, which shows that this file is true 320kbps. When I compressed the song to 64kbps and then re-compressed it to 320kbps, I get this result: user@hostname:~/temp$ ./main.sh 36-reencoded.mp3 320: 0.146484 256: 0.146484 224: 0.146484 192: 0.146484 160: 0.146484 128: 0.146957 112: 0.178665 96: 0.210373 80: 0.175171 64: 0.211609 56: 1.054886 48: 0.944687 40: 0.505280 32: 0.852020 As we can see, the most significant jump happens from 64kbps to 56kbps, which confirms that this file's true bitrate is indeed 64kbps. Though, as sibling comment says, it's not confirmed that this kind of process works across encoders. I think that it should, because MP3 as a lossy codec mostly removes higher frequencies, and re-encoding compressed signal with same bitrate should remove less higher frequencies, because there are less to begin with. But I have no way to confirm - I'd need an array of encoders to actually verify this. [0] https://xkcd.com/356/ https://xkcd.com/356/
- tambourine_man 2y agoWhat an awesome thread. Someone posts a reasonable assumption, another one quickly validates it with a simple script. This is why I love Hacker News.
- waterhouse 2y agoIf you check the usernames, the one who suggested and the one who followed up are the same person. :-)