Initially the code below worked well. But once, during execution of the code i stopped the execution. Then, it constantly shows 'Decoding failed. ffmpeg returned error code:1'. My OS is linux mint.
What i've tried:
- Reinstalled pydub
- Tried solving the problem by creating new virtual environment
- Reinstalled ffmpeg
Code:
for i in range(0,18,2):
t1 = i *1000 #in milisecond
t2 = (i+2)*1000
newAudio = AudioSegment.from_mp3("3b1b.mp3")
newAudio = newAudio[t1:t2]
newAudio.export("bike/"+str(count)+ '.mp3', format="wav")
count +=1
print(count)
Error looks like:
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
Output from ffmpeg/avlib:
b'ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the
FFmpeg developers\n built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)\n
configuration: --prefix=/usr --extra-version=0ub