mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
* Add file scanner * Scan scene changes * Split scan files * Generalise scan * Refactor ffprobe * Refactor ffmpeg encoder * Move scene scan code to scene package * Move matchExtension to utils * Refactor gallery scanning * Refactor image scanning * Prevent race conditions on identical hashes * Refactor image thumbnail generation * Perform count concurrently * Allow progress increment before total set * Make progress updates more frequent
24 lines
626 B
Go
24 lines
626 B
Go
package scene
|
|
|
|
import (
|
|
"github.com/stashapp/stash/pkg/ffmpeg"
|
|
"github.com/stashapp/stash/pkg/logger"
|
|
)
|
|
|
|
type screenshotter interface {
|
|
Screenshot(probeResult ffmpeg.VideoFile, options ffmpeg.ScreenshotOptions) error
|
|
}
|
|
|
|
func makeScreenshot(encoder screenshotter, probeResult ffmpeg.VideoFile, outputPath string, quality int, width int, time float64) {
|
|
options := ffmpeg.ScreenshotOptions{
|
|
OutputPath: outputPath,
|
|
Quality: quality,
|
|
Time: time,
|
|
Width: width,
|
|
}
|
|
|
|
if err := encoder.Screenshot(probeResult, options); err != nil {
|
|
logger.Warnf("[encoder] failure to generate screenshot: %v", err)
|
|
}
|
|
}
|