Hey there, I'm trying to convert some call recordings from asterisk we have in .gsm format to something I can pipe through ffmpeg - wav would be good, mp3 would be amazing! I've been trying playing with sox but I don't seem to be getting too far with 1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample as ffmpeg borks at it: tim at freee-meee:~/dmc/call recordings$ ffmpeg -i 1239101491.30.conv.wav 1239101491.30.conv.mp3 FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static libavutil version: 49.6.0 libavcodec version: 51.50.0 libavformat version: 52.7.0 libavdevice version: 52.0.0 built on Mar 13 2009 17:48:10, gcc: 4.3.2 Input #0, wav, from '1239101491.30.conv.wav': Duration: 00:00:06.7, bitrate: 1040 kb/s Stream #0.0: Audio: libgsm_ms, 640000 Hz, mono, 1040 kb/s File '1239101491.30.conv.mp3' already exists. Overwrite ? [y/N] y Output #0, mp2, to '1239101491.30.conv.mp3': Stream #0.0: Audio: mp2, 640000 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 [mp2 @ 0xb7d352f0]Sampling rate 640000 is not allowed in mp2 Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height tim at freee-meee:~/dmc/call recordings$ Has anyone got any suggestions based on previous experience? tdobson.net ---- If each of us have one object, and we exchange them, then each of us still has one object. If each of us have one idea, and we exchange them, then each of us now has two ideas. - George Bernard Shaw
On Tue, Apr 14, 2009 at 7:39 AM, Tim Dobson <lists at tdobson.net> wrote:> I'm trying to convert some call recordings from asterisk we have in .gsmWhy not use sox for this purpose? sox mygsm.gsm -r 8000 -c 1 mywave.wav resample -ql Once it's a wav you can mp3 it with lame or your preferred encoder, but encoding and playing mp3s takes more cpu than just playing it in gsm, or stopping after sox and playing as a wav.> Has anyone got any suggestions based on previous experience?My previous experience is to just use sox. It works, it's free, it does what it says it does. What makes ffmpeg so special?
Arjan Kroon | Mobillion
2009-Apr-14 12:35 UTC
[asterisk-users] .GSM -> .WAV (or ,MP3) Conversion
Hey, I record the message in ULAW exten => s,1,Record(${A_record}:ulaw,0,60) After that I call sox with this command: /usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1 $wav_fl Regards, Arjan Kroon Mobillion BV -----Oorspronkelijk bericht----- Van: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] Namens Tim Dobson Verzonden: 14-04-2009 13:39 Aan: asterisk-users at lists.digium.com Onderwerp: [asterisk-users] .GSM -> .WAV (or ,MP3) Conversion Hey there, I'm trying to convert some call recordings from asterisk we have in .gsm format to something I can pipe through ffmpeg - wav would be good, mp3 would be amazing! I've been trying playing with sox but I don't seem to be getting too far with 1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample as ffmpeg borks at it: tim at freee-meee:~/dmc/call recordings$ ffmpeg -i 1239101491.30.conv.wav 1239101491.30.conv.mp3 FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static libavutil version: 49.6.0 libavcodec version: 51.50.0 libavformat version: 52.7.0 libavdevice version: 52.0.0 built on Mar 13 2009 17:48:10, gcc: 4.3.2 Input #0, wav, from '1239101491.30.conv.wav': Duration: 00:00:06.7, bitrate: 1040 kb/s Stream #0.0: Audio: libgsm_ms, 640000 Hz, mono, 1040 kb/s File '1239101491.30.conv.mp3' already exists. Overwrite ? [y/N] y Output #0, mp2, to '1239101491.30.conv.mp3': Stream #0.0: Audio: mp2, 640000 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 [mp2 @ 0xb7d352f0]Sampling rate 640000 is not allowed in mp2 Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height tim at freee-meee:~/dmc/call recordings$ Has anyone got any suggestions based on previous experience? tdobson.net ---- If each of us have one object, and we exchange them, then each of us still has one object. If each of us have one idea, and we exchange them, then each of us now has two ideas. - George Bernard Shaw _______________________________________________ -- Bandwidth and Colocation Provided by api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: lists.digium.com/mailman/listinfo/asterisk-users
On Tue, 14 Apr 2009, Arjan Kroon | Mobillion wrote:> I record the message in ULAW > > After that I call sox with this command: > /usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1 > $wav_flWhat are "-1" and "-2" for? Both sox 12.17.5 and 12.18.1 say they are invalid. Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
In sox 14.0.1 the -1 is a one byte sample, -2 is a two byte sample, therefore the command is sampling one-in, two-out. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Steve Edwards Sent: Tuesday, April 14, 2009 9:08 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] .GSM -> .WAV (or ,MP3) Conversion On Tue, 14 Apr 2009, Arjan Kroon | Mobillion wrote:> I record the message in ULAW > > After that I call sox with this command: > /usr/bin/sox -c 1 -1 -t ul -r 8000 $in_fl -t wav -2 -r 8000 -c 1 > $wav_flWhat are "-1" and "-2" for? Both sox 12.17.5 and 12.18.1 say they are invalid. Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 _______________________________________________ -- Bandwidth and Colocation Provided by api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: lists.digium.com/mailman/listinfo/asterisk-users
Tim Dobson wrote:> 1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample > as ffmpeg borks at it:Gah I meant sox 1239101491.30.gsm -ql -r 64000 -t wav 1239101491.30.conv.wav resample -- Thanks everyone! Really appreciate it - all the documentation via google is to convert *to* gsm... nothing says anything about *from* it! Cheers! Tim -- tdobson.net ---- If each of us have one object, and we exchange them, then each of us still has one object. If each of us have one idea, and we exchange them, then each of us now has two ideas. - George Bernard Shaw