Auto-detect commercials via stills

Where all the user feedback and suggestions for improvements go
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Auto-detect commercials via stills

Post by anthonyshephard »

Hello,
I was wondering if it might be possible to detect the beginning and end of a commercial via the detection of a match of a supplied still. Some shows in the UK are always wrapped by a sequence which is the same. So I could grab a suitable frame (perhaps one for start and one for end of commercial) and use this for detection. Does this sound like a good idea?

Anthony
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

Interresting, specially for the UK where some channels have no logo.

Could you grab such a start and end frame (don't save as jpg but as bmp)
and upload to my ftp server the start and end sequence inwhich those frames should be present, but from another show. This is to test if the frames are realy the same for all those shows.
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

Hi,
Thanks for the response. I will do so but it will not be for a few days. I am thinking of "The Bill" and I would need to wait until Thursday to get two shows.
I think I need a username and password to upload files to athome.kaashoek.com.

Anthony
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

I already did PM you with the details.
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

HI,
Sorry I didn't see the PM. Hotmail thought it was junk mail.
I have uploaded a short clip of the all the breaks in the Bill, and an example bitmap which should match with all the adverts (the end sequence is different but could be another still).
For some reason the reception was really bad tonight so there are some glitches. This could cause problems with the matching. The audio is also the same for each break and could possibly be used?

I will upload another example tomorrow unless you tell me otherwise...

Anthony
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

Another example would be nice.
I do have another idea to do this, that may be simpler and more robust
Want to test with at least two examples
jamesAU
Posts: 1
Joined: Sat Jan 27, 2007 7:06 am

A more detailed solution if this works

Post by jamesAU »

Hi erik,

I use ComSkip on my recorded shows and it always detects the commercials which is great.

I find however that editing needs to be done on my part to make sure the output video file starts at the beginning of the show and ends at the end. This is because my recording application start 5 mins early and goes for an extra 5 mins.

As with Anthony's idea to detect commercials by frames i've previously thought about this but instead of detecting commercials i've thought it could be used to detect the beginning and end of the actual show.

So a user would have a collection of frames that occur at the start and end of each show, and comskip could mark when these frames occur. Because these frames would be the same for everyone within a region users could easily build up a large database of this data.

So if you can get Anthony's solution working for detecting a frame i reckon it could be extended to work for detecting start and end times. If this is beyond what you had intended for comskip please post if you get this frame detection working and i will modify the source code as an extra addon.

James.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

There is one big problem with this idea.
Having to recognition these multiple frames would slow down comskip soo much that it would not be usable anymore.
I am working on another solution where a short sequence (say 20 frames) is translated into a compact fingerprint. Recognizing a fingerprint in a database of multiple fingerprints seems to be possible.
Be patient.

W.r.t. pre and post padding.
I also record with about 5 minutes pre and post padding and I use the remove_show_before... and remove_show_after... .
Don't they work for you?
If not, do send me the data as described in "how to ask for help" and I will have a look.
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

Unfortunately I could not record anything on Thursday due to reception problems. It looks like it will be next Wednesday until I have another Bill I can upload for you.

Anthony
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

Do you have another program where you would like to use this detection using video sequences?
The "bill" sequence is good enough for the moment.
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

Yes,
I will post Relocation Relocation which has the same sequence around the adverts. It will probably be tomorrow now (my wife wants the computer...)

Anthony
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

Hi,
I have uploaded another Bill and Relocation Relocation. Let me know if you want any other examples...

Anthony
anthonyshephard
Posts: 29
Joined: Sun Jan 21, 2007 10:01 pm

Post by anthonyshephard »

Hi,
Do you have enough data to be making progress?
Let me know if I can help further

Anthony
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

No progress at the moment due to some timeline and preview problems that have to be solved.
Will come back later
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

I have released build 73, a rather experimental version. However it should do cutting on upto 8 prerecorded cutscene frames.

From the changelog

Changes in 0.79.73
- Added a separate executable for using the DebugWindow ComskipGUI.exe, no longer needed to edit the shortcut for activating the debugwindow, simply drag and drop onto ComskipGUI.exe
- New cutpoint detection method: CutScenes, method number 128
First record one or more frames to be used as cutscene by running ComskipGUI on the MPEG, move to the frame you want to use as cutscene and hit 'C'. Select where you want the frame to be saved.
Then use up to 8 cutsceneframes in your ini file
cutscenefile1="C:\\Work\\cutscene1.dmp"
cutscenefile2="C:\\Work\\cutscene2.dmp"
Set the cutscene threshold higher if you have low quality video.
cutscene_threshold=20
Using more cutscenes will slowdown Comskip, when cutscenes are enabled the Debugwindow will show in the pink line cutscene information instead of scene change information
Post Reply