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

Add option to download a motion image #18

Closed
donaldrs opened this issue Jul 29, 2020 · 6 comments
Closed

Add option to download a motion image #18

donaldrs opened this issue Jul 29, 2020 · 6 comments

Comments

@donaldrs
Copy link
Contributor

In addition to the video and the snapshot, a "motion" image is also generated by the server. This is the "red" image that is shown in the UI over the video.

I created a pull request to add a method to recording to download that image. I need that for my own application, but I think more people might find it useful.

Otherwise, thanks for all the great work! I really appreciate it!

yuppity added a commit that referenced this issue Jul 31, 2020
Add option to download motion image (addresses #18)
@yuppity
Copy link
Owner

yuppity commented Jul 31, 2020

Thank you! This seems like a great addition.

(Please check the PR comments when you have time.)

@yuppity yuppity closed this as completed Jul 31, 2020
@donaldrs
Copy link
Contributor Author

Looks great! I should have checked for fullTimeRecording myself; great addition.

@donaldrs
Copy link
Contributor Author

donaldrs commented Dec 12, 2020 via email

@yuppity
Copy link
Owner

yuppity commented Dec 12, 2020

I might be interested in incorporating this as a some sort of an alternate operating mode. Meaning users would have to init UnifiVideoAPI into a separate WS mode. There's also a couple of things I'd be looking to avoid if I did implement this:

  • non-WS use cases being dependant on an external WS lib,

  • and having to deal with asyncio or depending on a third party async library.

As such, I'd likely end up using a synchronous WS lib, maintaining a separate thread for it, and pushing messages to an output queue which users could then do what they liked with. At this point, I'm not sure if I would even want to classify the incoming JSON messages in anyway; I would likely just parse the JSON and queue it as a Python dict. Users would then have to write their own logic based on message['action'] and message['dataType'].

That is my thinking atm, though it is tempting to take it a step further and reflect the incoming updates in the recordings collection on the existing UnifiVideoAPI instance. I'll play around with this for awhile and hopefully form a better picture on whether the above makes sense. Any code you can send is welcome.

@donaldrs
Copy link
Contributor Author

donaldrs commented Dec 12, 2020 via email

@donaldrs
Copy link
Contributor Author

donaldrs commented Dec 12, 2020 via email

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