[FFmpeg-devel] [PATCH]Support alaw in imkh files

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Apr 3 10:45:53 CEST 2015


On Thursday 02 April 2015 11:47:08 am Carl Eugen Hoyos wrote:
> > +        } else if (m->imkh_cctv && startcode == 0x1c0) {
> > +            codec_id = AV_CODEC_ID_PCM_ALAW;
>
> Maybe with "request_probe=50;" - the manual of one
> of the camera claims that MP2 is a possible audio
> codec.

New patch attached.

Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index a0b5738..6e5f004 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -547,6 +547,9 @@ redo:
             codec_id = AV_CODEC_ID_ADPCM_ADX;
             // Auto-detect AC-3
             request_probe = 50;
+        } else if (m->imkh_cctv && startcode == 0x1c0) {
+            codec_id = AV_CODEC_ID_PCM_ALAW;
+            request_probe = 50;
         } else {
             codec_id = AV_CODEC_ID_MP2;
         }
@@ -591,7 +594,8 @@ skip:
     st->id                = startcode;
     st->codec->codec_type = type;
     st->codec->codec_id   = codec_id;
-    if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
+    if (   st->codec->codec_id == AV_CODEC_ID_PCM_MULAW
+        || st->codec->codec_id == AV_CODEC_ID_PCM_ALAW) {
         st->codec->channels = 1;
         st->codec->channel_layout = AV_CH_LAYOUT_MONO;
         st->codec->sample_rate = 8000;


More information about the ffmpeg-devel mailing list