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

Fixes Windows permission error #175

Closed
wants to merge 1 commit into from
Closed

Conversation

psykzz
Copy link

@psykzz psykzz commented May 31, 2015

Traceback (most recent call last):
  File "test_downloader.py", line 30, in <module>
    main()
  File "test_downloader.py", line 27, in main
    download('_UfYjd50c6I')
  File "test_downloader.py", line 22, in download
    le_file = (VideoFileClip(_file))
  File "C:\Python27\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 5
5, in __init__
    reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
  File "C:\Python27\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 3
2, in __init__
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration)
  File "C:\Python27\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 2
40, in ffmpeg_parse_infos
    proc.terminate()
  File "C:\Python27\lib\subprocess.py", line 1002, in terminate
    _subprocess.TerminateProcess(self._handle, 1)
WindowsError: [Error 5] Access is denied
Exception AttributeError: "VideoFileClip instance has no attribute 'reader'" in
<bound method VideoFileClip.__del__ of <moviepy.video.io.VideoFileClip.VideoFile
Clip instance at 0x03E5FBC0>> ignored

```
Traceback (most recent call last):
  File "test_downloader.py", line 30, in <module>
    main()
  File "test_downloader.py", line 27, in main
    download('_UfYjd50c6I')
  File "test_downloader.py", line 22, in download
    le_file = (VideoFileClip(_file))
  File "C:\Python27\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 5
5, in __init__
    reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
  File "C:\Python27\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 3
2, in __init__
    infos = ffmpeg_parse_infos(filename, print_infos, check_duration)
  File "C:\Python27\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 2
40, in ffmpeg_parse_infos
    proc.terminate()
  File "C:\Python27\lib\subprocess.py", line 1002, in terminate
    _subprocess.TerminateProcess(self._handle, 1)
WindowsError: [Error 5] Access is denied
Exception AttributeError: "VideoFileClip instance has no attribute 'reader'" in
<bound method VideoFileClip.__del__ of <moviepy.video.io.VideoFileClip.VideoFile
Clip instance at 0x03E5FBC0>> ignored
```
@Zulko
Copy link
Owner

Zulko commented Jun 3, 2015

Thanks, but if it doesn't terminate on Windows, does it mean that you have a ghost (unclosed) process ? (my concern is that these processes can take place in memory, and people generally don't like them, so if there is a better solution than just ignoring the error, it's better).

@psykzz
Copy link
Author

psykzz commented Jun 3, 2015

It wasn't found running In my case, but I do agree.

On Wed, 3 Jun 2015 07:24 Zulko notifications@github.com wrote:

Thanks, but if it doesn't terminate on Windows, does it mean that you have
a ghost (unclosed) process ? (my concern is that these processes can take
place in memory, and people generally don't like them, so if there is a
better solution than just ignoring the error, it's better).


Reply to this email directly or view it on GitHub
#175 (comment).

@peircej
Copy link

peircej commented Sep 22, 2015

I was concerned about the same but I don't think so. Using this code:

for n in range(100):
   mov = moviepy.video.io.VideoFileClip(......)

after applying the patch, Task Manager doesn't show any gradual increase in processes. Maybe they're getting terminated by subprocess as the process is garbage collected?

Incidentally, I've applied a similar patch to the close methods of both FFMPEG_VideoReader and FFMPEG_AudioReader. In those cases the error message creeps in during __del__ and is harmless but annoying. The same trick prevents it and doesn't seem to lead to increased numbers of processes on the system

@psykzz
Copy link
Author

psykzz commented Oct 19, 2016

Any updates?

@ghost
Copy link

ghost commented Mar 13, 2017

@psykzz .. are you still having these issues with the current repo? If so, we'll look at adding this PR.

@psykzz
Copy link
Author

psykzz commented Mar 14, 2017

Not actively anymore. I was requesting an update just to close off the PR really.
If its useful, we can merge, otherwise ill close the PR.

@ghost
Copy link

ghost commented Mar 15, 2017

okay.. thanks.. I believe this has been resolved in another PR. If you continue having this issue, please reopen this PR..

@ghost ghost closed this Mar 15, 2017
@Droppers
Copy link

This is a really annoying issue and I can not use this library without this fix.

This does not seem to be solved in any PR, including #626

This pull request was closed.
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

Successfully merging this pull request may close these issues.

4 participants