Time to run ComSkip

Here you can ask your questions on how to use Comskip for the detection of commercials. Also questions on how to remove commercials are welcome
Post Reply
jimdarnell
Posts: 15
Joined: Sun May 10, 2015 6:14 pm

Time to run ComSkip

Post by jimdarnell »

I'm looking at three recordings I ran ComSkip on tonite. A one hour running from 9-10pm had all files modified at 10:36. Two half hour shows, both running from 10-10:30 pm had their files both modified at 11:10 pm. Doesn't that seem a little long? I'm running the latest version of ComSkip on a Win7 i7 computer with 16 gigs of ram. I'm using NPVR to watch the programs and using a NPVR PostProcessing batch file. I'm giving you that batch file below just in case you see something that could be a problem:

@echo off

cd /d c:\comskip

echo %date%,%time% - PostProcessing.bat invoked on %1 recorded from channel %2 >>processing.log

Rem list of channels to not run comskip on; PBS channels have no commercials
if "%2" == "2008" goto eof
if "%2" == "2078" goto eof
if "%2" == "2091" goto eof
if "%2" == "2092" goto eof
if "%2" == "2093" goto eof
if "%2" == "2094" goto eof
if "%2" == "2095" goto eof
if "%2" == "2096" goto eof
if "%2" == "2097" goto eof
goto next

:skip
echo skipping comskip on %1; channel %2 in skip list >>processing.log
goto continue

:next
rem need to add a pause to avoid race conditions
echo --- sleeping %2 seconds to avoid simultaneous execution >>processing.log
sleep %2

rem check how many comskips are running; if 2 or more are running wait 1 minute and check again
rem the third parameter passed in npvr 1.5.36 and later is a unique recording oid number, so it makes a good filename to store the temporary count
:check
tasklist | find /c "comskip" > %3.txt
set /p count= <%3.txt
if %count% geq 2 (
echo ...%count% comskips running now, waiting 1 minute >>processing.log
sleep 60
goto check
)
del %3.txt

rem continuing now

Rem this trick also makes it possible to have dedicated comskip.ini file for certain channels.
rem if "%2" == "79" goto channel79
Rem use the default comskip.ini for all other channels
rem goto generic

rem :channel79
rem comskip --ini=channel79.ini %1
rem goto continue

:generic
echo %date%,%time% - invoking comskip on %1 >>processing.log
comskip %1
echo %date%,%time% - comskip finished with %1 >>processing.log

:continue

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

Re: Time to run ComSkip

Post by erik »

Please set in your comskip.ini
lowres=10
thread_count=4
for maximum speed.
and
verbose=10
and look at the log file.
For the moment do NOT enable hardware decoding as this run's slow

In the generated log file you will see a line that denotes the frames decoded and the fps realized
Report back this line
jimdarnell
Posts: 15
Joined: Sun May 10, 2015 6:14 pm

Re: Time to run ComSkip

Post by jimdarnell »

FILE PROCESSING COMPLETE 109633 FRAMES AT 2997
FILE PROCESSING COMPLETE 107797 FRAMES AT 2997

This is the information you asked for. The real question I have though is why ComSkip didn't start on either of these for 33 minutes. This program ran from 6-7 am and this is what the log file said:
Generated using donator Comskip 0.81.087
Time at start of run:
Thu Sep 03 07:33:33 2015

Is there something in the batch file that would cause a 30 minute delay in starting? By the way, I didn't understand the point about hardware acceleration. I don't know to start or turn that off.
mogulman
Posts: 52
Joined: Tue Dec 06, 2011 6:58 pm

Re: Time to run ComSkip

Post by mogulman »

jimdarnell wrote:FILE PROCESSING COMPLETE 109633 FRAMES AT 2997
FILE PROCESSING COMPLETE 107797 FRAMES AT 2997

This is the information you asked for. The real question I have though is why ComSkip didn't start on either of these for 33 minutes. This program ran from 6-7 am and this is what the log file said:
Generated using donator Comskip 0.81.087
Time at start of run:
Thu Sep 03 07:33:33 2015

Is there something in the batch file that would cause a 30 minute delay in starting? By the way, I didn't understand the point about hardware acceleration. I don't know to start or turn that off.
I see the following as part of the batch file, so the batch file is design to sleep for some amount of time before running comskip. There is some parameter passed in as an argument when the batch file is run.

You could look at the processing.log file to see how many seconds it is set for.

rem need to add a pause to avoid race conditions
echo --- sleeping %2 seconds to avoid simultaneous execution >>processing.log
sleep %2
jimdarnell
Posts: 15
Joined: Sun May 10, 2015 6:14 pm

Re: Time to run ComSkip

Post by jimdarnell »

That %2 was the problem. It was setting a pause in seconds equivalent to the channel number which is these cases were in the 2000 range, leading to a pause of 33+ minutes. I changed the sleep %2 to sleep 15 which means it only pauses for 15 seconds. I got help on this from several members of the NPVR forum which is excellent in helping with NPVR, etc. problems.
Post Reply