Help - Search - Members - Calendar
Full Version: CRC for existing mp3
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
zz1
Hi to all! (my first post here)

Is it possible to add CRC to an existing mp3 file?
(without recompressing/lossing quality)
Florian
No, this is not possible (because CRC uses 16 bits from MPEG frame if present).
SebastianG
Correction: This is currently not possible because of the lack of software to do it. But in theory it is -- it requires reformating the whole stream and it's possible that it gets a bit bigger. You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.

Anyhow, I'd like to mention that the CRC checkums only cover a small portion of each frame (header + side info block -- not the main data). By checking these checksums you won't notice errors in the main data.

Sebi
Sebastian Mares
QUOTE(SebastianG @ Feb 13 2006, 09:42 AM)
Correction: This is currently not possible because of the lack of software to do it. But in theory it is -- it requires reformating the whole stream and it's possible that it gets a bit bigger. You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.
*



Well, assuming you have 128 kbps frames, you could upgrade them to 160 kbps to make room for the CRC and not alter the audio data, but what do you do with 320 kbps frames?
SebastianG
Yeah, didn't think about that. smile.gif

But according to omion some bits are usually wasted anyways on a 320 kbps stream, so it might be even possible for a 320 kbps stream to add CRC16 checksums for all frames (you may have to increase the number of padded frames which gains 8 bits of extra space per newly padded frame).

I guess this'll fail only in some rare cases.

Sebi
zz1
QUOTE(SebastianG @ Feb 13 2006, 02:42 AM)
Anyhow, I'd like to mention that the CRC checkums only cover a small portion of each frame (header + side info block -- not the main data). By checking these checksums you won't notice errors in the main data.
*


So CRC checkums won't detect if audio data is bad?

What is the best way to test mp3's for errors? I have been using program called MP3Test.
zz1
QUOTE(Sebastian Mares @ Feb 13 2006, 07:55 AM)
Well, assuming you have 128 kbps frames, you could upgrade them to 160 kbps to make room for the CRC and not alter the audio data, but what do you do with 320 kbps frames?
*


Sorry for this n00bish question... If I have two mp3's that foobar reports that they are 192kbps and one have CRC checksum and the other does not than the file with CRC will have worse quality (will really have lower bps for audio data)?
Omion
QUOTE(SebastianG @ Feb 13 2006, 01:42 AM)
You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.
*

No. biggrin.gif

@zz1:
It would be possible to do (*), but as others have said, this is of limited functionality, as it only checks ~34 bytes of each frame. There are over 1000 bytes of audio data in a 320kbps frame, so the CRC won't help a whole lot. If you're worried about errors, I'd just make a PAR2 file from all the MP3(s) in the directory. I'm actually in the process of making a PAR2 of a bunch of stuff to be burnt to a DVD (6 hours left... sad.gif it's not fast)

QUOTE
Sorry for this n00bish question... If I have two mp3's that foobar reports that they are 192kbps and one have CRC checksum and the other does not than the file with CRC will have worse quality (will really have lower bps for audio data)?

The maximum possible quality will be higher with the one without CRCs. What quality they actually are depends, of course, on the encoder. BTW, my repacker will strip off the CRCs, in case you want to save a couple of KB on that file.

(*) There are some encoders (FhG?) which don't pad correctly. There are plenty of wasted bits, but my mp3repacker can't reach them. It would probably need a Huffman repacker to get out (which I'm not going to make). A 320kbps file encoded this way won't have enough space for the CRC. Other than that, I've never run into a file which you couldn't add 2 bytes per frame, even the CBR320 ones.
zz1
QUOTE(Omion @ Feb 14 2006, 02:37 AM)
QUOTE(SebastianG @ Feb 13 2006, 01:42 AM)
You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.
*

No. biggrin.gif

@zz1:
It would be possible to do (*), but as others have said, this is of limited functionality, as it only checks ~34 bytes of each frame. There are over 1000 bytes of audio data in a 320kbps frame, so the CRC won't help a whole lot. If you're worried about errors, I'd just make a PAR2 file from all the MP3(s) in the directory. I'm actually in the process of making a PAR2 of a bunch of stuff to be burnt to a DVD (6 hours left... sad.gif it's not fast)
*


hehe, I haven't even asked and I already got rejected unsure.gif crying.gif laugh.gif
so crc won't do much..
thank you all for your answers smile.gif
Sebastian Mares
You could also use "normal" hashes like MD5 or SHA-1 for example. However, recalculate the hash after each tagging process or using a program that ignores tags for calculating the checksums.
Jojo
QUOTE(Sebastian Mares @ Feb 16 2006, 01:28 PM)
or using a program that ignores tags for calculating the checksums.
*


such as mp3Tag http://www.mp3tag.de/en/
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.