Doesn't seem to work. I tried setting a maximum bitrate of 172 kbps and a minimum bitrate of 96 kbps with both oggdropxpd and oggenc2, but the resulting file still had frames with bitrates of 188 kbps and higher according to foobar2000.

Well, the only comment I can make is that it is supposed to work, according to this comment extract from oggenc/encode.c:

CODE

/* libvorbis 1.1 (and current svn) doesn't actually fill this in, which looks like a bug. It'll then reject it when we call the SET version below. So, fill it in with the values that libvorbis would have used to fill in this structure if we were using the bitrate-oriented setup functions. Unfortunately, some of those values are dependent on the bitrate, and libvorbis has no way to get a nominal bitrate from a quality value. Well, except by doing a full setup... So, we do that. Also, note that this won't work correctly unless you have a very recent (2005/03/04 or later) version of libvorbis from svn). */

If this continues to be a problem for people, I can only suggest raising it on the vorbis/vorbis-dev mailing lists. The guy responsible for the oggenc code is Michael Smith. He is currently travelling, so any response may be subject to a slight delay.

--------------------

John----------------------------------------------------------------My compiles and utilities are at http://www.rarewares.org/

Doesn't seem to work. I tried setting a maximum bitrate of 172 kbps and a minimum bitrate of 96 kbps with both oggdropxpd and oggenc2, but the resulting file still had frames with bitrates of 188 kbps and higher according to foobar2000.

Maybe the averaging window used to calculate the average bitrate has different sizes in oggenc and foobar.

=> all encodings generate the same output bitrate (161 kbps). I can see frames > 200 kbps with foobar2000, and as you can see, an average bitrate of 161 kbps for encoding that shouldn't exceed 150 and 160 kbps reveals that the function is still not working properly.

Ok. So then it means over a window of 2 seconds it must not use more than 256 kbit if I specify -M 128, right? But if a frame (the "frame" other people here talk about) is shorter than 2 seconds, then it may go over that as long as the average stays under the limit...?

=> all encodings generate the same output bitrate (161 kbps). I can see frames > 200 kbps with foobar2000, and as you can see, an average bitrate of 161 kbps for encoding that shouldn't exceed 150 and 160 kbps reveals that the function is still not working properly.

Are you sure you used 2.5? It doesn't work with aoyumi's code (yet )...

As I suspected, the method of applying hard min/max limits to the quality setting is simply another way of setting up ABR with limits. So, if ABR doesn't work for you, this won't either.

Quote from Mike:

QUOTE

All the bitrate controls operate over a sliding window (I think it defaults to 2 seconds?), so yes - the bitrate can drop below this* within that period.

(Yes, it is 2 seconds) Whether there is any mileage in trying to play with the Advanced Encoder Options relating to reservoir bias and reservoir bits, I don't know. I've played with both a little, but it seems to make little difference.

* This was in relation to a bitrate min/max limit of 96-224kbps.

For reference, Reservoir Size: The size of the minimum/maximum bitrate tracking reservoir, set in bits. The reservoir is used as a 'bit bank' to average out localized surges and dips in bitrate while providing predictable, guaranteed buffering behavior for streams to be used in situations with constrained transport bandwidth. The default setting is two seconds of average bitrate.

When a single frame is larger than the maximum allowed overall bitrate, the bits are 'borrowed' from the bitrate reservoir; if the reservoir contains insufficient bits to cover the defecit, the encoder must find some way to reduce the frame size.

When a frame is under the minimum limit, the surplus bits are placed into the reservoir, banking them for future use. If the reservoir is already full of banked bits, the encoder is forced to find some way to make the frame larger.

If the frame size is between the minimum and maximum rates (thus implying the minimum and maximum allowed rates are different), the reservoir gravitates toward a fill point configured by the reservoir bias setting described next. If the reservoir is fuller than the fill point (a 'surplus of surplus'), the encoder will consume a number bits from the reservoir equal to the number of the bits by which the frame exceeds minimum size. If the reservoir is emptier than the fillpoint (a 'surplus of defecit'), bits are returned to the reservoir equaling the current frame's number of bits under the maximum frame size. The idea of the fill point is to buffer against both underruns and overruns, by trying to hold the reservoir to a middle course.

Using settings toward 0.0 causes the bitrate manager to hoard bits in the bit reservoir such that there is a large pool of banked surplus to draw upon during short spikes in bitrate. As a result, the encoder will react less aggressively and less drastically to curtail framesize during brief surges in bitrate.

Using settings toward 1.0 causes the bitrate manager to empty the bit reservoir such that there is a large buffer available to store surplus bits during sudden drops in bitrate. As a result, the encoder will react less aggressively and less drastically to support minimum frame sizes during drops in bitrate and will tend not to store any extra bits in the reservoir for future bitrate spikes.

--------------------

John----------------------------------------------------------------My compiles and utilities are at http://www.rarewares.org/

Just a question: is possible to integrate a DC offset correction algorithm that filters the soundwave before the encoding ?

Yes, it is. I added a little code to my current test version of WaveGain and the wave files that showed offsets in EAC prior to processing, showed zero offsets after processing. So, yes it could be added as an option if it's felt to be generally useful.

--------------------

John----------------------------------------------------------------My compiles and utilities are at http://www.rarewares.org/