[FFmpeg-devel] [PATCH] GSM-MS decoder and encoder

Michael Niedermayer michaelni
Mon Apr 28 16:28:47 CEST 2008


On Mon, Apr 28, 2008 at 01:53:56PM +0200, Michel Bardiaux wrote:
> Diego Biurrun wrote:
> > On Fri, Apr 25, 2008 at 12:10:06PM +0200, Michel Bardiaux wrote:
> >> [...]
> > 
> > While you guys are at it, there are still a couple of samples that do
> > not work in ffplay:
> > 
> > http://samples.mplayerhq.hu/A-codecs/msgsm/levis.avi
> 
> ffmpeg -i levis.avi -vn -acodec pcm_s16le -y levis.avi.wav
> FFmpeg version SVN-r13009, Copyright (c) 2000-2008 Fabrice Bellard, et al.
>    configuration: --enable-libmp3lame --enable-gpl --enable-x11grab 
> --enable-libgsm
>    libavutil version: 49.6.0
>    libavcodec version: 51.56.0
>    libavformat version: 52.13.0
>    libavdevice version: 52.0.0
>    built on Apr 28 2008 12:14:17, gcc: 4.1.2 20061115 (prerelease) 
> (Debian 4.1.1-21)
> Input #0, avi, from 'levis.avi':
>    Duration: 00:00:44.83, start: 0.000000, bitrate: 352 kb/s
>      Stream #0.0: Video: indeo3, yuv410p, 152x116,  6.00 tb(r)
>      Stream #0.1: Audio: libgsm_ms, 44100 Hz, mono, 71 kb/s
> Output #0, wav, to 'levis.avi.wav':
>      Stream #0.0: Audio: pcm_s16le, 44100 Hz, mono, 705 kb/s
> Stream mapping:
>    Stream #0.1 -> #0.0
> [libgsm_ms @ 0x8451ff0]Sample rate 8000Hz required for GSM, got 44100Hz
> Error while opening codec for input stream #0.1
> 
> IMHO the codec should not second-guess the demuxer, 

but libgsm.c does exactly that ...


> its the latter that 
> should fix things if the file is obviously corrupted (which this one 
> is!). 

I see nothing corrupt on the file


> That is, at the end of get_wav_header (proper patch when there is 
> agreement of the ways and means). Theoretically there is no maintainer 
> for riff.c but since Michael is maintainer for the avi muxdemux I guess 
> he is for riff.c too (should I correct MAINTAINERS?)

Yes i mainain riff.c, feel free to add me to the list if you like ...


> 
> And whether the demuxer or the codec changes the sample rate, a warning 
> should be issued. OK?

Print as many warnings as you like :)
but please dont reject streams at random, patch below fixes this file and
i suspect others as well, i will apply it in 24h unless you object.

Index: libgsm.c
===================================================================
--- libgsm.c	(revision 13005)
+++ libgsm.c	(working copy)
@@ -41,18 +41,6 @@
                avctx->channels);
         return -1;
     }
-    if (avctx->sample_rate != 8000) {
-        av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
-               avctx->sample_rate);
-        return -1;
-    }
-    if (avctx->bit_rate != 13000 /* Official */ &&
-        avctx->bit_rate != 13200 /* Very common */ &&
-        avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) {
-        av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n",
-               avctx->bit_rate);
-        return -1;
-    }
 
     avctx->priv_data = gsm_create();
 

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080428/a6dc0c84/attachment.pgp>



More information about the ffmpeg-devel mailing list