Skip to main content

Topic: CRC for existing mp3 (Read 7194 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • zz1
  • [*]
CRC for existing mp3
Hi to all! (my first post here)

Is it possible to add CRC to an existing mp3 file?
(without recompressing/lossing quality)

  • Florian
  • [*][*][*][*][*]
  • FB2K Moderator (Donating)
CRC for existing mp3
Reply #1
No, this is not possible (because CRC uses 16 bits from MPEG frame if present).
Mp3tag - universal multi-format tag editor
http://www.mp3tag.de/en/

  • SebastianG
  • [*][*][*][*][*]
  • Developer
CRC for existing mp3
Reply #2
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

CRC for existing mp3
Reply #3
Quote
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.
[a href="index.php?act=findpost&pid=363875"][{POST_SNAPBACK}][/a]


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
  • [*][*][*][*][*]
  • Developer
CRC for existing mp3
Reply #4
Yeah, didn't think about that.

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
  • [*]
CRC for existing mp3
Reply #5
Quote
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.
[a href="index.php?act=findpost&pid=363875"][{POST_SNAPBACK}][/a]

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
  • [*]
CRC for existing mp3
Reply #6
Quote
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?
[a href="index.php?act=findpost&pid=363930"][{POST_SNAPBACK}][/a]

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
  • [*][*][*][*]
  • Developer
CRC for existing mp3
Reply #7
Quote
You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.[a href="index.php?act=findpost&pid=363875"][{POST_SNAPBACK}][/a]
No. 

@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...  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.
  • Last Edit: 14 February, 2006, 03:42:37 AM by Omion
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2

  • zz1
  • [*]
CRC for existing mp3
Reply #8
Quote
Quote
You may ask the coder of "mp3repacker" (omion) whether he's willing to add this functionality.[a href="index.php?act=findpost&pid=363875"][{POST_SNAPBACK}][/a]
No. 

@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...  it's not fast)
[a href="index.php?act=findpost&pid=364149"][{POST_SNAPBACK}][/a]

hehe, I haven't even asked and I already got rejected     
so crc won't do much..
thank you all for your answers 

CRC for existing mp3
Reply #9
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
  • [*][*][*][*][*]
CRC for existing mp3
Reply #10
Quote
or using a program that ignores tags for calculating the checksums.
[{POST_SNAPBACK}][/a]

such as mp3Tag [a href="http://www.mp3tag.de/en/]http://www.mp3tag.de/en/[/url]
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'