Previous | Table of Content | Next |
The parameters that can be set in the encoder dialog are the most complex. The encoder makes a tradeoff between size and quality. The bigger the better, but your internet connection or your harddisk may not allow the biggest possible size. To guide this compromise between size and quality you have to set these parameters.
Before a discussion of the details, some general remarks might help.
The most important setting for the encoder it the target bitrate given in bits per second. As long as average bitrate is selected, any bitrate can be used. The possible bitrates for constant bitrates are limited depending on the sample frequency (see bitrate table) In this case the given bitrate will be rounded to the next valid value.
Encoding at constant bitrate will use exactly the same number of bits per frame regardless whether the sound encoded in the frame is very complex or just a pause of silence. Variable bitrate attempts to use the precious bits more effectively. It will use more bits on complex frames and fewer bits on simple frames. The allocation of bits to frames, using variable bitrates, can be based on two measures: on quality or on average bitrate.
Selecting Variable bitrate, will enable quality based allocation. The encoder will then try to maintain a constant quality using more bit, if the complexity of sound requires it, and less bit, when the simplicity of sound permits it. This mode is best for recording where the exact bitrate doesn't matter so much, but the quality is important and a good bitrate is desired.
With Average bitrate selected, the given bitrate is the target bitrate not to be exceeded in the long run. If however simple frames come along, some bits can be saved and later some complex frames, that benefit from some extra bit, can be encoded at higher bitrates. This mode is best in a streaming environment, where the target bitrate can be exceeded once in a while, because buffering at the receiver will iron out variations in bitrate, but must be maintained on the average to satisfy the network constraints.
Now to the details:
First you have to decide on the general method. This is done with the Encoding radio buttons.
Constant means, the stream will maintain a constant bitrate which is selected in the Bitrate group. Depending on the sample rate and the MPEG version different bitrates are valid (see bitrate table). The MPEG version is selected automatically depending on the output sample frequency. The encoder might have its own idea of what the best rate is and will lower the sample rate (see down sampling) if this will improve the end result. This in turn might mean that the MPEG version is not what you expect. The encoder dialog will round the bitrate to the next valid value based on the assumption that the output sample sate is equal to the input sample rate.
While this encoder mode will keep the steam flowing steadily, the quality will vary, since some parts are easier to encode than others (not recommended).
Variable means, that the bitrate varies maintaining a constant sound quality. The Target Quality (do not confuse with the Encoder Quality discussed below) can be set to a value from 0 to 9 in the Bitrate group. Here, 0 means highest quality and maximum bitrate; 9 means lowest quality and minimum bitrate. The value 4 is a good default. With a given target quality selected, the encoder will choose for every frame the smallest bitrate, that will allow it to reach the requested quality. (recommended for recording to disk)
Average means, that the stream will maintain an average bitrate, but sometimes the bitrate will be higher sometimes lower, saving bits when the signal is easy to encode and spending some extra bits when the signal is difficult. The average bitrate as well as the minimum and maximum bitrates can be set in the Bitrate group. This mode is recommended for streaming audio. The average bitrate can be just about any value. The settings for minimum and maximum value are rounded to the next valid number according to the bitrate table and the assumption that the output bitrate is the same as the input bitrate. As discussed above, this assumption may not be valid. It is best to leave the minimum and maximum bitrate set to zero; in this case, the encoder will pick good values for you.
Preset is a collections of preset parameter settings, that can be selected from a combobox in the Parameter group. This is a specialty of LAME.
The encoding Quality can be set with a combo box to a value from 0 to 9. Where 0 means highest quality (slow), 2 is high quality (recommended), 7 is fast but OK quality, and 9 is fastest but poor quality. Now that we have stressed that quality depends on the bitrate, it might come as a surprise that there is another quality setting that involves a quality/speed tradeoff instead of the well known quality/size tradeoff. Fact is, the MPEG standard gives only a single decoding algorithm, but there are many different choices to be made in encoding. Therefore different encoders, as should be known by now, achieve different quality even at exactly the same bitrate. Lame, by the way, is considered one of the best encoders. Not so well know is the fact, that you can influence the amount of searching that lame does to come up with a good encoding. If you make lame spend more time in searching for the best encoding, the quality of the encoding will improve without needing more bits. On the other hand, during live streaming the amount of time you can spend with encoding is limited by the performance of your processor. Nowadays processors are faster than e.g. a Pentium at 200MHz, and you can select 2 for the encoder quality. If your processor has other things to do as well and your soundcard buffer starts to overflow, select a lower quality.
The Mode, Stereo or Joint Stereo, is used only for stereo input. Mono input will remain mono. Joint stereo can be more effective, if both channels carry very similar information, as is the case for example with a speaker, where both channels will differ only slightly. Complex music might benefit from true stereo but might cost some extra bits.
Every mp3 frame transmitted has certain information flags. These flags are set according to the Flags group. The names Original and Copyright are self-explanatory and of little use. Setting the insert CRC flag will cause the encoder to insert two extra bytes for error protection in each frame. Increasing the stream by about 1%. It enables the receiving side of the connection to check whether the data has been corrupted during transmission.
There are two Options left: you can disable down sampling and the bitreservoir. When Lame decides that it can achieve better results at a lower sample rate (for low bitrates), it will change the sample rate to a new value. This is called down sampling. If you don't like it, set this Option. When frames are not completely filled, a bitreservoir builds up, that can be used later. This standard behavior can be disabled here (not recommended).