I'm running Python 3.5.2 on macOS 10.12.1 Sierra. I downloaded python (which comes with pip) yesterday from python.org, and moviepy by running
sudo pip3 install moviepy
I am using the built-in IDLE, but I am having several problems:
1.
If I run
clip = VideoFileClip("movie.mov")
I get
Traceback (most recent call last):
File "/Users/tomburrows/Documents/program.py", line 5, in
clip = VideoFileClip("movie.mov")
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/VideoFileClip.py", line 55, in __init__
reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/ffmpeg_reader.py", line 32, in __init__
infos = ffmpeg_parse_infos(filename, print_infos, check_duration)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/ffmpeg_reader.py", line 250, in ffmpeg_parse_infos
if "No such file or directory" in lines[-1]:
IndexError: list index out of range
They are in the same folder
2.
If I run
clip = ImageSequenceClip(["pic.jpg","pic2.jpg"], fps = 1)
clip.write_videofile("newmovie.mp4")
I get
`[MoviePy] >>>> Building video newmovie.mp4
[MoviePy] Writing video newmovie.mp4
0%| | 0/3 [00:00, ?it/s]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/ffmpeg_writer.py", line 137, in write_frame
self.proc.stdin.write(img_array.tostring())
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/tomburrows/Documents/program.py", line 4, in
clip.write_videofile('newmovie.mp4')
File "
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/decorators.py", line 54, in requires_duration
return f(clip, a, *k)
File "
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/decorators.py", line 137, in use_clip_fps_by_default
return f(clip, new_a, *new_kw)
File "
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
return f(clip, a, *k)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/VideoClip.py", line 339, in write_videofile
ffmpeg_params=ffmpeg_params)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/ffmpeg_writer.py", line 211, in ffmpeg_write_video
writer.write_frame(frame)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/moviepy/video/io/ffmpeg_writer.py", line 144, in write_frame
if "Unknown encoder" in ffmpeg_error:
TypeError: a bytes-like object is required, not 'str'`
Any help appreciated!
I also faced similar issue. It turns out that output directory was not created. When I created output directory then this error disappeared.
if you are still having issues, see issue #401 for a possible fix.
I think at least the first problem was I hadn't put the correct output directory, and the other one because I had a bad ffmpeg install. Possibly.
Most helpful comment
I also faced similar issue. It turns out that output directory was not created. When I created output directory then this error disappeared.