Moviepy: BrokenPipeError

Created on 4 Nov 2016  路  3Comments  路  Source: Zulko/moviepy

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 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 "", line 2, in write_videofile
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 "", line 2, in write_videofile
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 "", line 2, in write_videofile
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!

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PyB1l picture PyB1l  路  3Comments

bilel picture bilel  路  4Comments

cquintini picture cquintini  路  4Comments

djevo1 picture djevo1  路  3Comments

RahulPrasad picture RahulPrasad  路  4Comments