Revert "Remove scene detection code (#377)"

This reverts commit 98566e26c0.
This commit is contained in:
Thom Shutt
2024-01-19 09:07:47 +00:00
parent 98566e26c0
commit 5ad522cf23
12 changed files with 478 additions and 6 deletions

View File

@@ -64,7 +64,9 @@ func main() {
o := ffmpeg.TranscodeOptions{
Oname: fmt.Sprintf("out_%s_%d_out.mp4", lbl, i),
Profile: profs[i],
Accel: accel,
// Uncomment the following to test scene classifier
// Detector: &ffmpeg.DSceneAdultSoccer,
Accel: accel,
}
o.From = *from
o.To = *to
@@ -97,7 +99,11 @@ func main() {
end := time.Now()
fmt.Printf("profile=input frames=%v pixels=%v\n", res.Decoded.Frames, res.Decoded.Pixels)
for i, r := range res.Encoded {
fmt.Printf("profile=%v frames=%v pixels=%v\n", profiles[i].Name, r.Frames, r.Pixels)
if r.DetectData != nil {
fmt.Printf("profile=%v frames=%v pixels=%v detectdata=%v\n", profiles[i].Name, r.Frames, r.Pixels, r.DetectData)
} else {
fmt.Printf("profile=%v frames=%v pixels=%v\n", profiles[i].Name, r.Frames, r.Pixels)
}
}
fmt.Printf("Transcoding time %0.4v\n", end.Sub(t).Seconds())
}