[FFmpeg-user] Unable to convert to GSM

Aditya Satyavada aditya at vernacular.ai
Sat Feb 16 10:17:29 EET 2019


Hey Everyone,

I’m trying to normalise a file and then convert it to GSM.
It works on my local Mac but doesn’t work in ab Ubuntu machine that I’m trying to make it work on.

The log for my local Mac is :

subprocess.call(['ffmpeg', '-y', '-f', 'mp3', '-i', '-', '-acodec', 'pcm_s16le', '-vn', '-f', 'wav', '-'])
subprocess.call(['ffmpeg', '-y', '-f', 'wav', '-i', '/var/folders/6x/x6yx59qx2z5gw_m6gvjvhd9h0000gn/T/tmpev7c6so_', '-b:a', '13k', '-ar', '8000', '-write_xing', '0', '-f', 'gsm', '/var/folders/6x/x6yx59qx2z5gw_m6gvjvhd9h0000gn/T/tmpgmpzx20_'])
subprocess output: b'ffmpeg version 4.1-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers'
subprocess output: b'  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)'
subprocess output: b'  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay'
subprocess output: b'  libavutil      56. 22.100 / 56. 22.100'
subprocess output: b'  libavcodec     58. 35.100 / 58. 35.100'
subprocess output: b'  libavformat    58. 20.100 / 58. 20.100'
subprocess output: b'  libavdevice    58.  5.100 / 58.  5.100'
subprocess output: b'  libavfilter     7. 40.101 /  7. 40.101'
subprocess output: b'  libswscale      5.  3.100 /  5.  3.100'
subprocess output: b'  libswresample   3.  3.100 /  3.  3.100'
subprocess output: b'  libpostproc    55.  3.100 / 55.  3.100'
subprocess output: b'Guessed Channel Layout for Input Stream #0.0 : mono'
subprocess output: b"Input #0, wav, from '/var/folders/6x/x6yx59qx2z5gw_m6gvjvhd9h0000gn/T/tmpev7c6so_':"
subprocess output: b'  Duration: 00:00:08.75, bitrate: 352 kb/s'
subprocess output: b'    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s'
subprocess output: b'Stream mapping:'
subprocess output: b'  Stream #0:0 -> #0:0 (pcm_s16le (native) -> gsm (libgsm))'
subprocess output: b'Press [q] to stop, [?] for help'
subprocess output: b"Output #0, gsm, to '/var/folders/6x/x6yx59qx2z5gw_m6gvjvhd9h0000gn/T/tmpgmpzx20_':"
subprocess output: b'  Metadata:'
subprocess output: b'    encoder         : Lavf58.20.100'
subprocess output: b'    Stream #0:0: Audio: gsm (libgsm), 8000 Hz, mono, s16, 13 kb/s'
subprocess output: b'    Metadata:'
subprocess output: b'      encoder         : Lavc58.35.100 libgsm'
subprocess output: b'size=      14kB time=00:00:08.76 bitrate=  13.2kbits/s speed= 444x'
subprocess output: b'video:0kB audio:14kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%’


The log for my ubuntu machine is :

subprocess.call(['ffmpeg', '-y', '-f', 'mp3', '-i', '-', '-acodec', 'pcm_s16le', '-vn', '-f', 'wav', '-'])
subprocess.call(['ffmpeg', '-y', '-f', 'wav', '-i', '/tmp/tmpg6rcu6qp', '-b:a', '13k', '-ar', '8000', '-f', 'gsm', '/tmp/tmph61ej2yl'])
subprocess output: b'ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers'
subprocess output: b'  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609'
subprocess output: b'  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv'
subprocess output: b'  libavutil      54. 31.100 / 54. 31.100'
subprocess output: b'  libavcodec     56. 60.100 / 56. 60.100'
subprocess output: b'  libavformat    56. 40.101 / 56. 40.101'
subprocess output: b'  libavdevice    56.  4.100 / 56.  4.100'
subprocess output: b'  libavfilter     5. 40.101 /  5. 40.101'
subprocess output: b'  libavresample   2.  1.  0 /  2.  1.  0'
subprocess output: b'  libswscale      3.  1.101 /  3.  1.101'
subprocess output: b'  libswresample   1.  2.101 /  1.  2.101'
subprocess output: b'  libpostproc    53.  3.100 / 53.  3.100'
subprocess output: b'Guessed Channel Layout for  Input Stream #0.0 : mono'
subprocess output: b"Input #0, wav, from '/tmp/tmpg6rcu6qp':"
subprocess output: b'  Duration: 00:00:08.75, bitrate: 352 kb/s'
subprocess output: b'    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s'
subprocess output: b"[NULL @ 0x17e3f20] Requested output format 'gsm' is not a suitable output format"
subprocess output: b'/tmp/tmph61ej2yl: Invalid argument’


The part where things differ is when:

Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s <— On Mac
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s <— On Ubuntu

Any tips on how to solve this ?



More information about the ffmpeg-user mailing list