tfabris / CrowCam

A set of Bash scripts to control and maintain a YouTube live cam from a Synology NAS.
GNU General Public License v3.0
4 stars 3 forks source link

System always bounces at midday even if you've configured max video length to be very long. #79

Closed tfabris closed 8 months ago

tfabris commented 8 months ago

I was experimenting with making the video length run all day, instead of splitting it into smaller sections. I configured maxVideoLengthSeconds=64800 (18 hours) in crowcam-config. Daylight length today was about 12h16m and I had offsets of -10m and -60m configured, which makes it about 11h26m video length from start to finish. Yet this still happened:

2024-03-21 12:49:04 | SYSTEM | CrowCam Controller - Current video length 05:44 exceeds maximum of 05:40, bouncing the stream for 10 seconds.

The code isn't smart enough to understand that I don't want a midday bounce if I program the max length really long. I need to re-read the details and changes that I made for GitHub issue #55 and find out what gotchas I had in there, and find out why it's not doing what I expect. In particular why did I write this code this way? It forces a midday bounce, because, with a very long max video length, that "if" statement will always evaluate to true.


# GitHub issue #55 - If the midday point is shorter than the maximum allowed
# video length, then use that value in place of it. This means that the daily
# split point will be either midday, or, the max video length, whichever is
# the shorter one.
if [ $halfTimeSeconds -lt $maxVideoLengthSeconds ]  
then  
  LogMessage "dbg" "Using midday bounce length $(SecondsToTime $halfTimeSeconds) in place of maximum video length $(SecondsToTime $maxVideoLengthSeconds) to determine split points"  
  maxVideoLengthSeconds=$halfTimeSeconds
fi  ```
tfabris commented 8 months ago

Fixed in 8bbb17c.