Closed ad-astra-video closed 1 month ago
Performance stats indicate it performs more or less the same as not getting the FPS and Duration data. Was tested on my O node so not entirely unused test environment.
Most test files from https://test-videos.co.uk
test function was:
func main() {
p := "/home/brad/test-videos"
items, _ := os.ReadDir(p)
w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', tabwriter.Debug)
fmt.Fprintln(w, "File\tTook (ms)\tFPS\tDur")
for _, item := range items {
vid_path := p + "/" + item.Name()
//fmt.Println(item.Name())
start := time.Now()
_, mfi, err := ffmpeg.GetCodecInfo(vid_path)
if err == nil {
took := time.Since(start).Milliseconds()
line := fmt.Sprintf("%v\t%v\t%v\t%v", item.Name(), took, mfi.FPS, mfi.Dur)
fmt.Fprintln(w, line)
} else {
fmt.Printf("error getting codec info: %w\n", err)
}
}
w.Flush()
}
@ad-astra-video Is this PR ready to merge?
I think the lpms part has no changes needed. go-livepeer does not consider getting the fps from the new fields yet though. Do you want to wait to merge until that gets added to go-livepeer?
I think the lpms part has no changes needed. go-livepeer does not consider getting the fps from the new fields yet though. Do you want to wait to merge until that gets added to go-livepeer?
Yeah, maybe let's wait and merge it all together
Rebased this to current master. Testing this with AI workflows.
Is this PR still needed now that https://github.com/livepeer/lpms/pull/407 is merged?
Add FPS and Duration data to GetCodecInfo.