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

Michel Bardiaux mbardiaux
Mon Apr 28 13:53:56 CEST 2008

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 
   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, its the latter that 
should fix things if the file is obviously corrupted (which this one 
is!). 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?)

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

> http://samples.mplayerhq.hu/A-codecs/msgsm/wernfried_1.avi

Ditto with 22050Hz.

> http://samples.mplayerhq.hu/A-codecs/GSM/sample-gsm-8000.gsm

This one cant be recognized:

[mp3 @ 0x843b514]Could not find codec parameters (Audio: mp2, 8 kb/s)
sample-gsm-8000.gsm: could not find codec parameters

What format is it?

> http://samples.mplayerhq.hu/A-codecs/GSM/sample-gsm-8000.mov

This one works for me:

ffmpeg -i sample-gsm-8000.mov -vn -acodec pcm_s16le sample-gsm-8000.mov.wav

produces a wav with correct sound.

> All of them produce no sound at all.

Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles

More information about the ffmpeg-devel mailing list