[FFmpeg-cvslog] flv: add support for G.711
Damien Fetis
git at videolan.org
Fri Jun 29 00:01:52 CEST 2012
ffmpeg | branch: master | Damien Fetis <damien.fetis at altervoice.com> | Thu Jun 28 16:28:56 2012 +0200| [b92c7ee662b618518bff366af3274784fb141dde] | committer: Luca Barbato
flv: add support for G.711
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b92c7ee662b618518bff366af3274784fb141dde
---
libavformat/flv.h | 2 ++
libavformat/flvdec.c | 8 ++++++++
libavformat/flvenc.c | 8 ++++++++
3 files changed, 18 insertions(+)
diff --git a/libavformat/flv.h b/libavformat/flv.h
index 6418b27..fe0fc90 100644
--- a/libavformat/flv.h
+++ b/libavformat/flv.h
@@ -82,6 +82,8 @@ enum {
FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_NELLYMOSER = 6 << FLV_AUDIO_CODECID_OFFSET,
+ FLV_CODECID_PCM_ALAW = 7 << FLV_AUDIO_CODECID_OFFSET,
+ FLV_CODECID_PCM_MULAW = 8 << FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_AAC = 10<< FLV_AUDIO_CODECID_OFFSET,
FLV_CODECID_SPEEX = 11<< FLV_AUDIO_CODECID_OFFSET,
};
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 8e9759b..078c2a2 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -108,6 +108,14 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, AVCodecCo
case FLV_CODECID_NELLYMOSER:
acodec->codec_id = CODEC_ID_NELLYMOSER;
break;
+ case FLV_CODECID_PCM_MULAW:
+ acodec->sample_rate = 8000;
+ acodec->codec_id = CODEC_ID_PCM_MULAW;
+ break;
+ case FLV_CODECID_PCM_ALAW:
+ acodec->sample_rate = 8000;
+ acodec->codec_id = CODEC_ID_PCM_ALAW;
+ break;
default:
av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flv_codecid >> FLV_AUDIO_CODECID_OFFSET);
acodec->codec_tag = flv_codecid >> FLV_AUDIO_CODECID_OFFSET;
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 3caa6de..d77507d 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -48,6 +48,8 @@ static const AVCodecTag flv_audio_codec_ids[] = {
{ CODEC_ID_ADPCM_SWF, FLV_CODECID_ADPCM >> FLV_AUDIO_CODECID_OFFSET },
{ CODEC_ID_AAC, FLV_CODECID_AAC >> FLV_AUDIO_CODECID_OFFSET },
{ CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET },
+ { CODEC_ID_PCM_MULAW, FLV_CODECID_PCM_MULAW >> FLV_AUDIO_CODECID_OFFSET },
+ { CODEC_ID_PCM_ALAW, FLV_CODECID_PCM_ALAW >> FLV_AUDIO_CODECID_OFFSET },
{ CODEC_ID_SPEEX, FLV_CODECID_SPEEX >> FLV_AUDIO_CODECID_OFFSET },
{ CODEC_ID_NONE, 0 }
};
@@ -136,6 +138,12 @@ static int get_audio_flags(AVFormatContext *s, AVCodecContext *enc)
else
flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
break;
+ case CODEC_ID_PCM_MULAW:
+ flags = FLV_CODECID_PCM_MULAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
+ break;
+ case CODEC_ID_PCM_ALAW:
+ flags = FLV_CODECID_PCM_ALAW | FLV_SAMPLERATE_SPECIAL | FLV_SAMPLESSIZE_16BIT;
+ break;
case 0:
flags |= enc->codec_tag << 4;
break;
More information about the ffmpeg-cvslog
mailing list