IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
best mp3 preset and settings for 128 kbps CBR
m3gab0y
post Jun 5 2011, 22:08
Post #1





Group: Members
Posts: 11
Joined: 5-June 11
Member No.: 91262



Hey guys, maybe it's discussed before (I found only the threat from 2003), and sorry if i'm posting duplicate.

I have a radiostation that obviously has output frequency responce of 30 hz up to 16 khz, with brickwall filters, and some other fancy equipment.... smile.gif
I want to steam this station at 128 kbps and achieve the best possible quality of a CBR 128 KBPS mp3 encoder. Did I mention that the input material is 99.9% lossless audio? cool.gif

I currently use edcast with Lame 3.93.1 using preset=12 and quality=0 and I'm getting decent results. But I hear lots of dirrerence between the original output and the stream. Am I doing something wrong? And is there better way to squeze more out of the mp3 codec?

This post has been edited by m3gab0y: Jun 5 2011, 22:53
Go to the top of the page
+Quote Post
db1989
post Jun 5 2011, 22:39
Post #2





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



Get a version of LAME that was released more recently than 2002, for starters!

The simplest setting is -b128, but perhaps others can suggest tweaks that might improve the quality.
Go to the top of the page
+Quote Post
pdq
post Jun 6 2011, 03:03
Post #3





Group: Members
Posts: 3372
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



Try ABR, or even a VBR setting that gives about the same bitrate.
Go to the top of the page
+Quote Post
Satellite_6
post Jun 6 2011, 06:49
Post #4





Group: Members
Posts: 37
Joined: 13-September 10
From: VA, USA
Member No.: 83831



QUOTE (pdq @ Jun 5 2011, 22:03) *
Try ABR, or even a VBR setting that gives about the same bitrate.


I think he has to use CBR because he is streaming. (correct me if I'm wrong, I'm new!)

@ OP, Use the latest version of LAME, certainly! If you still hear differences (ABX it) you might want to move on up to 192 or higher. . .


--------------------
People are silly.
Go to the top of the page
+Quote Post
Martel
post Jun 6 2011, 18:51
Post #5





Group: Members
Posts: 553
Joined: 31-May 04
From: Czech Rep.
Member No.: 14430



Streaming does not HAVE TO use CBR. It's just the most predictable/stable mode bandwidth-wise. If you don't care about this property much (receivers have large enough buffer and bandwidth reserve) then ABR or even VBR may be better alternatives. Especially if you're willing to endure bitrate fluctuations to maximize the quality.

This post has been edited by Martel: Jun 6 2011, 18:51


--------------------
IE4 Rockbox Clip+ AAC@192; HD 668B/HD 518 Xonar DX FB2k FLAC;
Go to the top of the page
+Quote Post
2Bdecided
post Jun 7 2011, 18:02
Post #6


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



You can use ABR with a hard bandwidth cap - but worst case that's as bandwidth hungry as CBR at the bandwidth cap. If that worst case is acceptable in bandwidth terms, you might as well use CBR at that bandwidth cap!

The advantage of ABR or VBR in this case is that it can save you a little bandwidth/money, but not increase quality.

You could manage peak and average bitrates over timescales which equate to typical buffers, giving you a potentially useful quality increase (compared with CBR) within the same overall bandwidth constraints. However, unless I'm mistaken, lame doesn't give you this kind of control, does it?

You could say that you don't care, and that overall VBR will still work well enough overall - but then you will get users whose feed drops out when the bitrate goes up. That's far worse than an occasional encoding artefact.

Cheers,
David.
Go to the top of the page
+Quote Post
benski
post Jun 7 2011, 18:29
Post #7


Winamp Developer


Group: Developer
Posts: 670
Joined: 17-July 05
From: Brooklyn, NY
Member No.: 23375



Most streaming server services charge for bandwidth, not total data transferred. If you're going to do ABR with a hard cap, you might as well do CBR at the cap. You'll get objectively higher quality without any additional cost. The only advantage to ABR with a hard cap is that you might have some additional bandwidth to buffer new listeners faster.
Go to the top of the page
+Quote Post
C.R.Helmrich
post Jun 7 2011, 20:49
Post #8





Group: Developer
Posts: 686
Joined: 6-December 08
From: Erlangen Germany
Member No.: 64012



For clarification, since many seem to be misunderstanding this: CBR does not mean that each audio frame consumes the same number of bits. It's VBR restricted by a bit reservoir of fixed size/length (a buffer). Which IMHO is exactly what you need for streaming and what the bit reservoir mode was developed for. Some mostly accurate further reading I found in a hurry:

http://wiki.hydrogenaudio.org/index.php?title=Bit_reservoir*
http://www.linuxconsulting.ro/darkice/streaming-modes.html

Btw, AAC is much better suited for CBR encoding because 1) the frame sizes don't have to be integer multiples of 16 or 32 kbps, 2) the bit reservoir is larger (at least I think it is, 6144 bits per channel in AAC... mp3? Edit: Less than 1000 it seems?)

Chris

* This says "The term bit reservoir is used exclusively in the MP3 specification", which is not true. It's also used in all versions of AAC.

This post has been edited by C.R.Helmrich: Jun 7 2011, 21:02


--------------------
If I don't reply to your reply, it means I agree with you.
Go to the top of the page
+Quote Post
2Bdecided
post Jun 8 2011, 10:32
Post #9


ReplayGain developer


Group: Developer
Posts: 5059
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



Yes, but the mp3 CBR bitrate reservoir isn't really related to the kind of buffering, network latency / jitter etc that you want to anticipate / take advantage of in the real world - it's one or two orders of magnitude too small IMO.

I agree about AAC - it seems to work really well in this respect.

Cheers,
David.
Go to the top of the page
+Quote Post
DonP
post Jun 8 2011, 11:09
Post #10





Group: Members (Donating)
Posts: 1471
Joined: 11-February 03
From: Vermont
Member No.: 4955



You could stream Vorbis and buy some more bandwidth with the saved mp3 license fees cool.gif

This post has been edited by DonP: Jun 8 2011, 11:10
Go to the top of the page
+Quote Post
m3gab0y
post Jun 9 2011, 14:50
Post #11





Group: Members
Posts: 11
Joined: 5-June 11
Member No.: 91262



Hey guys. Thanks for the replies. I've expected a "read the lame documentation" + ban from the site for that kind of "question" rolleyes.gif

QUOTE (2Bdecided @ Jun 7 2011, 20:02) *
You can use ABR with a hard bandwidth cap - but worst case that's as bandwidth hungry as CBR at the bandwidth cap. If that worst case is acceptable in bandwidth terms, you might as well use CBR at that bandwidth cap!

The advantage of ABR or VBR in this case is that it can save you a little bandwidth/money, but not increase quality.

You could manage peak and average bitrates over timescales which equate to typical buffers, giving you a potentially useful quality increase (compared with CBR) within the same overall bandwidth constraints. However, unless I'm mistaken, lame doesn't give you this kind of control, does it?

You could say that you don't care, and that overall VBR will still work well enough overall - but then you will get users whose feed drops out when the bitrate goes up. That's far worse than an occasional encoding artefact.

Cheers,
David.


I use dedicated servers for this, with fixed network line speed, that is almost 100% full because of the popularity of the station.

As I've read in here and here that the LAME 3.93.1 is the "best" encoder for streaming at 128 kbps.
Using VBR means:
1. Bursting over the bandwidth cap;
2. Compatibility problem with some devices.

QUOTE (C.R.Helmrich @ Jun 7 2011, 22:49) *
For clarification, since many seem to be misunderstanding this: CBR does not mean that each audio frame consumes the same number of bits. It's VBR restricted by a bit reservoir of fixed size/length (a buffer). Which IMHO is exactly what you need for streaming and what the bit reservoir mode was developed for. Some mostly accurate further reading I found in a hurry:

http://wiki.hydrogenaudio.org/index.php?title=Bit_reservoir*
http://www.linuxconsulting.ro/darkice/streaming-modes.html

Btw, AAC is much better suited for CBR encoding because 1) the frame sizes don't have to be integer multiples of 16 or 32 kbps, 2) the bit reservoir is larger (at least I think it is, 6144 bits per channel in AAC... mp3? Edit: Less than 1000 it seems?)

Chris

* This says "The term bit reservoir is used exclusively in the MP3 specification", which is not true. It's also used in all versions of AAC.


I don't like the way AAC+ v2 sounds to me at high bitrate. The very first AAC (not v1, v2, etc.) sounds good to me, but it requires high bitrate for it.
But I'm considering AAC+ as option in the future, because I have a 32 kbps AAC+ v2 PS stream and it sounds very good, given the low bitrate.
Also, going to AAC+ will yield lots of compatibility problems along players and devices that "listen" to the stream.

QUOTE (DonP @ Jun 8 2011, 13:09) *
You could stream Vorbis and buy some more bandwidth with the saved mp3 license fees cool.gif


This is not a bad idea, I like Vorbis the best. It sounds really good even at quality 2, and it will save me some bandwidth smile.gif
But as I said above, going to OGG/Vorbis means lots of incompatibility.
Go to the top of the page
+Quote Post
db1989
post Jun 9 2011, 15:26
Post #12





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (m3gab0y @ Jun 9 2011, 14:50) *
QUOTE (C.R.Helmrich @ Jun 7 2011, 22:49) *
Btw, AAC is much better suited for CBR encoding because 1) the frame sizes don't have to be integer multiples of 16 or 32 kbps, 2) the bit reservoir is larger (at least I think it is, 6144 bits per channel in AAC... mp3? Edit: Less than 1000 it seems?)
I don't like the way AAC+ v2 sounds to me at high bitrate. The very first AAC (not v1, v2, etc.) sounds good to me, but it requires high bitrate for it.
But I'm considering AAC+ as option in the future, because I have a 32 kbps AAC+ v2 PS stream and it sounds very good, given the low bitrate.
Also, going to AAC+ will yield lots of compatibility problems along players and devices that "listen" to the stream.
AAC+ (a.k.a. HE-AAC) is designed for low bitrates only. Basic (i.e. LC-)AAC is designed for the same ranges as MP3 and tends to perform slightly better (albeit not always to a statistically significant extent </obligatorydisclaimer>) at equivalent bitrates.
Go to the top of the page
+Quote Post
DonP
post Jun 9 2011, 15:43
Post #13





Group: Members (Donating)
Posts: 1471
Joined: 11-February 03
From: Vermont
Member No.: 4955



Some stations offer multiple formats: a choice of vorbis and mp3 and/or multiple data rates. For some the alternate is a flash player (unknown format). The station I listen to most on line encourages the flash player as cheaper for them, so presumably it's either a free format or more efficient than mp3.

Another issue, no doubt addressed hundreds of times: when you hit your cap, do you prevent additional stream starts, or do you lower the rate for everyone so everyone can listen?
Go to the top of the page
+Quote Post
rexit2
post Jun 9 2011, 15:56
Post #14





Group: Members
Posts: 67
Joined: 5-April 02
Member No.: 1698



I have been using the ABR128 preset with LAME 3.98.2 re-sampled to 32khz.
This should compare favorably to any FM signal.
I also prefer ogg q2 for streaming, however compatibility can be an issue for listeners.
AAC+ does not sound transparent to my ears at all. (I realize it was never designed to be, but the artifacts are almost always there)
Go to the top of the page
+Quote Post
lvqcl
post Jun 9 2011, 16:05
Post #15





Group: Developer
Posts: 3327
Joined: 2-December 07
Member No.: 49183



QUOTE (m3gab0y @ Jun 9 2011, 17:50) *
As I've read in here and here that the LAME 3.93.1 is the "best" encoder for streaming at 128 kbps.


1st link: "I did extensive blind ABX testing to find that 3.93.1 seems to sound the closest to the original input, at 128kbps cbr. This was done when 3.97 was out, so it's possible that 3.98.x would beat 3.93.1, but I highly doubt it." So far so good.

2nd link: comparison of waveform ?? That's not how lossy codecs can be compared.
Go to the top of the page
+Quote Post
db1989
post Jun 9 2011, 16:17
Post #16





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (rexit2 @ Jun 9 2011, 15:56) *
AAC+ does not sound transparent to my ears at all. (I realize it was never designed to be, but the artifacts are almost always there)
Makes sense, considering that its not designed for transparency but for audibly pleasing reconstruction of high frequencies from very low-bitrate streams. IIRC, about 96 kbps is its threshold of utility.
Go to the top of the page
+Quote Post
chencho
post Jun 9 2011, 16:52
Post #17





Group: Members
Posts: 38
Joined: 6-February 03
Member No.: 4877



I am streaming at 128 kbps mp3 CBR using newest lame for audacity. I suggest to encode, normalize and compress all your tracks first using Audacity compression and normalization default settings, later export to 128kbps CBR and save into your stream tracks folder. Then try a direct conection to your server, not needs to re-encode.
Let me know if this little trick solve your Sound quality troubles!
Go to the top of the page
+Quote Post
IgorC
post Jun 9 2011, 17:14
Post #18





Group: Members
Posts: 1533
Joined: 3-January 05
From: ARG/RUS
Member No.: 18803



QUOTE (dv1989 @ Jun 9 2011, 11:26) *
Basic (i.e. LC-)AAC is designed for the same ranges as MP3 and tends to perform slightly better (albeit not always to a statistically significant extent </obligatorydisclaimer>) at equivalent bitrates.

'Slightly'?

I think 'considerably' is a correct word. Last time I checked iTunes LC-AAC 96 kbps VBR was on par with LAME -V5 (130-140 kbps).
Also iTunes LC-AAC 96 kbps was used as high anchor(!) in some previous public tests. http://listening-tests.hydrogenaudio.org/sebastian/
That means that it's really good already at such low bitrate.

Go to the top of the page
+Quote Post
C.R.Helmrich
post Jun 9 2011, 18:13
Post #19





Group: Developer
Posts: 686
Joined: 6-December 08
From: Erlangen Germany
Member No.: 64012



QUOTE (m3gab0y @ Jun 9 2011, 15:50) *
I don't like the way AAC+ v2 sounds to me at high bitrate. The very first AAC (not v1, v2, etc.) sounds good to me, but it requires high bitrate for it.
But I'm considering AAC+ as option in the future, because I have a 32 kbps AAC+ v2 PS stream and it sounds very good, given the low bitrate.

Yes, that's what HE-AAC v2 is designed for: bitrates of 32 kbps or lower. It uses parametric coding, so it cannot become transparent like the "first AAC" (Low Complexity). The latter of course can't do miracles, but give it a try at 96 kbps compared to MP3 at 128. You might come to the same conclusion as Igor.

Chris


--------------------
If I don't reply to your reply, it means I agree with you.
Go to the top of the page
+Quote Post
m3gab0y
post Jun 9 2011, 19:32
Post #20





Group: Members
Posts: 11
Joined: 5-June 11
Member No.: 91262



QUOTE (DonP @ Jun 9 2011, 17:43) *
Some stations offer multiple formats: a choice of vorbis and mp3 and/or multiple data rates. For some the alternate is a flash player (unknown format). The station I listen to most on line encourages the flash player as cheaper for them, so presumably it's either a free format or more efficient than mp3.

Another issue, no doubt addressed hundreds of times: when you hit your cap, do you prevent additional stream starts, or do you lower the rate for everyone so everyone can listen?


I use the same technology, Flash Player that plays the 128 KBPS CBR mp3 Stream. It works just fine (with the right encapsulation that is done by my streaming server)
Going VBR/ABR will kill the flash player or make it behave like crazy.


When I hit the cap, I redirect listeners to a stream, "saying" that there are no slots at the moment.

QUOTE (chencho @ Jun 9 2011, 18:52) *
I am streaming at 128 kbps mp3 CBR using newest lame for audacity. I suggest to encode, normalize and compress all your tracks first using Audacity compression and normalization default settings, later export to 128kbps CBR and save into your stream tracks folder. Then try a direct conection to your server, not needs to re-encode.
Let me know if this little trick solve your Sound quality troubles!


I'm using a different approach, the same one as any big, loud, commercial and famous radio station out there. So this is NOT an option.
I use equivalent equipment, and the level is normalized, the tracks probably filtered (lowpass + highpass) before going into the compressor, limiter, clipper and, finally, the transmitter and the encoder.
Maybe I'll try the latest lame, but give me optimal preset setting to start with.

QUOTE (C.R.Helmrich @ Jun 9 2011, 20:13) *
Yes, that's what HE-AAC v2 is designed for: bitrates of 32 kbps or lower. It uses parametric coding, so it cannot become transparent like the "first AAC" (Low Complexity). The latter of course can't do miracles, but give it a try at 96 kbps compared to MP3 at 128. You might come to the same conclusion as Igor.

Chris

Thanks, I will test the latest LC-AAC soon.

p.s. here is what the station sounds like on the net at 128 kbps mp3 CBR. I will test some settings and codecs in a short while.

btw. an competitor is streaming at 256 kbps AAC+ v2, 96 KHz sample rate... blink.gif
The quality is good, but, the only players that can decode this stream are Winamp and VideoLAN, and only if you have a 96 KHz capable sound card.

This post has been edited by m3gab0y: Jun 9 2011, 19:37
Go to the top of the page
+Quote Post
pdq
post Jun 9 2011, 20:03
Post #21





Group: Members
Posts: 3372
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



QUOTE (m3gab0y @ Jun 9 2011, 14:32) *
btw. an competitor is streaming at 256 kbps AAC+ v2, 96 KHz sample rate... blink.gif
The quality is good, but, the only players that can decode this stream are Winamp and VideoLAN, and only if you have a 96 KHz capable sound card.

Huh???

As I understand it, v2 downsamples the audio to half its sample rate, then replaces the lost frequencies with a simulation. That would mean in this case downsampling to 48 kHz, then replacing everything that was lost above 24 kHz with simulated audio.

What audio above 24 kHz is it simulating???
Go to the top of the page
+Quote Post
db1989
post Jun 9 2011, 20:04
Post #22





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



96 kHz? Why?

Wait: 256 kbps and 96 kHz in AAC+ v2? What.
Go to the top of the page
+Quote Post
m3gab0y
post Jun 9 2011, 20:12
Post #23





Group: Members
Posts: 11
Joined: 5-June 11
Member No.: 91262



QUOTE (DonP @ Jun 9 2011, 17:43) *
Some stations offer multiple formats: a choice of vorbis and mp3 and/or multiple data rates. For some the alternate is a flash player (unknown format). The station I listen to most on line encourages the flash player as cheaper for them, so presumably it's either a free format or more efficient than mp3.

Another issue, no doubt addressed hundreds of times: when you hit your cap, do you prevent additional stream starts, or do you lower the rate for everyone so everyone can listen?



QUOTE (pdq @ Jun 9 2011, 22:03) *
QUOTE (m3gab0y @ Jun 9 2011, 14:32) *
btw. an competitor is streaming at 256 kbps AAC+ v2, 96 KHz sample rate... blink.gif
The quality is good, but, the only players that can decode this stream are Winamp and VideoLAN, and only if you have a 96 KHz capable sound card.

Huh???

As I understand it, v2 downsamples the audio to half its sample rate, then replaces the lost frequencies with a simulation. That would mean in this case downsampling to 48 kHz, then replacing everything that was lost above 24 kHz with simulated audio.

What audio above 24 kHz is it simulating???



QUOTE (dv1989 @ Jun 9 2011, 22:04) *
96 kHz? Why?

Wait: 256 kbps and 96 kHz in AAC+ v2? What.



THAT!!! I took this file from their official SHOTCast Stream smile.gif
Play it in Winamp. I can achieve the same "effect" in my encoder (HE-ACC High, 256 kbps), but it sounds bad for me. Vorbis at q8 outperforms it!

This post has been edited by m3gab0y: Jun 9 2011, 20:13
Go to the top of the page
+Quote Post
lvqcl
post Jun 9 2011, 20:42
Post #24





Group: Developer
Posts: 3327
Joined: 2-December 07
Member No.: 49183



According to Winamp, it's MPEG-2 HE-AAC (aka AAC+), not AAC+ v2.

This post has been edited by lvqcl: Jun 9 2011, 20:43
Go to the top of the page
+Quote Post
C.R.Helmrich
post Jun 9 2011, 23:01
Post #25





Group: Developer
Posts: 686
Joined: 6-December 08
From: Erlangen Germany
Member No.: 64012



QUOTE (pdq @ Jun 9 2011, 21:03) *
As I understand it, v2 downsamples the audio to half its sample rate, then replaces the lost frequencies with a simulation. That would mean in this case downsampling to 48 kHz, then replacing everything that was lost above 24 kHz with simulated audio.

Correct. That's the idea of dual-rate Spectral Band Replication (SBR).

QUOTE
What audio above 24 kHz is it simulating???

Nothing. smile.gif There is nothing above 21 kHz. I think the idea here was to avoid the core-coder (AAC-LC) downsampling but still use the bandwidth extension functionality of SBR (which starts at ~17 kHz and ends at 21 kHz here).

Not a bad idea in principle, except that with 256 kb available you can simply encode to AAC-LC with 20 kHz bandwidth or so (i.e. no need for bandwidth extension).

Chris


--------------------
If I don't reply to your reply, it means I agree with you.
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th July 2014 - 05:07