fix: use container duration instead of per-video-stream
This commit is contained in:
@@ -137,7 +137,7 @@ func GetImage(buf *bytes.Buffer, path string, timestamp int, format string, scal
|
||||
}
|
||||
|
||||
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)
|
||||
cmd.Stdout = buf
|
||||
err := cmd.Run()
|
||||
|
||||
Reference in New Issue
Block a user