-
Notifications
You must be signed in to change notification settings - Fork 63
feat: example video review application based on motion recordings #77
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
Conversation
Hey @sven337 thank you for the awesome contribution! :) I would like to suggest we move the new code from |
Thanks, I am still iterating on this GUI app, will move it to a separate file. |
PR updated, the download_motion script gets a few fixes but otherwise stays the same, everything is in video_review_gui.py |
For "TrackMix" with two lenses, channel 0 is the wide-angle lens while channel 1 is the telephotolens. The "action" parameter of the Search request is documented in Reolink's PDF as being "0", yet this code passes "1". Not modified in this change as it did not seem to prevent correct operation on my trackmix wifi.
- use https (needed on Trackmix wifi) - download videos from the start of today until right now (search cannot span more than a given day) - download videos from the start of yesterday until start of today (to get good coverage, given that spanning more than a day is impossible) - search videos for both channels in main stream - write file names to disk as they are on the camera for later parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution, this is honestly great stuff! I just have one question and then I think we can merge it :)
end = dt.now() | ||
# Collect motion events between these timestamps for substream | ||
processed_motions = cam.get_motion_files(start=start, end=end, streamtype='sub') | ||
processed_motions = cam.get_motion_files(start=start, end=end, streamtype='main', channel=0) | ||
processed_motions += cam.get_motion_files(start=start, end=end, streamtype='main', channel=1) | ||
|
||
dl_dir = os.path.join(os.path.expanduser('~'), 'Downloads') | ||
start = dt.now() - timedelta(days=1) | ||
end = dt.combine(start, dt.max.time()) | ||
processed_motions += cam.get_motion_files(start=start, end=end, streamtype='main', channel=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 41-43 seems a bit superfluous to me.
why do you need to re-assign start
and end
here. can't we just set start
to 1 day ago instead of start of today? Same with end
, can't we just set it from the beginning to dt.now()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My camera (maybe others, but my for sure) does not support searches that span more than a single day.
So the first search is for "today", and the second one for "yesterday", which is how I make sure to cover > 24h and see all videos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay, that makes sense! Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current use case is every day, review the videos of the past day.
The web app and mobile apps expose a calendar, but I don't think it works all that great. So longer term maybe we want a GUI to select what date range to look for (and I can make it default to whatever I like).
This PR adds a GUI app to review videos from Linux in a GUI app, since nothing exists to do it well.
The best UI I found is the Reolink mobile app, and critically this GUI replicates the "trigger source" information so that you can tell at a glance why the camera was recording (this is based on the reolink_aio reverse engineered trigger sources, I know for a fact they are not fully correct and may try to improve them in the future).
In this series are some fixes to the API code, fixes to download_motions proper, and then the rest of the changes turn download_motions into a full-featured pyqt app for exploration of the videos.

Screenshot:
Features:
Requires "video_storage_dir" to be defined in the configuration file (I use /tmp).