NaturewatchCameraServer
NaturewatchCameraServer copied to clipboard
Use calculated video length
Description
After altering video_duration_before_motion
and video_duration_after_motion
, I noticed that the videos were still the same length. This is because the video length is hard-coded when saving the video. This PR fixes that by replacing the hard-coded 15
with the calculated duration.
This is actually a partial revert of 2d825790283f2be6b9ba17bf413f75998c6326e2 - so there might be a reason for the hardcoded value that I'm missing.
Fixes # (issue)
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
I have ssh-ed onto the Pi and fixed the code manually.
Tested on the following devices:
- [ ] Development environment (Linux, Windows, or MacOS)
- [x] Pi Zero W
- [ ] Pi 3A+
- [ ] Pi 3B+
- [ ] Pi 4
Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [ ] New and existing unit tests pass locally with my changes
Thanks for the contribution! Can you tell us a little bit about the durations that you tried? We haven't had much success on Pi Zero in the past and longer recordings...
Hi @mikevanis I tried up to 50 seconds (10 seconds before and 40 seconds after) while debugging this. But I can't be certain that I used that confuguration after applying the fix. However, I have been recording videos of around 30 seconds regularly since.
I can try some other configurations and report back.
Hi @stephenharris, Do you have an update with some more testing? The build action is back up and running, so if you re-run the PR (maybe easier to add a new commit just for the sake of it) it should pass