You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here’s a template for a GitHub issue you can use to report the problem you’re facing with MoviePy when trying to read an audio file. You can fill in any additional details as needed.
Title: Error When Reading Audio File with MoviePy: IndexError. I would love a reply ASAP
Description
I'm encountering an issue when using MoviePy to read an audio file. Specifically, I receive an IndexError when trying to create an AudioFileClip when using the latest version of FFMPEG. It seems that the FFMPEG_AudioReader is failing to parse the audio file, leading to an empty list being returned, which subsequently causes the error.
Steps to Reproduce
Attempted to read an audio file using MoviePy in my Flask application:
frommoviepy.editorimportAudioFileClipdefgenerate_tiktok_video():
audio_clip=AudioFileClip("audio.mp3") # This line causes the error
Received the following error trace:
Traceback (most recent call last):
...
audio_clip = AudioFileClip("audio.mp3")
File "C:\Users\USER\Documents\Coding\sidehustles\Tweetflow\backend\env\Lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 70, in __init__
self.reader = FFMPEG_AudioReader(filename, fps=fps, nbytes=nbytes,
File "C:\Users\USER\Documents\Coding\sidehustles\Tweetflow\backend\env\Lib\site-packages\moviepy\audio\io\readers.py", line 51, in __init__
infos = ffmpeg_parse_infos(filename)
File "C:\Users\USER\Documents\Coding\sidehustles\Tweetflow\backend\env\Lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 269, in ffmpeg_parse_infos
if "No such file or directory" in lines[-1]:
IndexError: list index out of range
Expected Behavior
The AudioFileClip should successfully read the audio file and allow me to use it in my video generation process.
Actual Behavior
Instead of successfully loading the audio file, I encounter an IndexError, indicating that the parsing of the audio file has failed.
Additional Information
MoviePy Version: (Include your MoviePy version)
Python Version: (Include your Python version)
Operating System: (Include your OS)
FFmpeg Version: (If available, provide FFmpeg version)
Audio File Location: (Specify if the audio file path is absolute or relative)
A piece of my actual code
IMAGEMAGICK_BINARY=r"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe"FFMPEG_BINARY=r'C:\ffmpeg\bin\ffmpeg.exe'change_settings({
"IMAGEMAGICK_BINARY": IMAGEMAGICK_BINARY,
'FFMPEG_BINARY': FFMPEG_BINARY
})
data=request.get_json()
print(data)
# TikTok screen resolution (9:16 ratio)screen_width=1080screen_height=1920max_duration=60# Maximum duration for both video and audio in secondsoutput_filename="output.mp4"print('shit')
# Remove any previous video file with the same nameifos.path.exists(output_filename):
os.remove(output_filename)
# Generate audio from textgenerate_audio(data['text'])
print('generating audio')
# Load the generated audioaudio_clip=AudioFileClip("audio.mp3")
Attempts to Resolve
Verified that the audio file (audio.mp3) exists in the specified path.
Ensured that FFmpeg is correctly configured and accessible.
Attempted to read other audio files to see if the issue persists.
(Include any other troubleshooting steps you took)
My Opinion
I have some concerns regarding the maintenance and reliability of MoviePy:
Project Maintenance: The last commit on this repository was about five months ago. This raises concerns about whether the project is still actively maintained.
Critical Usage: I am using MoviePy in a SaaS project that has critical functionality. I cannot afford for it to break unexpectedly.
Error Encountered: I am experiencing a specific error when trying to read audio files using MoviePy. If anyone has encountered this issue before, I would appreciate guidance on how to resolve it.
Community Support: Is there an active community supporting this project? I want to know if I can rely on getting help and updates in the future.
Advice on Usage: Given the current situation, would you recommend that I continue using MoviePy, or should I consider alternatives?
Request
I would appreciate any guidance on how to resolve this issue. Thank you!.
The text was updated successfully, but these errors were encountered:
Here’s a template for a GitHub issue you can use to report the problem you’re facing with MoviePy when trying to read an audio file. You can fill in any additional details as needed.
Title: Error When Reading Audio File with MoviePy: IndexError. I would love a reply ASAP
Description
I'm encountering an issue when using MoviePy to read an audio file. Specifically, I receive an
IndexError
when trying to create anAudioFileClip
when using the latest version of FFMPEG. It seems that the FFMPEG_AudioReader is failing to parse the audio file, leading to an empty list being returned, which subsequently causes the error.Steps to Reproduce
Expected Behavior
The
AudioFileClip
should successfully read the audio file and allow me to use it in my video generation process.Actual Behavior
Instead of successfully loading the audio file, I encounter an
IndexError
, indicating that the parsing of the audio file has failed.Additional Information
A piece of my actual code
Attempts to Resolve
audio.mp3
) exists in the specified path.My Opinion
I have some concerns regarding the maintenance and reliability of MoviePy:
Project Maintenance: The last commit on this repository was about five months ago. This raises concerns about whether the project is still actively maintained.
Critical Usage: I am using MoviePy in a SaaS project that has critical functionality. I cannot afford for it to break unexpectedly.
Error Encountered: I am experiencing a specific error when trying to read audio files using MoviePy. If anyone has encountered this issue before, I would appreciate guidance on how to resolve it.
Community Support: Is there an active community supporting this project? I want to know if I can rely on getting help and updates in the future.
Advice on Usage: Given the current situation, would you recommend that I continue using MoviePy, or should I consider alternatives?
Request
I would appreciate any guidance on how to resolve this issue. Thank you!.
The text was updated successfully, but these errors were encountered: