fix: use container duration instead of per-video-stream

This commit is contained in:
2026-08-06 11:37:24 +02:00
parent e117522f3b
commit cb75a2becf

View File

@@ -137,7 +137,7 @@ func GetImage(buf *bytes.Buffer, path string, timestamp int, format string, scal
} }
func GetVideoLength(path string) (float64, error) { func GetVideoLength(path string) (float64, error) {
cmd := exec.Command("ffprobe", "-v", "quiet", "-select_streams", "v:0", "-show_entries", "stream=duration", "-of", "default=noprint_wrappers=1:nokey=1", path) cmd := exec.Command("ffprobe", "-v", "quiet", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", path)
buf := bytes.NewBuffer(nil) buf := bytes.NewBuffer(nil)
cmd.Stdout = buf cmd.Stdout = buf
err := cmd.Run() err := cmd.Run()