vansante / go-ffprobe

Library to easily get the ffprobe output of a given file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why not use the following code in the loop?

iwanlebron opened this issue · comments

code:
for _, fPath := range paths {
getVideo(fPath)
time.Sleep(1 * time.Second)
}
func getVideo(name string) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
data, err := ffprobe.ProbeURL(ctx, name)
if err != nil {
log.Panicf("Error getting data: %v", err)
}
log.Println(data.Format.DurationSeconds)
}
result:
panic: Error getting data: error running ffprobe [] exit status 1

commented

Can you put your code in code tags to make it easier to read? I do not quite understand what you mean by using the code in a loop? Can you elaborate?

sorry, there is a problem with the MP4 file...