Comskip Support Forum

Comskip is a free commercial detector, browse the forum for more information
It is currently Sat Oct 20, 2018 1:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Dec 18, 2017 8:59 pm 
Offline

Joined: Mon Nov 27, 2017 10:12 pm
Posts: 8
I have a few channels that are hard for Comskip. Channel logo is always on, and audio is only two channels always.

However I noticed that while there are two different audio tracks (original and dubbed), commercials are always on single language. So both audio tracks are playing the same data during commercial!

I made a quick and dirty test, extract both tracks with ffmpeg:

ffmpeg -i 00001.ts -map 0:1 lang1.wav -map 0:2 lang2.wav

Then I made my own C program that simply reads these files and compares in 1152 sample blocks (mp2 block size).. They are not exact matches, but very close, and always exact 1152 sample boundaries so they are quick to match. This finds the commercials really well.

But the problem is that if there is any errors in the original file, the generated .wavs can be much shorter than the full video, and then the cutpoints are wrong. So I can't really use my own program, it's not reliable because of this.. So I'm asking, is it possible to add to Comskip? :)


Top
 Profile  
Reply with quote  
PostPosted: Wed Dec 20, 2017 4:32 pm 
Offline

Joined: Mon Nov 27, 2017 10:12 pm
Posts: 8
I actually fixed my own program. :) The secret is to add some parameters to ffmpeg:

ffmpeg -y -i 00001.ts -map 0:1 -af "aresample=async=1" lang1.wav -map 0:2 -af "aresample=async=1" lang2.wav

"aresample=async=1" filter fixes the timeline by adding silence when needed, so the generated wav has correct timing.

But still this might be usable in Comskip. I can provide you with an example clip if needed.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 21, 2017 11:00 am 
Offline
Site Admin

Joined: Sun Aug 21, 2005 3:49 pm
Posts: 3211
Going to my test files its clear you have found a rather unique way to detect the commercials under your specific conditions
Not sure it will be useful for many people


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group