Log in

View Full Version : Video segments detection


kolak
21st February 2023, 00:15
Is it possible to detect black, video bars, silence, freeze frames through vs with some log with frame numbers?

_Al_
22nd February 2023, 07:07
Four questions , pretty heavily compressed. :-)
Black could be detected using PlaneStats with some threshold and checking max values.
Video bars (of known type? Check diff) or check for gray left,right and green in the middle.
Detect silence perhaps not, because vapoursynth cannot evaluate audio, FrameEval would not work (could be wrong).
Freeze frames check for differences using PlaneStats or Diff to detect no changes within a threshold limit,
all DIY stuff.
The easiest part would be actually to print results using matplotlib.

kolak
23rd February 2023, 01:31
Which bring us to the point where using ffmpeg is way easier :)

_Al_
23rd February 2023, 06:55
Including those plots? :-) ffmpeg does what it can do. All of us using it for a reason.
As soon as you get python going though, it seams like there is no limit (tapping into C libraries of course).

kolak
23rd February 2023, 19:37
Yes, but in this case I need just numbers and getting these is way easier with ffmpeg. Black, freeze frame and silent detection filters work quite well in ffmpeg.
Then I need to generate FCP XML to create a timeline. This is more tricky, but doable.
It will be all Python based (which I can do), but only at basic level.