Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Specifying maximum bit rate for Speex-VBR mode (Read 6716 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Specifying maximum bit rate for Speex-VBR mode

Hi everyone,

I am currently trying to encode some files using Speex. I execute the following command lines in Speex:

speexenc --vbr --quality 10 --comp 4 --bitrate 24576 filename.wav filename.spx

and

speexenc --vbr --quality 10 --comp 4 --bitrate 131072 filename.wav filename2.spx

When I compared the filesize and the quality of both outputs, I cannot find the difference between the two, and hence it seems to me that with Speex - VBR mode -  only the "quality" feature matters, is it true? Is there anyway in which I can specify the maximum bitrate to be used in the case of VBR? And if there isn't what is the default maximum bitrate being used in this case? because I am pretty sure that with LAME, it is possible for people to actually set the maximum bitrate in the case of VBR.

Also if I want to give a fair (quality) comparison between CBR and ABR in this case let say for a bit rate of Z then would the following be appropriate:
For CBR part:
speexenc  --quality 10 --comp 4 --bitrate Z filename.wav filename3.spx

and for ABR part:
speexenc --quality 10 --comp 4 --abr Z filename.wav filename4.spx

Thank you very much for your time and help. I appreciate it very much .

Specifying maximum bit rate for Speex-VBR mode

Reply #1
Quote
Hi everyone,

I am currently trying to encode some files using Speex. I execute the following command lines in Speex:

speexenc --vbr --quality 10 --comp 4 --bitrate 24576 filename.wav filename.spx

and

speexenc --vbr --quality 10 --comp 4 --bitrate 131072 filename.wav filename2.spx

When I compared the filesize and the quality of both outputs, I cannot find the difference between the two, and hence it seems to me that with Speex - VBR mode -  only the "quality" feature matters, is it true? Is there anyway in which I can specify the maximum bitrate to be used in the case of VBR? And if there isn't what is the default maximum bitrate being used in this case? because I am pretty sure that with LAME, it is possible for people to actually set the maximum bitrate in the case of VBR.

Also if I want to give a fair (quality) comparison between CBR and ABR in this case let say for a bit rate of Z then would the following be appropriate:
For CBR part:
speexenc  --quality 10 --comp 4 --bitrate Z filename.wav filename3.spx

and for ABR part:
speexenc --quality 10 --comp 4 --abr Z filename.wav filename4.spx

Thank you very much for your time and help. I appreciate it very much .
[a href="index.php?act=findpost&pid=309754"][{POST_SNAPBACK}][/a]


The problem is you're using a whole bunch of mutually exclusive options. Speex can be controlled *either* by quality or by bit-rate. It's logical, you can't ask for maximum quality at minimum bit-rate. So, you either specify:
--quality <cbr quality>
--bitrate Z <cbr bitrate>
--vbr --quality <vbr quality>
--abr <vbr average bitrate>

Specifying maximum bit rate for Speex-VBR mode

Reply #2
Hi jmvalin,

Thank you very much for your help, that clears up some of the confusion that I have with Speex  . Just to make sure that I do the right thing, would the following comparison make more sense:

where Z is the same number in both case, if I want to compare between ABR and CBR then:

for CBR:
speexenc --comp 4 --bitrate Z filename.wav filename1.spx

for ABR:
speexenc --comp 4 --abr Z filename.wav filename2.spx

Once again thank you very much for your time. 

 

Specifying maximum bit rate for Speex-VBR mode

Reply #3
Quote
Hi jmvalin,

Thank you very much for your help, that clears up some of the confusion that I have with Speex   . Just to make sure that I do the right thing, would the following comparison make more sense:

where Z is the same number in both case, if I want to compare between ABR and CBR then:

for CBR:
speexenc --comp 4 --bitrate Z filename.wav filename1.spx

for ABR:
speexenc --comp 4 --abr Z filename.wav filename2.spx

Once again thank you very much for your time. 
[a href="index.php?act=findpost&pid=310106"][{POST_SNAPBACK}][/a]


It would make sense as long as the bit-rate Z you choose is available in CBR (otherwise, Speex takes the closest bit-rate below Z). Use -V to see what bit-rate is being used.

Specifying maximum bit rate for Speex-VBR mode

Reply #4
Hi jmvalin, Thank you for your kind help. I am currently doing my Uni project and hence your help meant a lot to me . There is another question I would like to ask, what is the maximum bitrate being used when we use ABR mode? Does it depend on the value that you set for the average bit rate? Because with LAME you can specify the maximum bitrate to be used during the encoding but whether or not it is possible using Speex.

Also I am very sorry, I am not too sure whether this should be put in another thread altogether but since it is related to my previous question so I thought putting it here would be fine.

The question that I have this time is still around the Speex ABR and CBR mode, by doing some experimentation I found some of the available bitrates available to the CBR mode are 24.6 kbps, 18 kbps, 15 kbps and 8 kbps (thanks to jmvalin for your guide in using -V). I have then tried to implement the same thing with the ABR mode and by setting the --abr feature to a certain value of Z, I have got a result of certain value of U (the average bitrate as obtained by using the -V feature) as follows:

Command line: speexenc --comp 4 --abr Z filename.wav filename2.spx
Z = 15000  ---->  U = 10677
Z = 18000  ---->  U = 10678
Z = 24000  ---->  U = 13544

Initially, before I start the experimentation I expect that the value of U would approximately be equal to or a bit less than the value of Z (based on what I have read on the documentation) since I use ABR, but based on these I do not think that my initial thought is correct.

Secondly, my current thought is that ABR, like VBR, allocates as little bits as possible to unimportant area such as silent area in the audio, no matter what value you put for Z, and thus even if Z is different (i.e. 15000 and 18000) if it is thought that the little amount of bits put for those unimportant areas would suffice then it will not allocate any more bits to these areas. On the other hand, in areas of significant importance, it would try to allocate as much bits as possible. But I still cannot think of why when Z is increased from 15000 to 18000 U only increase by 1 bit.

Thank you very much once again for your time and advises.

Specifying maximum bit rate for Speex-VBR mode

Reply #5
Quote
Secondly, my current thought is that ABR, like VBR, allocates as little bits as possible to unimportant area such as silent area in the audio, no matter what value you put for Z, and thus even if Z is different (i.e. 15000 and 18000) if it is thought that the little amount of bits put for those unimportant areas would suffice then it will not allocate any more bits to these areas. On the other hand, in areas of significant importance, it would try to allocate as much bits as possible. But I still cannot think of why when Z is increased from 15000 to 18000 U only increase by 1 bit.

Thank you very much once again for your time and advises.
[a href="index.php?act=findpost&pid=310670"][{POST_SNAPBACK}][/a]


Keep in mind that ABR does a long term average. If you encode several minutes of speech, then you'll likely see the average bit-rate being close to the target average. The max bit-rate for VBR/ABR/CBR are the same and equal to CBR quality 10.