-
Notifications
You must be signed in to change notification settings - Fork 69
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
Enhancement: collaborate to create a SlowMovie plugin for PaperPi #113
Comments
I took a quick look through the documentation of your demo plugin. Seems like each plugin provides it's internal logic to get whatever data it needs and then returns a series of I think pulling apart the code to do this is certainly doable, although I have a few follow up questions.
|
@robweber Thanks for the quick reply and all the research you did. I hope you found the documentation readable. You've got the basics correct with regards to how plugins generate content for the layouts and are eventually displayed. SlowMovie would just need to generate the frames and deliver them to the PaperPi plugin on demand. To answer your questions: Question 1.
Question 2: Here's the basic logic:
Some plugins, such as the Spotify and Logitech Media Server plugins can "take over" when music is playing. None of the other plugins get to display, but are still updated in the background so they have data when the music stops. I'm not sure which approach would be best within the existing structure of SlowMovie. My initial thought would be that the plugin would connect with SlowMovie and ask for a frame to be rendered on demand. Letting SlowMovie chug along in the background churning out frames, would be pretty hard to sync with the actual display rate because that is user-configurable and can be changed. SlowMovie might also get badly out of sync and end up just churning out too many or too few frames. Question 3: As I write this, I think the best way to build this would be to require a SlowMovie to be installed separately and then connect to it from the plugin and request frame N or something similar. Users that want SlowMovie can follow your excellent guides and then install the plugin independently. |
Thanks for the detailed answers. It sounds like there would be two different "timers" going on with a PaperPi plugin integration. You'd have the normal SlowMovie timer (which could be configured via your PaperPi settings) that would tell it to update X number of frames every X number of seconds. Then there would be the PaperPi timer that controls how long it would display each individual plugin through it's rotation. Based on your explanation above that would allow PaperPi to ask for the next image as it rotates through the plugins and SlowMovie would pull new frames based on it's settings. (example: each plugins displays for 30 seconds but SlowMovie only updates the video image every 10 minutes - the same image might get displayed 4-5 times depending on how many plugins PaperPi is running). Does that kind of sound like how things would work from your end? I agree it might be easiest to keep the SlowMovie install as it's own thing and then enabling the PaperPi plugin would just call some SlowMovie methods. In order for this to work properly I think we'd have to refactor a few things on this side. Namely we'd want to break up the frame grabbing from the EPD code into some definitive classes. Right now the What type of object to you expect for an image in PaperPi? In the layout.py file for the demo project it makes reference to an (pseudo-code here)
Would something like that work? I could start a fork to refactor some things on our side. Basically just moving some code blocks around to get them in their own classes. That way we could keep all of our EPD and timer code separate. |
Your proposed approach sounds pretty reasonable. Ideally PaperPi just asks for the next active frame based on its internal logic and SlowMovie generates either a path or a PIL object. PaperPi can work with either. I think there are two interesting ways to approach this:
Which one sounds most logical or in the spirit of the project to you? I'm a little concerned with how to integrate SlowMivie as an import. I just started to learn about appending to the module search paths, but I don't quite have a handle on that yet. |
If you want SlowMovie to just sort of chug away on it's own a simple solution might just be to run it with the The only downside to this approach would be that control of SlowMovie functions (video selection, frame updates, etc) would all have to happen outside of your PaperPi install. You wouldn't be able to pass anything on from your plugin to SlowMovie itself. Since SlowMovie does allow configuration via a Here is a link to the driver specific options for the EPD control. The options for the mock device are listed. |
That's a pretty great place to start. Let me hack out proof of concept using that option first and see how it turns out. This option would obviously be the lowest overhead for you all. Using this solution, some frames will likely get skipped, but I don't think users will "feel" the missed frames unless the rate is unreasonably fast for the movie. |
Great, glad this will get you started. I definitely agree this could result in some frames not displaying but the end user will have to play with that. If they set SlowMovie to update every 30 seconds but PaperPi is switching plugins every 2 min, as an example, they're going to miss something. On the other hand most people probably miss many frames as it's meant to show the video slowly over time, you're probably not looking every time it updates. |
Describe the problem
Not so much a problem as an idea. I maintain PaperPi and received a few suggestions to add a "slow movie player" to the display loop.
Describe the solution you'd like
I'd like to collaborate and see if we can roll SlowMovie into a plugin for PaperPi.
Describe alternatives you've considered
I can, of course, pull your code and try to reverse engineer it into a plugin, though it might be more fun to do this as a collaboration and save me reinventing your wheel.
Thanks for making cool stuff and sharing it.
The text was updated successfully, but these errors were encountered: