Unable to convert to GSM

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to convert to GSM

Aditya Satyavada
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 ?

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

kumowoon1025
>  subprocess output: b'  libavformat    58. 20.100 / 58. 20.100’

> subprocess output: b'  libavformat    56. 40.101 / 56. 40.101’

This is probably the more significant difference. Build a newer ffmpeg/update on the ubuntu side.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

Aditya Satyavada
A change of ffmpeg build (and OS in my case did the trick !).

The output was as shown here:

subprocess.call(['ffmpeg', '-y', '-f', 'mp3', '-i', '-', '-acodec', 'pcm_s16le', '-vn', '-f', 'wav', '-'])
subprocess.call(['ffmpeg', '-y', '-f', 'wav', '-i', '/tmp/tmp6v04vgug', '-b:a', '13k', '-ar', '8000', '-f', 'gsm', '/tmp/tmp3ii32s53'])
subprocess output: b'ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers'
subprocess output: b'  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516'
subprocess output: b"  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --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-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared"
subprocess output: b'  libavutil      55. 34.101 / 55. 34.101'
subprocess output: b'  libavcodec     57. 64.101 / 57. 64.101'
subprocess output: b'  libavformat    57. 56.101 / 57. 56.101'
subprocess output: b'  libavdevice    57.  1.100 / 57.  1.100'
subprocess output: b'  libavfilter     6. 65.100 /  6. 65.100'
subprocess output: b'  libavresample   3.  1.  0 /  3.  1.  0'
subprocess output: b'  libswscale      4.  2.100 /  4.  2.100'
subprocess output: b'  libswresample   2.  3.100 /  2.  3.100'
subprocess output: b'  libpostproc    54.  1.100 / 54.  1.100'
subprocess output: b'Guessed Channel Layout for Input Stream #0.0 : mono'
subprocess output: b"Input #0, wav, from '/tmp/tmp6v04vgug':"
subprocess output: b'  Duration: 00:00:01.46, bitrate: 353 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"Output #0, gsm, to '/tmp/tmp3ii32s53':"
subprocess output: b'  Metadata:'
subprocess output: b'    encoder         : Lavf57.56.101'
subprocess output: b'    Stream #0:0: Audio: gsm (libgsm), 8000 Hz, mono, s16, 13 kb/s'
subprocess output: b'    Metadata:'
subprocess output: b'      encoder         : Lavc57.64.101 libgsm'
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'size=       2kB time=00:00:01.48 bitrate=  13.2kbits/s speed= 447x'
subprocess output: b'video:0kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%'

libavformat version has indeed changed.

Although I’m honestly not sure how this affects what I was attempting to do.

Is it possible that the “Lavc57.64.101” encoder was missing. Because of which this was happening ?


> On 16-Feb-2019, at 2:05 PM, Ted Park <[hidden email]> wrote:
>
>> subprocess output: b'  libavformat    58. 20.100 / 58. 20.100’
>
>> subprocess output: b'  libavformat    56. 40.101 / 56. 40.101’
>
> This is probably the more significant difference. Build a newer ffmpeg/update on the ubuntu side.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

kumowoon1025
> libavformat version has indeed changed.
>
> Although I’m honestly not sure how this affects what I was attempting to do.
>
> Is it possible that the “Lavc57.64.101” encoder was missing. Because of which this was happening ?

Probably not, both outputs showed that ffmpeg was configured with —enable-libgsm. Before you updated, the output on your ubuntu machine was saying

> subprocess output: b"[NULL @ 0x17e3f20] Requested output format 'gsm' is not a suitable output format”

So I think we can assume gsm wasn’t a format that was implemented in avformat at that point.

By the way is that the version on apt?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

Aditya Satyavada
Yes.

All the versions you see here are from apt.

> On 16-Feb-2019, at 4:40 PM, Ted Park <[hidden email]> wrote:
>
>> libavformat version has indeed changed.
>>
>> Although I’m honestly not sure how this affects what I was attempting to do.
>>
>> Is it possible that the “Lavc57.64.101” encoder was missing. Because of which this was happening ?
>
> Probably not, both outputs showed that ffmpeg was configured with —enable-libgsm. Before you updated, the output on your ubuntu machine was saying
>
>> subprocess output: b"[NULL @ 0x17e3f20] Requested output format 'gsm' is not a suitable output format”
>
> So I think we can assume gsm wasn’t a format that was implemented in avformat at that point.
>
> By the way is that the version on apt?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

Moritz Barsnick
In reply to this post by kumowoon1025
On Sat, Feb 16, 2019 at 06:10:44 -0500, Ted Park wrote:

> So I think we can assume gsm wasn’t a format that was implemented in
> avformat at that point.

That's what ffmpeg did indeed complain about - the format (as given
with "-f gsm"), not the codec.

We can actually check that it wasn't implemented. It was introduced
with this commit which first went into ffmpeg 3.1:

https://github.com/FFmpeg/FFmpeg/commit/b0c026a27f9498b8f118684a2830ca7df7eae374

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Unable to convert to GSM

Carl Eugen Hoyos-2
In reply to this post by Aditya Satyavada
2019-02-16 9:17 GMT+01:00, Aditya Satyavada <[hidden email]>:

> The log for my local Mac is :

Please understand the the type of log you provided is not
appreciated.

> subprocess.call(['ffmpeg', '-y', '-f', 'mp3', '-i', '-'

If you have an mp3 sample that needs forcing the input
format, please provide it.

>, '-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',

The equivalent for "-f gsm" both with old and new versions
off FFmpeg is (always needs --enable-libgsm):
$ ffmpeg -i input -ar 8k -acodec gsm -f rawvideo -map 0:a:0 -b:a 13k
-ac 1 output.gsm

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".