CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
See original GitHub issueI’m having trouble getting pydub to work. The error message is listed below.
I’ve reported the issue in detail on StackOverflow: here.
I think this is an issue with ffmpeg, but honestly, I cant tell whether avlib or ffmpeg are running here.
Is there a way to determine which library is being used?
In[5]: pydub.AudioSegment.from_file(".../sensorlog_2017-02-03_12-50-25-345_Dev26c5_Loc27_TypeAUDIO.m4a", "aac")
Traceback (most recent call last):
File "...anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-5-607e3f2a62c3>", line 1, in <module>
pydub.AudioSegment.from_file(".../sensorlog_2017-02-03_12-50-25-345_Dev26c5_Loc27_ActvEatingAT-DrinkingAT_TypeAUDIO.m4a", "aac")
File ".../anaconda2/lib/python2.7/site-packages/pydub/audio_segment.py", line 472, in from_file
raise CouldntDecodeError("Decoding failed. ffmpeg returned error code: {0}\n\nOutput from ffmpeg/avlib:\n\n{1}".format(p.returncode, p_err))
CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
Output from ffmpeg/avlib:
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
[aac @ 0x7f8485002e00] channel element 3.14 is not allocated
[aac @ 0x7f8485002e00] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f8485002e00] decode_pce: Input buffer exhausted before END element found
[aac @ 0x7f8485002e00] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f8485002e00] channel element 2.9 is not allocated
[aac @ 0x7f8485002200] decoding for stream 0 failed
[aac @ 0x7f8485002200] Estimating duration from bitrate, this may be inaccurate
[aac @ 0x7f8485002200] Could not find codec parameters for stream 0 (Audio: aac (LC), 4.0, fltp, 213 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, aac, from '/var/folders/cm/1r6x6rbj7hn_51qvfjzj7nx80000gn/T/tmpZyPq5d':
Duration: 00:00:00.57, bitrate: 213 kb/s
Stream #0:0: Audio: aac (LC), 4.0, fltp, 213 kb/s
[abuffer @ 0x7f8484d01480] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
Last message repeated 3 times
[abuffer @ 0x7f8484d01480] Error setting option time_base to value 1/0.
[graph 0 input from stream 0:0 @ 0x7f8484d01580] Error applying options to the filter.
Error opening filters!
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
CouldntDecodeError: Decoding failed. ffmpeg returned ...
I am using python= 3.9 , pydub=0.25.1 , audiosegment=0.23.0 . Thanks in advance for the help. Below is the error shown on the...
Read more >Decoding failed. ffmpeg returned error code: 1 : r/learnpython
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1. This code works on a 30 second wav file but not on a 10 ...
Read more >How to use the pydub.exceptions.CouldntDecodeError ...
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... 0: raise CouldntDecodeError( "Decoding failed....
Read more >Decoding failed. ffmpeg returned error code: 69
1 , audiosegment=0.23.0 . Thanks in advance for the help. Below is the error shown on the console. CouldntDecodeError Traceback (most recent call...
Read more >Python报错-pydub.exceptions.CouldntDecodeError ...
Python报错-pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1. zkw_1998 于 2020-04-27 10:18:06 发布 2975 收藏.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You can manually assign to
AudioSegment.converterthe path to the binary if you like:Also… I was able to decode your file using “mp4” as the format:
the file does seem to contain AAC audio, but the container format is mpeg4
Okay, nevermind. Although the project default interpreter had been set properly, the run configuration has overridden the default setting and was using a completely different Python 2.7 instance. Sigh. Well, I learned more about python source and module directories. Thanks again!