Hellowlol / bw_plex

binge watching for plex
MIT License
366 stars 23 forks source link

@hellowlol a question for you. #41

Closed KBlixt closed 6 years ago

KBlixt commented 6 years ago

Hi, I was unsure of how to contact you with a question since github removed their messenge feature.

I've been considering making a script that removes the green "approved for certain audiences" that appear ahead of trailers. Although I don't know where to start.

Considering that your project has to do with analyzing a fairly repetetive pattern from video file. I was wondering if you know of a way to do this.

I don't need a detailed explanation just a few key components that you know of that I could google and use in my script.

Sorry if this is the wrong place for this question.

Thank you.

Hellowlol commented 6 years ago

Hi! You need to identify some features that you can detect. The green stuff that you was talking about is that alsways the same?

If so i would probably use opencv template matching. See https://www.pyimagesearch.com/2015/01/26/multi-scale-template-matching-using-python-opencv/ for a good guide about that.

KBlixt commented 6 years ago

Yes, the screen is always the same kind of green (or very close) and the only other thing on the screen is some white text in the middle but at least a fifth of the screen from the edge is always the same green. So I recon that the easiest and most reliable way to detect the pattern would be to look for a green frame.

Normally this static picture lasts 5-6 seconds if it's there. It's also completely silent. Here is a few examples: https://www.google.se/search?q=green+approved+screen+trailer&client=ms-unknown&prmd=isvn&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjNveXFyMvbAhVOSZoKHTzBBGUQ_AUIESgB&biw=412&bih=652&dpr=2.63

Great thank you for the pointer. Although this seems to mainly be comparing edges. I'd like to compare pixel color in a given area. And then if the frame match the green during the first 8 seconds of the trailer it'll get trimmed. And obviously trim the audio stream with the same amount of time.

Hellowlol commented 6 years ago

Can you post a example picture?

Hellowlol commented 6 years ago

This is a example to detect color. https://www.pyimagesearch.com/2014/08/04/opencv-python-color-detection/ have you tried to just look for the text like the word preview? There is two functions in the credits.py file you can use

KBlixt commented 6 years ago

I linked a Google search. Pretty much all of them are what I'm talking about.

And while all of them are very similar the text does varies and I think the colour filtering that you linked to would give a more reliable result.

Thank you so much, now I know where to start.

Hellowlol commented 6 years ago

All of them had the word preview and audiences. I think that would be a lot simpler solution, slower but simpler it’s like 4 lines of code. Good luck 👍

KBlixt commented 6 years ago

hm, yeah. that's true. Thank you a bunch for pointing out a direction though.