Page 1 of 1

Greater control over the speex codec when encoding

Posted: 09 Sep 2007 22:29
by Nil Einne
Currently there is nearly no control over the speex codec. It only supports narrowband and is hard coded to a quality level of 8 from my own tests and a look at the source (including SVN 0909). There is therefore no real way to change the bitrate or anything (ab does nothing). I would like greater control of the codec. In particular

Most needed options IMHO
  • Quality (currently hardcoded at 8 in the VLC sources, affects the target quality and therefore bitrate in VBR and CBR. I'm pretty sure this would be very easy to implement from what I can tell the everything is in VLC you just need to make a hardcoded value into a variable you can specify)
  • Complexity (I think this is defaulted to 3 as in libspeex and there is no way to specify it, greater CPU usage but potentially higher quality at the same bitrate)
  • Sampling rate (Speex supports narrowband 8000hz, wideband 16000hz and ultra-wideband 32000hz. It's not simply a matter of converting to the right sample rate, each is a different mode. Currently only narrowband is supported you can throw whatever you want at it e.g. 48000hz, 32000hz, 8000hz it will still encode is as narrowband. 32000hz at narrowband is very large)
  • VBR (I thought the codec was using VBR but I checked the output file with the Speex command line decoder and it's definitely CBR. The sources mention VBR so I think it should be fairly easy to add you just need allow people to pass the option on I guess)
  • VBR-max-bitrate (Not mentioned in the docs but supported by the latest Speex beta. Don't know when it was added.)
These options are not so important (to me anyway) but would likely be useful for many users of VLC
  • ABR (Not as useful as VBR IMHO)
Although primarily intended for VOIP, these would be interesting but aren't really that important
  • VAD (Voice Activity Detection, enabled by default with VBR)
  • DTX (Discontinuous Transmission)
  • Denoise (Not clear in the docs but these are an options in the command line encoder. Admitedly I don't know if it's optimised for Speex or a general VLC filter would work better)
  • AGC (Automatic gain control, per above)
Somewhat unrelated but also
  • Warnings when you encode with a samplerate unsuitable for the whatever mode you selected
For more info on what I'm talking about see the Speex docs. http://www.speex.org/docs/manual/speex- ... node4.html & http://www.speex.org/docs/manual/speex- ... node6.html

Thanks devs!

P.S. I'm don't know much about programming which is why I can't add any of these myself unfortunately
P.P.S. I've tried the Speex command line encoder as well so I'm pretty confident about the sampling rate part

Re: Greater control over the speex codec when encoding

Posted: 06 Sep 2008 13:02
by Nil Einne
Any chance for work on this? (Forgive me if there has been, I looked through the snapshot sources and it still looks the same)

Re: Greater control over the speex codec when encoding

Posted: 07 Sep 2008 11:13
by VLC_help
Opening a trac feature request might speed things up (or not).
http://trac.videolan.org/vlc

Re: Greater control over the speex codec when encoding

Posted: 08 Sep 2008 19:40
by fenrir
I have implemented it in master git commit ecd28675c2d6c79f9de8a327c8a75a437f09f74a.

edit by j-b: linked