NaturewatchCameraServer icon indicating copy to clipboard operation
NaturewatchCameraServer copied to clipboard

Use calculated video length

Open stephenharris opened this issue 3 years ago • 3 comments

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

stephenharris avatar Nov 03 '21 22:11 stephenharris

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...

mikevanis avatar Nov 09 '21 12:11 mikevanis

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.

stephenharris avatar Nov 15 '21 18:11 stephenharris

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

mikevanis avatar Jan 26 '22 23:01 mikevanis