Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: PostProcessing.bat not executing

  1. #1
    Join Date
    Dec 2014
    Location
    USA
    Posts
    9

    PostProcessing.bat not executing

    NextPVR v4.2.4 (190307)
    Windows 10

    In NRecord.log I see PostProcessing.bat script triggering, but nothing happens.

    Example:
    Code:
    2019-08-19 20:00:00.933	[DEBUG][10]	Starting: C:\Users\Public\NPVR\Scripts\PostProcessing.bat "F:\NextPVR_Temp_Recordings\Evening\Evening_20190819_19302000.ts" 5.1 26652 20 "Evening"
    My PostProcessing.bat

    Code:
    cd /d "C:\Program Files (x86)\Plex\Plex Media Server\"
    "Plex Media Scanner.exe" --scan --refresh --section 1
    Tested putting just this line
    Code:
    "C:\Windows\System32\notepad.exe"
    in the PostProcessing.bat to see if Notepad would launch but it never does after a recording. However, if I manually double click on the script it works fine. PostProcessing.bat was working before for the past few years, not sure what changed in windows or if it has anything to do with updating NextPVR.
    Attached Files Attached Files
    Last edited by MiyoshiSaki; 2019-08-20 at 05:24 AM.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    If that message is in the log, then it is absolutely running your batch file, and using the parameter listed. (trust me, we've been through this a stack of times in the past, and every single time NextPVR has been running the users bat files, but there is something flaw with what they're trying to do within the batch file)

    When the recording service runs this batch file, it's run using the same account the recording service runs as. ie, the default account is the 'localsystem' account. This is run from a service, which is kind of an isolated background session, so you wouldn't see notepad.exe popup on your desktop.

    I don't know anything about 'plex media scanner.exe', but it might have some expectation about where its data files lives, or registry settings that are in your account not 'localsystem', and there might be some permission issues around this when run from the 'localsystem' account. Your best bet is probably to redirect the output of that command to a text file somewhere, so you can check it after the fact to see what output this generated. I'm guessing it's giving you some error message about permissions, or not being able to find some files or something.

    Because this has been issue for several users in the past, in NextPVR v5 it captures output of these batch files, and logs them, so it's much easier for use to fin errors that come out of users custom batch files.

  3. #3
    Join Date
    Dec 2014
    Location
    USA
    Posts
    9
    Quote Originally Posted by sub View Post
    Your best bet is probably to redirect the output of that command to a text file somewhere, so you can check it after the fact to see what output this generated. I'm guessing it's giving you some error message about permissions, or not being able to find some files or something.
    What commands so I add to the PostProcessing.bat to output to text file?

  4. #4
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Probably put something like this:

    "Plex Media Scanner.exe" --scan --refresh --section 1 1> c:\temp\scanner.txt 2>&1

  5. #5
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Depending on what error that command is returning, you could look into switching the recording service to run as your user account instead of localsystem.

  6. #6
    Join Date
    Dec 2014
    Location
    USA
    Posts
    9
    Quote Originally Posted by sub View Post
    Probably put something like this:

    "Plex Media Scanner.exe" --scan --refresh --section 1 1> c:\temp\scanner.txt 2>&1
    Added 1> c:\temp\scanner.txt 2>&1 to my postprocessing.bat

    Found out the "Plex Media Scanner.exe" does start running, seems to terminate prematurely, only 1-2 lines of output to scanner.txt. Plex logs also show it not completing. Weird.

    However, if postprocessing.bat is executed manually by me then it completes with many lines of output to scanner.txt and works fine.

    Tried switching the "NPVR recording service" to Log On As normal user instead of Local Service. Rebooted. No different. Same issue.

    Any other ideas?

  7. #7
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Sorry, I really don't know anything about this "Plex Media Scanner.exe". I'm not sure what it might been looking for. Do the Plex logs not give any useful clues? Otherwise you might need to try asking the Plex guys, and let them know what log messages you get before it crashes.

  8. #8
    Join Date
    Dec 2014
    Location
    USA
    Posts
    9
    Changed "NPVR recording service" to Log On As a normal user instead of Local Service & rebooted.

    Tested adding notepad.exe to postprocesing.bat but it doesn't launch notepad to the desktop environment. Does that mean it isn't running as normal user?

  9. #9
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,171
    No you need to run command line problems in postprocessing not gui apps.

    Martin

  10. #10
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Quote Originally Posted by MiyoshiSaki View Post
    Tested adding notepad.exe to postprocesing.bat but it doesn't launch notepad to the desktop environment. Does that mean it isn't running as normal user?
    It's still running as a service, which is in a different background desktop session. You wouldn't see it pop up on your desktop.

    As Martin says above, you need to running command line stuff, not GUI apps.

    You did get a couple of lines of text in your scanner.txt, so you definitely know NextPVR is running your batch file. Trying to run notepad.exe wont help you any further with that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •