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
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...