INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Need A Little Math Help  (Read 1742 times)

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5907
  • Farm Animal Stupid
Need A Little Math Help
« on: June 15, 2006, 09:29:05 pm »

My car CD player supports MP3 CDs. I thought it would be cool to say, put Metallica's entire album collection on one CD to have in the Jeep. Yes, I know that cramming that much music into 700MB is going to mean really low quality, but when you're driving around with the top down, and the wind's blowing, quality isn't going to matter that much anyway.

So the problem I'm having is this... I know how much time the entire CD collection takes, and I know how much space I have on one CD. How do I get from pont A to point B? I tried something like this... (700 (MB) * 1024 (to get to Kilobytes) * 8 (to get to Kilobits)  That should tell me how many kilobits I have to work with. Then I took 13 hrs 32 seconds (the duration of all the music I wanted to convert), and did this... 13 * 60 * 60 + 32 (to tell me how many seconds I was working with).

At this point I have 5734400 kilobits to squees in 46832 seconds.

5734400/46832 = 122.4461906388793987017423983601.

So I figured 122 kbps should do it.

But then MC puked on this.

So did I do my math wrong, or does LAME just not support some weird bitrate like CBR 122? My options were 128 or 96. I really wanted to squeeze as much quality as I could in there, which is why I went with 122. I should actually have even more I could play with (nearly half a kbps) so I should be good for space, unless of course my math is off...
 
So which is it? Am I a mathematical idiot, or just ignorant of LAME's limitations?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Need A Little Math Help
« Reply #1 on: June 15, 2006, 10:26:32 pm »

See:

http://en.wikipedia.org/wiki/MP3#Bit_rate

for mp3 bitrate limitations.
Logged
The opinions I express represent my own folly.

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5907
  • Farm Animal Stupid
Re: Need A Little Math Help
« Reply #2 on: June 16, 2006, 02:08:12 pm »

Ah.... appears to be my wacky choice of a bitrate that was the problem. Looks like I'll have to drop all the way down to 112, then.

Thanks for the link!
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Need A Little Math Help
« Reply #3 on: June 16, 2006, 03:27:02 pm »

Your math is correct, but CBR is an unoptimal choice. You should use ABR instead. You can use for example lame.exe --preset 122 in the custom dialog. ABR can sometimes lead a bit higher average bitrate than the target, especially with loud music like Metallica. An optimal setting in this case could be something between --preset 115 and --preset 120. You may want to try a few test files first.

More info about ABR is available here: http://wiki.hydrogenaudio.org/index.php?title=LAME.


P.S.

This table may help those who hate maths:

MC cannot predict the encoded file sizes, but you could collect the files to a playlist first and use a constant bitrate when transcoding. Just monitor the total playback time and keep it below the disc limit.

Here is a table of the approximate maximum playback times for a 700 MB disc:

Code: [Select]
  Bitrate        Time
128 kbps   12 h 26 min
160 kbps    9 h 57 min
192 kbps    8 h 17 min
256 kbps    6 h 13 min
320 kbps    4 h 58 min

Leave some safe margin. Files are always a bit bigger than their theoretical size because of the tags.

For DVD discs you can multiply the times with a proper multiplier.


If encoding is too slow the Go-Go option helps. However I wouldn't recommend it for low bitrates if audio quality is important. In my opinion it starts to have usable quality at about 160 kbps.

Quote
11.1.122 (02/15/06)

13. NEW: Added option to use super-fast Go-Go encoder to MP3 encoder. (2x-3x faster for doing on-the-fly conversion for handhelds, UPnP, etc.)

Thanks. It looks fine:



I suppose many users will like this option whenever time is short.


I tested the Go-Go speed with various settings @ 192 kbps:

Test PC: a 2.8 GHz P4
Test file: a disc image wave file, 477 MB, 47 min 20 s (Enigma - Voyageur).

Go-Go

-a -b 192 -m j    50 s     (abr 192, joint stereo)
-a -b 192 -m j -q 2    62 s    (abr 192, joint stereo, high quality)
-b 192 -m j -q 2    62 s    (cbr 192, joint stereo, high quality)
-b 192 -m j    53 s    (cbr 192, joint stereo)
-b 192 -q 2    68 s    (cbr 192, high quality)
-b 192    52 s    (cbr 192)

LAME (standard MC options)

VBR High, Fast    191 s
ABR 192    198 s
CBR 192    196 s

Go-Go is 3-4x faster. I think I'll use the "gogo.exe -a -b 192 -m j -q 2" custom command line for the CD-RW discs I burn for my car stereo. It should produce the highest quality at about 192 kbps. Though, I am going to try an ABX listening test soon.


I have now encoded a few albums with Go-Go using "gogo.exe -a -b 192 -m j -q 2". The results are very promising. I have compared the original ape files and the mp3 files. With high-end headphones I can occasionally hear some differences, but when I listen to the mp3 files separately I don't notice anything annoying. The mp3 files may be slightly different, but in general the audio quality is just fine. I think they are good enough for my car and portable MP3 CD players.

It would be nice if the iPod users could try this setting. Since it is ABR and has less bitrate fluctuation, it is possible that it fixes the high bitrate LAME VBR skipping problem.

On my P4 system it is over 3x faster than LAME VBR High Fast and because the encoding mode is ABR the resulting bitrate is more predictable too. The smallest file has been about 180 kbps and the biggest about 200 kbps so far. The average bitrate seems to be very near the 192 kbps target value.

Any target bitrate is possible so command line strings like "gogo.exe -a -b 165 -m j -q 2" and "gogo.exe -a -b 208 -m j -q 2" are fine.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5907
  • Farm Animal Stupid
Re: Need A Little Math Help
« Reply #4 on: June 16, 2006, 04:46:39 pm »

Your math is correct, but CBR is an unoptimal choice. You should use ABR instead. You can use for example lame.exe --preset 122 in the custom dialog. ABR can sometimes lead a bit higher average bitrate than the target, especially with loud music like Metallica. An optimal setting in this case could be something between --preset 115 and --preset 120. You may want to try a few test files first.

More info about ABR is available here: http://wiki.hydrogenaudio.org/index.php?title=LAME.

Well, as it turns out, that's (I think) exactly what I did. I set the option in the CBR field (can't remember now if I told it to restrict to CBR, although I'm fairly positive I didn't check that box), saw how it set the Custom Command Line, and then just chose that option instead and set it to 122. The end result was MC failing to burn the CD. I didn't really have time to investigate, so I don't know if it did transcode everything to ABR 122, and that was still too big for one CD, or if it got mad because I was trying to use 122. I'll play around some more tonight and see if I can figure it out. It just takes sooooo long everytime... :P
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Need A Little Math Help
« Reply #5 on: June 16, 2006, 05:34:36 pm »

How about using the handheld option for converting the files to a folder first. MC makes a playlist that can be used for burning the files afterwards. That would also make possible to replace some less demanding files with lower bitrate encodings before burning the disc if needed. Does Metallica have any ballads?

Actually, because Metallica's musical genre is very demanding for lossy encoders I would consider making two discs instead of one. The guitars should be distorded, but not the symbals, if you know what I mean. Then you could use Go-Go with a command line like gogo.exe -a -b 224 -m j -q 2.

In addition, I have usually run Mp3Gain on the converted files before burning my compilations.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755
Pages: [1]   Go Up