NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Wishlist v
« Previous 1 … 15 16 17 18 19 … 193 Next »
NScriptHelper.exe command to return # of active recordings

 
  • 0 Vote(s) - 0 Average
NScriptHelper.exe command to return # of active recordings
BrettB
Offline

Posting Freak

Saint Paul, MN, USA
Posts: 2,667
Threads: 170
Joined: Jun 2007
#1
2017-02-27, 01:42 PM
Would you consider adding an option for NScriptHelper.exe that would return the number of currently active recordings?

With pre- and post-padding overlap (primarily on hour show changeover times), I'm semi-frequently seeing 6+ recordings going on simultaneously. When you add in 1 playback stream and 1 or 2 comskip batches, it seems that the main recording drive is sometimes being overwhelmed. I already throttle the comskip processing to limit it to 2 concurrent processes all the time. But I was thinking that possibly limiting it to 1 (or 0) when the number of active recordings is above a certain count might help. Making that change to my script would be fairly easy if NScripthelper.exe could return the current active recording count.
HarryH3
Offline

Posting Freak

U.S.A
Posts: 925
Threads: 56
Joined: Mar 2006
#2
2017-02-27, 05:35 PM (This post was last modified: 2017-02-27, 05:44 PM by HarryH3.)
I have recently noticed a problem in my PostProcessing.bat script that occasionally lets too many instances of comskip run. It causes any video being watched at the same time to stutter badly. It isn't the fault of NPVR, but of the PostProcessing.bat script that I have running. Could this be happening to your system as well?

Here's a script that I borrowed from this forum a few years back. IIRC, johnsonx42 wrote it. I modded it to invoke only a single instance of comskip at a time because comskip is horribly slow on Comcast's new mpeg4 videos if I enable "play nice" in comskip.ini, even with the paid version. Sad However, I'm seeing that when shows end at the same time, with channel numbers that are close to each other, then more than one instance of comskip that be started by the script before the script checks again to see if comskip is already running. When multiple instances of comskip are running full speed ahead they can overwhelm the disk subsystem.

Here's the script I'm using, followed by a snippet of the log file that shows where the channel numbers (used to define the pause duration) are close enough to each other that they finish their pause within the same 1-minute wait window and the script kicks off 2 at once.

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

Rem list of channels to not run comskip on; PBS channels have no commercials
if "%2" == "608" goto skip
Rem if "%2" == "28" goto skip

goto next

:skip
echo skipping comskip on %1; channel %2 because it is in skip list >>PostProcessing.log
goto continue

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

rem check how many comskips are running; if 1 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 1 (
  echo ...%count% comskips running now, waiting 1 minute >>PostProcessing.log
  timeout 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 >>PostProcessing.log
comskip %1
echo %date%,%time% - comskip finished with %1 >>PostProcessing.log

:continue

:eof

Log file with timing problem underlined:

Code:
Fri 02/24/2017,[B][U]20:03:00.59[/U][/B] - PostProcessing.bat invoked on "F:\GB-PVR Video\The Vampire Diaries\The.Vampire.Diaries.S08E14.Its.Been.a.Hell.of.a.Ride.ts" recorded from channel 605
  [B[U]]---  sleeping 605 seconds to avoid simultaneous execution [/U][/B]
Fri 02/24/2017,[B][U]20:03:00.60[/U][/B] - PostProcessing.bat invoked on "F:\GB-PVR Video\MacGyver\MacGyver.S01E17.Ruler.ts" recorded from channel 611
  [B][U]---  sleeping 611 seconds to avoid simultaneous execution[/U][/B]
[B][U]Fri 02/24/2017,20:03:01.18 - invoking comskip on "F:\GB-PVR Video\The Vampire Diaries\The.Vampire.Diaries.S08E14.Its.Been.a.Hell.of.a.Ride.ts"
Fri 02/24/2017,20:03:01.22 - invoking comskip on "F:\GB-PVR Video\MacGyver\MacGyver.S01E17.Ruler.ts" [/U][/B]

Fri 02/24/2017,20:23:43.35 - comskip finished with "F:\GB-PVR Video\The Vampire Diaries\The.Vampire.Diaries.S08E14.Its.Been.a.Hell.of.a.Ride.ts"
Fri 02/24/2017,20:37:54.97 - comskip finished with "F:\GB-PVR Video\MacGyver\MacGyver.S01E17.Ruler.ts"
Fri 02/24/2017,[B]21:03:01.06 - PostProcessing.bat invoked on "F:\GB-PVR Video\Sleepy Hollow\Sleepy.Hollow.S04E08.Sick.Burn.ts" recorded from channel 609
[B][U]  ---  sleeping 609 seconds to avoid simultaneous execution [/U][/B]
Fri 02/24/2017,21:03:01.27 - invoking comskip on "F:\GB-PVR Video\Sleepy Hollow\Sleepy.Hollow.S04E08.Sick.Burn.ts"
Fri 02/24/2017,21:[B]03:01.91[/B] - PostProcessing.bat invoked on "F:\GB-PVR Video\Hawaii Five-0\Hawaii.Five-0.S07E18.E.Malama.Pono.ts" recorded from channel 611
  [B][U]---  sleeping 611 seconds to avoid simultaneous execution [/U][/B]
...1 comskips running now, waiting 1 minute
Fri 02/24/2017,21:03:02.79 - PostProcessing.bat invoked on "F:\GB-PVR Video\Reign\Reign.S04E03.Leaps.of.Faith.ts" recorded from channel 605
[B][U] ---  sleeping 605 seconds to avoid simultaneous execution[/U][/B]
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
...1 comskips running now, waiting 1 minute
Fri 02/24/2017,21:09:50.06 - comskip finished with "F:\GB-PVR Video\Sleepy Hollow\Sleepy.Hollow.S04E08.Sick.Burn.ts"
[B][U]Fri 02/24/2017,21:10:02.38 - invoking comskip on "F:\GB-PVR Video\Reign\Reign.S04E03.Leaps.of.Faith.ts"
Fri 02/24/2017,21:10:02.39 - invoking comskip on "F:\GB-PVR Video\Hawaii Five-0\Hawaii.Five-0.S07E18.E.Malama.Pono.ts" [/U][/B]
Fri 02/24/2017,21:25:05.17 - comskip finished with "F:\GB-PVR Video\Reign\Reign.S04E03.Leaps.of.Faith.ts"
Fri 02/24/2017,21:25:41.53 - comskip finished with "F:\GB-PVR Video\Hawaii Five-0\Hawaii.Five-0.S07E18.E.Malama.Pono.ts"

Anyone have an idea of how to better manage the pauses so that the system can't start more than the number specified in the script?
i3-3570k, 8GB RAM, Win10 Pro, Nvidia GT710, HDHomeRun (OTA), NPVR 6.x
On a clear disk, you can seek forever...
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Web display of Recordings w/o Pending Recordings turndave 5 976 2023-09-13, 10:08 PM
Last Post: turndave
  Execute command to specific device when stream is exited boukmandutty 6 1,118 2023-06-09, 12:09 PM
Last Post: mvallevand
  subtract time from recordings for web client jobby99 0 551 2023-05-28, 09:09 PM
Last Post: jobby99
  Divide Recordings by Channel (and other properties) ChaosMageX 1 708 2023-03-20, 07:35 PM
Last Post: mvallevand
  [Kodi] Directory Folders for Recordings Panic 14 3,017 2022-07-28, 03:59 PM
Last Post: mvallevand
  Resume on recordings mvallevand 13 2,861 2022-05-02, 08:04 PM
Last Post: artmetz
  Add 'emptyepgonly' to nscripthelper cbdavi19 15 2,667 2022-02-28, 12:18 AM
Last Post: cbdavi19
  direct bookmarkable URL for Recent Recordings f0945a5662 2 989 2021-11-18, 07:50 PM
Last Post: f0945a5662
  Cancellation of individual pending recordings Petrovski 25 8,399 2021-11-07, 06:49 PM
Last Post: sub
  Feature request (recordings calendar view) ThymeJ 1 2,317 2021-09-19, 04:44 AM
Last Post: sub

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

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

Linear Mode
Threaded Mode