compare a png logo with video except png's transparent background pixels

89 Views Asked by At

I want to find frames with the logo image from video, and to concat theses frames without commercials for getting ad-free video. I tried this first by using ffmpeg & jpg logo image.

ffmpeg -i input.mp4 -loop 1 -i logo.jpg -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -

And it works, but in the case by case, less accurate with blackframe setting number. So, for getting more accuracy I tried png logo image with transeparent background.

ffmpeg -i input.mp4 -loop 1 -i logo.png -an -filter_complex crop=47:25:639:24,"blend=difference:shortest=1,blackframe=95:60" -f null -

But on the contrary of my idea, the results came out worse than jpg logo. It seems that the cause is why ffmpeg compare the png's transparent background part pixels too with video.

Is there a way to compare png logo with video except png logo's transparent part pixels ?

I'd appreciate your advice, thank you.

0

There are 0 best solutions below