Speex in ffmpeg (was RE: [Ffmpeg-devel] Speex proposed addition to ffmpeg and suggestions)

Dario Andrade dario
Tue Jun 28 08:21:12 CEST 2005


Michael,

> 
> Could you please repost this as a 'cvs diff -du', *attached*? Also, some
> usage eaxmples; esp. when using -acodec speex, what format (ogg?) and
> what are recommended or mandatory parameters, like sample rate, is
> stereo allowed, range of bitrates,...
> 

As requested.

------------------------------------------------------------------
Files:

libavformat/wav.c
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/Makefile (only needed to add the speex.c in build)

------------------------------------------------------------------
Options:

avctx->sample_rate: 6khz up to 48khz (8, 16 or 32khz is preferred).

avctx->channels: 1 or 2

avctx->bitrate: set by user when vbr mode is enabled (up to 44kbps),
otherwise returned by speex (since it depends on global_quality).

avctx->flags: CODEC_FLAG_QSCALE (vbr mode)

avctx->rc_max_rate: when set, max rate for abr mode (average), only when vbr
is enabled.

avctx->flags2: 
CODEC_FLAG2_AUDIO_CNG (encoder, always in vbr)
CODEC_FLAG2_AUDIO_DTX (encoder, only if vbr or cng is enabled)
CODEC_FLAG2_AUDIO_PREPROC_VAD (encoder),
CODEC_FLAG2_AUDIO_PREPROC_DENOISE (encoder)
CODEC_FLAG2_AUDIO_PREPROC_AGC (encoder)
CODEC_FLAG2_AUDIO_ENH (decoder)

avctx->level: when agc is enabled, controls the avarage peak for
amplification (default is 8000 out of 32768).

avctx->global_quality: 0 to 9
------------------------------------------------------------------


Note 1: There are a few minor changes in my local code (old opts.c is still
there..., makefile has some special rules, etc...).

Note 2: As previously said, with latest cvs (06/28/2005), ffmpeg.c does not
allow one to encode speex in .wav files anymore (perhaps a bug?).
That seems to be a recent change in cvs tree, since my whole development on
speex.c depended on testing with ffmpeg.c utility. Anyway, the API will
still work for encoding/decoding speex.


If someone is interested in fixing the wrapping in wav files, that will be
great.
Or if someone wants to provide wrapping for speex in ogg, so it can be
archived, seeked, etc..., that could be a good idea also.


Cheers,
Dario Andrade
IP.TV

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wav.c.1.51.diff
Type: application/octet-stream
Size: 435 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050628/970d4097/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allcodecs.c.1.107.diff
Type: application/octet-stream
Size: 602 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050628/970d4097/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.1.195.diff
Type: application/octet-stream
Size: 4331 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050628/970d4097/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avcodec.h.1.404.diff
Type: application/octet-stream
Size: 2052 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050628/970d4097/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speex.c
Type: application/octet-stream
Size: 15611 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050628/970d4097/attachment-0004.obj>



More information about the ffmpeg-devel mailing list