Skip to content Skip to sidebar Skip to footer

Error When Exporting With Pydub - How To Install Mp3 Codecs For Pydub?

Im using this library for first time so Im not sure if this is a bug or Im not correctly doing something. I want to export a file into mp3, the loading works perfectly: wav=AudioSe

Solution 1:

I think it's unable to find the ffmpeg binary. Python has wave support built in, so pydub doesn't require ffmpeg to open/close/modify wave files.

Try assigning the location of the ffmpeg binary before you use it like so:

from pydub import AudioSegment
AudioSegment.converter = "c:\ffmpeg\bin\ffmpeg.exe"

wav = AudioSegment.from_wav(Path)  #If I execute only this line, there are no errors.
wav.export(r"WavOut.mp3",format="mp3")

edit: We've change changed the name of the property from AudioSegment.ffmpeg to AudioSegment.converter because we now support both ffmpeg and avconv.

Please check which your version uses before assigning to this property (it's "converter" starting in the 0.9.0 release)

Post a Comment for "Error When Exporting With Pydub - How To Install Mp3 Codecs For Pydub?"