-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Issue with movie_event example: Py5Image objects have no fields or methods named "read" #576
Comments
Cheers, @epsln ! Thank you for opening this issue. I had some trouble making the Processing Video library work and then decided to use OpenCV playing capabilities as a workaround, as discussed at #266 (it could be the same issue!) Could you perhaps try and see if something like using def draw():
if movie.available():
movie.read() |
Hi @epsln ! Thank you for opening this issue. I see what is causing this problem and I have two possible solutions in mind. In addition to @villares 's workaround, can you try this: def movie_event(m):
m._instance.read() I hope to do a release at the end of this week. I need to think about this issue before proceeding with a fix, so it won't be in the upcoming release, but I'll aim to take care of it in the first release in 2025. |
Thanks for the quick responses. Both suggestions works and the video plays fine. While waiting for a fix, I'd suggest updating the documentation. Are you going to keep handling movies with an event and stick to Processing way of handling movies (like @hx2A response) or use openCV with a if statement on each frame (like in @villares response) ? Excellent project by the way, I'll be keeping an eye on it ! |
My |
@epsln , OpenCV is a good Python option for reading movie files, and is also a good thing to learn about in general, as it is applicable elsewhere in the Python world, outside of py5. However, the Processing way of handling movies and your code should work with py5. I believe it will be a relatively easy fix, I just need to think a bit before implementing it. I agree, I will update the documentation to make a note of this problem. |
OK, I have updated the documentation so nobody else gets caught by this. Hopefully an upcoming release will fix this problem and I'll change the documentation back. |
Using py5 0.10.3a1
When trying to load a video and playing it using the code given in the tutorial
The movie_event function raises the following error:
It seems that the callback is called with an empty Py5Image (with 0 height and 0 width).
The text was updated successfully, but these errors were encountered: