Compare commits

..

No commits in common. "mistress" and "convert-go" have entirely different histories.

2 changed files with 4 additions and 10 deletions

View file

@ -74,7 +74,6 @@ type WD14Caption struct {
var (
config *Config
httpClient = &http.Client{}
videoSem = make(chan struct{}, 1)
)
func loadConfig() (*Config, error) {
@ -295,11 +294,6 @@ func handleImage(w http.ResponseWriter, data []byte, fileName, contentType, thre
}
func handleVideo(w http.ResponseWriter, data []byte, fileName, threshold string) {
slog.Info("waiting for video processing slot", "queued", len(videoSem))
videoSem <- struct{}{}
defer func() { <-videoSem }()
slog.Info("acquired video processing slot")
// Write video to temp file
ext := filepath.Ext(fileName)
tmpFile, err := os.CreateTemp("", "glimbus-video-*"+ext)

View file

@ -198,14 +198,14 @@ func getFrameSkipSeconds(totalSeconds int) int {
case totalSeconds <= 60:
return 5
case totalSeconds <= 120:
return 7
case totalSeconds <= 300:
return 10
case totalSeconds <= 300:
return 12
case totalSeconds <= 1000:
return 15
case totalSeconds <= 1200:
return 20
return 40
default:
return 26
return 60
}
}