diff --git a/backend/analyze.go b/backend/analyze.go index b385759..928e0f7 100644 --- a/backend/analyze.go +++ b/backend/analyze.go @@ -2673,6 +2673,7 @@ func analyzeVideoFromFramesForGoal( highlightHits, positionEvidence = applyVideoMAEPositionClipsForAnalyze( ctx, + file, samples, durationSec, highlightHits, @@ -2744,6 +2745,7 @@ func analyzeVideoFromFramesForGoal( highlightHits, positionEvidence = applyVideoMAEPositionClipsForAnalyze( ctx, + file, samples, durationSec, highlightHits, diff --git a/backend/analyze_videomae.go b/backend/analyze_videomae.go index 34cad82..d8e228b 100644 --- a/backend/analyze_videomae.go +++ b/backend/analyze_videomae.go @@ -18,8 +18,9 @@ const ( analyzeVideoMAEClipStrideSeconds = 2.0 analyzeVideoMAEMinScore = 0.34 analyzeVideoMAERequestBatchSize = 8 - analyzeVideoMAEMaxClips = 180 - analyzeVideoMAERequestTimeout = 75 * time.Second + analyzeVideoMAEMaxClips = 96 + analyzeVideoMAERequestTimeout = 45 * time.Second + analyzeVideoMAETotalTimeout = 2 * time.Minute ) type analyzeVideoMAEClipReqItem struct { @@ -169,7 +170,7 @@ func predictVideoMAEPositionClipsForAnalyze( body, err := json.Marshal(payload) if err != nil { - return nil, err + return out, err } parsed, err := func() (analyzeVideoMAEClipPredictResp, error) { @@ -231,7 +232,7 @@ func predictVideoMAEPositionClipsForAnalyze( return parsed, nil }() if err != nil { - return nil, err + return out, err } if !parsed.Available { @@ -252,6 +253,7 @@ func predictVideoMAEPositionClipsForAnalyze( func applyVideoMAEPositionClipsForAnalyze( ctx context.Context, + file string, samples []videoFrameSample, duration float64, highlightHits []analyzeHit, @@ -268,7 +270,8 @@ func applyVideoMAEPositionClipsForAnalyze( } if len(clips) > analyzeVideoMAEMaxClips { appLogf( - "VideoMAE Clip-Analyse begrenzt: clips=%d max=%d", + "VideoMAE Clip-Analyse begrenzt file=%q clips=%d max=%d", + strings.TrimSpace(file), len(clips), analyzeVideoMAEMaxClips, ) @@ -279,15 +282,23 @@ func applyVideoMAEPositionClipsForAnalyze( onProgress(0, len(clips)) } - predictions, err := predictVideoMAEPositionClipsForAnalyze(ctx, clips, onProgress) + videoCtx, cancel := context.WithTimeout(ctx, analyzeVideoMAETotalTimeout) + defer cancel() + + predictions, err := predictVideoMAEPositionClipsForAnalyze(videoCtx, clips, onProgress) if err != nil { if ctx.Err() == nil { + appLogf( + "VideoMAE Clip-Analyse begrenzt/übersprungen file=%q predictions=%d err=%v", + strings.TrimSpace(file), + len(predictions), + err, + ) if onProgress != nil { onProgress(len(clips), len(clips)) } appLogln("VideoMAE Clip-Analyse übersprungen:", err) } - return highlightHits, positionEvidence } for _, pred := range predictions { diff --git a/backend/dist/nsfwapp-linux-amd64 b/backend/dist/nsfwapp-linux-amd64 new file mode 100644 index 0000000..89fec8b Binary files /dev/null and b/backend/dist/nsfwapp-linux-amd64 differ diff --git a/backend/dist/nsfwapp.exe b/backend/dist/nsfwapp.exe index 1434c79..78d7b93 100644 Binary files a/backend/dist/nsfwapp.exe and b/backend/dist/nsfwapp.exe differ diff --git a/backend/dist/nsfwapp_amd64.deb b/backend/dist/nsfwapp_amd64.deb index 907720b..adafe4a 100644 Binary files a/backend/dist/nsfwapp_amd64.deb and b/backend/dist/nsfwapp_amd64.deb differ