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

BrokenPipeError #349

Closed
tburrows13 opened this issue Nov 4, 2016 · 3 comments
Closed

BrokenPipeError #349

tburrows13 opened this issue Nov 4, 2016 · 3 comments

Comments

@tburrows13
Copy link
Collaborator

tburrows13 commented Nov 4, 2016

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

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 "", 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!

@gagandeep
Copy link

I also faced similar issue. It turns out that output directory was not created. When I created output directory then this error disappeared.

@ghost
Copy link

ghost commented Feb 10, 2017

if you are still having issues, see issue #401 for a possible fix.

@tburrows13
Copy link
Collaborator Author

tburrows13 commented Feb 10, 2017

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.

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

2 participants