-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown encoder 'pcm_s8le' #308
Comments
fix issue #308: now uses right acodec for 8bit audio
Hello, I ran into a issue with this update where it only works for mono wav files, I tried to use from wav with a stereo file and got a CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1. Here is the file info for my stereo wave file: avprobe version 9.20-6:9.20-0ubuntu0.14.04.1, Copyright (c) 2007-2014 the Libav developers avprobe output[format] [streams.stream.0] This file would try to decode for pcm_s8 when i would actually need pcm_s16le. I added a work around in for my project where the bits_per_sample gets update before the check based on the number of channels 678 channels = audio_streams[0]['channels'] Let me know if this doesn't make any sense or if you have any questions. |
Steps to reproduce
File "myconverter.py", line 120, in process
audio = AudioSegment.from_wav(filepath_wav)
File "/usr/local/lib/python2.7/dist-packages/pydub/audio_segment.py", line 719, in from_wav
return cls.from_file(file, 'wav', parameters)
File "/usr/local/lib/python2.7/dist-packages/pydub/audio_segment.py", line 695, in from_file
p.returncode, p_err))
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
Output from ffmpeg/avlib:
..............................................................................
Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from './pdf/vmessages/2018-08-20 17:44:25_034_Outside Caller 08-20-18 13h44.WAV':
Duration: 00:00:17.31, bitrate: 64 kb/s
Stream #0:0: Audio: pcm_mulaw ([7][0][0][0] / 0x0007), 8000 Hz, 1 channels, s16, 64 kb/s Unknown encoder 'pcm_s8le'
Expected behavior
I'm attempting to convert a voicemail audio file to another format. This stopped working some time last week (8/13-8/17).
Actual behavior
Line 672 in audio_segment.py (acodec = 'pcm_s%dle' % bits_per_sample) uses 8 bits per sample, which then passes "-acodec pcm_s8le" to ffmpeg, which is an unsupported encoder per "ffmpeg -encoders".
Your System configuration
Is there an audio file you can include to help us reproduce?
VM-Extension 229 08-20-18 15h40.zip
The text was updated successfully, but these errors were encountered: