NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 168 169 170 171 172 … 433 Next »
ComSkip question

ComSkip question
jd1940
Offline

Senior Member

Posts: 346
Threads: 64
Joined: Sep 2010
#1
2015-09-03, 08:04 PM (This post was last modified: 2015-09-03, 08:05 PM by jd1940.)
I'm running the Johnson42 comskip batch file and everything is working fine EXCEPT everyone of the programs is experiencing a 30 minute delay before processing starts. I'm listing the batch file below in the hope someone will see some setting I've gotten wrong that would cause this:

@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

Confusedkip
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
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,786
Threads: 769
Joined: Nov 2003
#2
2015-09-03, 08:06 PM
PostProcessing.bat is run as soon as the recording completes.

Maybe look around the middle of your batch files, where you're doing logic to limit the maximum number of concurrent instances of comskip.
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#3
2015-09-03, 08:25 PM
You are sleeping <channelnumber> of seconds before processing starts, so if you have high channelnumbers you have a long sleep Smile. I changed mine to 15 seconds.

"I'd rather have a bottle in front of me than a frontal lobotomy"
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,786
Threads: 769
Joined: Nov 2003
#4
2015-09-03, 08:31 PM
Ah true - didn't notice that. Big Grin
jd1940
Offline

Senior Member

Posts: 346
Threads: 64
Joined: Sep 2010
#5
2015-09-03, 08:34 PM (This post was last modified: 2015-09-03, 08:46 PM by jd1940.)
Yes, that would do it. All of these channels are in the 2000 range. So, I should change sleeping %2 seconds to 15 seconds?

Edit: Upon reflection it looks as if I should change the line right below the one I just listed to-- sleep 15
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#6
2015-09-03, 08:57 PM
jd1940 Wrote:Yes, that would do it. All of these channels are in the 2000 range. So, I should change sleeping %2 seconds to 15 seconds?

Edit: Upon reflection it looks as if I should change the line right below the one I just listed to-- sleep 15
That's what I did.

"I'd rather have a bottle in front of me than a frontal lobotomy"
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#7
2015-09-04, 12:59 AM
the sleep is meant to make sure simultaneous recordings on different channels don't start processing at exactly the same time. I originally put it in there to work around some race-conditions I was seeing, but it may no longer be necessary. sleeping for 15 seconds before starting is probably a good idea anyway, just to let the recording get started cleanly and wait for additional recordings being started at the same time to settle in as well.

for anyone else reading along, note that the sleep command is not part of windows, it came from the Windows NT Resource Kit. Modern versions of Windows now have the "timeout" command built-in which you can use in place of sleep.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#8
2015-09-04, 01:25 AM
here's the current version that I run as parallelprocessing.bat; not much difference that I can see. it does put the logging in the scripts directory (%~dp0) even though it's running in the comskip directory. sometimes I like that, sometimes I don't. I made the logging a little more verbose in spots, I rarely look at it but every now and then it helps (though conversely I seem to have decided I don't always want to see the full path name of the recording file, even though I have 3 recording locations? that seems odd). I guess I ought to update that list of PBS channels, I use major.minor channel numbers now so most of them are wrong.
the other change is that I dump the runtime stdout of comskip to %3.log. from time to time I've had problems with comskip, so it's been useful a times to go see what it dumped to stdout; yes, the files do pile up in the scripts directory, I periodically delete them but it would take probably 100 years of recordings before the accumulated log files would actually cause a problem.
Code:
@echo off

cd c:\users\public\npvr\comskip

echo %date%,%time% - %~n1 (%3) recording from channel %2 on tuner %4 >>"%~dp0\recording.log"

Rem list of channels to not run comskip on; PBS channels have no commercials
if "%2" == "27" goto skip
if "%2" == "28" goto skip
if "%2" == "29" goto skip
if "%2" == "50" goto skip
if "%2" == "51" goto skip
if "%2" == "52" goto skip
if "%2" == "53" goto skip
if "%2" == "58" goto skip
if "%2" == "59" goto skip
if "%2" == "60" goto skip
if "%2" == "61" goto skip

goto next

:skip
echo skipping comskip on %~n1; channel %2 in skip list >>"%~dp0\recording.log"
goto continue

:next
echo   ---  sleeping %2 seconds to avoid simultaneous execution >>"%~dp0\recording.log"
sleep %2

:check
tasklist | find /c "comskip" > %3.txt
set /p count= <%3.txt
if %count% geq 3 (
  echo ...%count% comskips running now, waiting 1 minute >>"%~dp0\recording.log"
  sleep 60
  goto check
)
del %3.txt

rem continuing now

:generic
echo %date%,%time% - invoking comskip on %1 (%3)>>"%~dp0\recording.log"
comskip %1 >>"%~dp0\%3.log"
echo %date%,%time% - comskip finished with %1 (%3)>>"%~dp0\recording.log"

:continue

rem there was logic here to rename the recording, but now that NPVR uses S01E01 style naming it's all gone

:eof
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
jd1940
Offline

Senior Member

Posts: 346
Threads: 64
Joined: Sep 2010
#9
2015-09-04, 05:42 AM
Thanks to everyone for the help. All is working fine now.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Comskip Playback Odd Behavior kirschey 3 1,736 2021-09-27, 06:16 PM
Last Post: sub
  Fast-forward and comskip issues manic_biker 11 3,935 2021-07-12, 02:17 AM
Last Post: Robazz
  changing channels in guide - stupid user question mt900spg 2 1,610 2019-12-19, 01:30 PM
Last Post: mvallevand
  Comskip edl files ignored dbguru 3 2,263 2019-10-24, 06:11 PM
Last Post: mvallevand
  Question about Channel Changing hdpvr-doug8796 6 2,501 2019-10-09, 06:24 PM
Last Post: hdpvr-doug8796
  Series/Episode question Bobins 4 1,764 2019-06-27, 08:50 PM
Last Post: sub
  Archive question Bobins 3 1,570 2019-05-23, 12:30 PM
Last Post: ElihuRozen
  Another Skinning question - Ready Recordings bar Rage321 11 2,960 2019-04-26, 12:51 PM
Last Post: mvallevand
  Skinning question - Adding more listings, making it fit Rage321 3 1,533 2019-04-21, 01:05 AM
Last Post: Rage321
  Rebuilt on New Hardware // Decoder Question rowle1jt 8 2,484 2019-03-14, 12:06 PM
Last Post: rowle1jt

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode