inital commit

This commit is contained in:
KingKDot
2026-03-05 00:04:26 -06:00
commit f8515a2883
269 changed files with 47081 additions and 0 deletions
@@ -0,0 +1,28 @@
package handlers
import (
"log"
"os"
"strconv"
"strings"
"time"
)
func streamInterval(envVar string, defFPS int) (time.Duration, int) {
fps := defFPS
raw := strings.TrimSpace(os.Getenv(envVar))
if raw != "" {
if v, err := strconv.Atoi(raw); err == nil && v > 0 {
fps = v
} else {
log.Printf("stream: invalid %s=%q, using %d", envVar, raw, defFPS)
}
}
if fps < 1 {
fps = 1
}
if fps > 120 {
fps = 120
}
return time.Second / time.Duration(fps), fps
}