Skip to content
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

bug: while creating audio asset, IndexError: list index out of range #84

Open
sebbourgeois opened this issue May 17, 2023 · 0 comments
Open

Comments

@sebbourgeois
Copy link
Contributor

Related subreddit : https://www.reddit.com/r/AskReddit/comments/13i9ark/what_television_series_had_the_biggest_bullshit/

Error :

Traceback (most recent call last):
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 340, in ffmpeg_parse_infos
    line = [l for l in lines if "Duration:" in l][-1]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sb/videos-creation/python-reddit-youtube-bot/app.py", line 369, in <module>
    process_submissions(submissions)
  File "/home/sb/videos-creation/python-reddit-youtube-bot/app.py", line 64, in process_submissions
    process_submission(submission)
  File "/home/sb/videos-creation/python-reddit-youtube-bot/app.py", line 115, in process_submission
    vid.create(
  File "/home/sb/videos-creation/python-reddit-youtube-bot/video_generation/video.py", line 492, in create
    audioclip: AudioFileClip = AudioFileClip(audio_filepath)
  File "<decorator-gen-48>", line 2, in __init__
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/decorators.py", line 89, in wrapper
    return f(*new_a, **new_kw)
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/audio/io/AudioFileClip.py", line 75, in __init__
    self.reader = FFMPEG_AudioReader(
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/audio/io/readers.py", line 60, in __init__
    infos = ffmpeg_parse_infos(filename, decode_file=decode_file)
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 344, in ffmpeg_parse_infos
    raise IOError(
OSError: MoviePy error: failed to read the duration of file assets/work_dir/13i9ark/jk910xv.mp3.
Here are the file infos returned by ffmpeg:

ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[mp3 @ 0x60aa400] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0x60aa400] Failed to read frame size: Could not seek to 1026.
assets/work_dir/13i9ark/jk910xv.mp3: Invalid argument

Exception ignored in: <function FFMPEG_AudioReader.__del__ at 0x7fc488527010>
Traceback (most recent call last):
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/audio/io/readers.py", line 269, in __del__
    self.close()
  File "/home/sb/videos-creation/python-reddit-youtube-bot/env/lib/python3.10/site-packages/moviepy/audio/io/readers.py", line 260, in close
    if self.proc:
AttributeError: 'FFMPEG_AudioReader' object has no attribute 'proc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant