Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.56k stars 1.57k forks source link

moviepy -- At least one output file must be specified #1860

Open bengabp opened 2 years ago

bengabp commented 2 years ago

I am trying to apply text overlay on video using moviepy. There are 2 possible sources of the video, either a video upload or a capture . The idea is to handle video input in the frontend then call a python api to process the video and add text using moviepy. I am not using opencv because i also care about the audio since opencv will only load video. When i try this on image uploaded from the users gallery, everything works well . but if i try this with video recorded with Javascript MediaStream browser api, this error shows in moviepy

Traceback (most recent call last):
  File "/home/bengab/.local/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 286, in ffmpeg_parse_infos
    match = re.findall("([0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9])", line)[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bengab/Remote Jobs Files/Weperch/moviepy_test/main.py", line 16, in <module>
    g = generate_watermark_video("house","$500","/home/bengab/Remote Jobs Files/Weperch/Watermark Video/upload_videos_dir/aea7d48358ed4ef99ceea98a46b1f1a7.webm","pvid.mp4")
  File "/home/bengab/Remote Jobs Files/Weperch/moviepy_test/main.py", line 5, in generate_watermark_video
    with VideoFileClip(original_video_path) as video_clip:
  File "/home/bengab/.local/lib/python3.10/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__
    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
  File "/home/bengab/.local/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
  File "/home/bengab/.local/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 289, in ffmpeg_parse_infos
    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"
OSError: MoviePy error: failed to read the duration of file /home/bengab/Remote Jobs Files/Weperch/Watermark Video/upload_videos_dir/aea7d48358ed4ef99ceea98a46b1f1a7.webm.
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
Input #0, matroska,webm, from '/home/bengab/Remote Jobs Files/Weperch/Watermark Video/upload_videos_dir/aea7d48358ed4ef99ceea98a46b1f1a7.webm':
  Metadata:
    encoder         : Chrome
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
    Stream #0:1(eng): Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 250 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
At least one output file must be specified

I have tried using ffmpeg from command line to convert video using os.system but when I do this, the audio does not synchronize with the video.

JIACHENG135 commented 1 year ago

Have the same issue.

camoverride commented 1 year ago

same issue...

Abdur-rahmaanJ commented 1 year ago

Same

TheNewCivilian commented 1 year ago

In my case, this originated from an incomplete .webm file. Copying the file manually with ffmpeg -i video_original.webm -vcodec copy -acodec copy video_copy.webm and loading this copy into moviepy

Mankvis commented 1 year ago

I also encountered the same problem today. The previous code has not been changed. At least one output file must be specified appeared today. Do you have a solution?

Dennis-Delgado commented 9 months ago

I have had the same issue, and I fixed it by updating something; however, I installed moviepy on another computer, and now I am getting this same error and can not fix it this time. Will post an answer once I get it.

Juniorduc44 commented 8 months ago

Well guess no one came up with a solution yet. Poop. Ill have to troubleshoot another day then.