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

VideoFileClip instance has no attribute 'reader' #255

Closed
waclock opened this issue Jan 28, 2016 · 4 comments
Closed

VideoFileClip instance has no attribute 'reader' #255

waclock opened this issue Jan 28, 2016 · 4 comments
Labels
bug Issues that report (apparent) bugs.

Comments

@waclock
Copy link

waclock commented Jan 28, 2016

Hello,

I've searched for a few days regarding this issue but have come to no solution. I have a big script (try to concatenate large amounts of videos, ~100-500), which is why I was getting the error "Too many files open". Reading Zulko's responses to other issues, I saw that it was necessary to delete each VideoFileClip instance manually like this:

del clip.reader
del clip

The issue I'm facing is that I have a simple hello_world trying to do this, but get the error
VideoFileClip instance has no attribute 'reader'

Here's the code:


from moviepy.editor import *


rel_path = "main.py"

file_path="hello_world.mp4"
newVideo = VideoFileClip(file_path)

del newVideo.reader
del newVideo

I'm using El Capitan (OS X), have updated MoviePy, Numpy, ImageMagick, and all packages I've seen as required, but I'm still getting this error. The problem is my computer ends up freezing sometimes because it's using so much memory. I'm currently concatenating chunks of 25 videos, and trying to delete all 25 "opened files", concatenate the next 25, and so forth. After that I'd concatenate the longer videos.

When I try running the real script, I get the following error If i don't add newVideo.reader

Traceback (most recent call last):
  File "/Users/johnpeebles/mispistachos/vines/video/reader.py", line 135, in compile_videos
    newVideo = VideoFileClip(videoPath).resize(height=finalHeight,width=finalWidth).set_position('center').set_start(currentDuration)
  File "/Library/Python/2.7/site-packages/moviepy/video/io/VideoFileClip.py", line 55, in __init__
    reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
  File "/Library/Python/2.7/site-packages/moviepy/video/io/ffmpeg_reader.py", line 32, in __init__
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration)
  File "/Library/Python/2.7/site-packages/moviepy/video/io/ffmpeg_reader.py", line 237, in ffmpeg_parse_infos
    proc = sp.Popen(cmd, **popen_params)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1223, in _execute_child
    errpipe_read, errpipe_write = self.pipe_cloexec()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1175, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files
Error compiling videos
Exception AttributeError: "VideoFileClip instance has no attribute 'reader'" in <bound method VideoFileClip.__del__ of <moviepy.video.io.VideoFileClip.VideoFileClip instance at 0x136e46908>> ignore

Any help is appreciated, thanks.

http://stackoverflow.com/questions/35062658/moviepy-videofileclip-instance-has-no-attribute-reader

@waclock
Copy link
Author

waclock commented Jan 28, 2016

Please note that if I without the line del newVideo.reader I still get the error Too many files open

@keikoro
Copy link
Collaborator

keikoro commented Feb 18, 2017

Same problem in #57.

@keikoro
Copy link
Collaborator

keikoro commented Feb 18, 2017

Looks like a fix is in the works. #413

@keikoro keikoro added the bug Issues that report (apparent) bugs. label Feb 18, 2017
@ghost
Copy link

ghost commented Feb 21, 2017

I believe the pull request for this has been pushed to the repo. closing..

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs.
Projects
None yet
Development

No branches or pull requests

2 participants