NextPVR allows you to use Windows batch files to apply custom logic and perform tasks before and after certain operations.
On this page... (hide)
Where to put them
Batch files should be stored in the Scripts\ directory under the data directory.
How to create them
Batch files are just regular text files and can be created using Notepad but saving '.bat' instead of '.txt'. As a batch file is a list of Windows/DOS commands there's a lot of help on the internet regarding authoring batch files and what they can do.
Batch files executed by NextPVR:
NextPVR will run (execute) these named batch files if present.
ParallelProcessing.bat
Run as soon as a recording begins. Commonly used for adding commercial skipping functionality (comskip).
Arguments:
- filename - the full path and file name of the recording file.
- channel number - the channel number it is recording from.
- oid - unique identifier to the scheduled_recordings table, applicable even if filename (%1) changes
- capture Oid - unique identifier to the device used for recording
- recording title - the title of the recording
PostProcessing.bat
Run as soon as a recording ends. Commonly used for adding commercial skipping functionality (comskip) or transcoding.
Arguments:
- filename - the full path and file name of the recording file.
- channelNumber - the channel number it was recorded from.
- oid - unique identifier to the scheduled_recordings table, applicable even if filename (%1) changes
- capture Oid - unique identifier to the device used for recording
- recording title - the title of the recording
PostCancel.bat
Run when a recording is cancelled while recording.
Arguments:
- filename - the full path and file name of the recording file.
- channel number - the channel number it was recorded from.
- oid - unique identifier to the scheduled_recordings table, applicable even if filename (%1) changes
- capture Oid - unique identifier to the device used for recording
- recording title - the title of the recording
UpdateEPG.bat
Run when the EPG update begins at the time specified in Settings. Commonly used to update an XMLTV file used as the EPG source. No arguments.
PostUpdateEPG.bat
Run once the update EPG operation has completed. Commonly used for other nightly maintenance/update tasks and with EPG processing enhancement tools. No arguments.
Wakeup.bat
Run after the PC resumes from sleep, before any recordings are started. No arguments.
PreArchive.bat
Arguments:
- source file - the full path and file name of the file to be archived.
- destination file - the full path and file name where the file will be archived to.
- recording oid - unique identifier to the scheduled_recordings table
PostArchive.bat
Arguments:
- source file - the full path and file name of the file to be archived.
- destination file - the full path and file name where the file will be archived to.
- recording oid - unique identifier to the scheduled_recordings table
Tips
Most of these scripts are run by the Recording Service which runs as 'Local System', not your normal desktop user. Among other things, mapped network drives will not be there. Use \\server\sharename or \\ip\sharename instead. Additionally, when a script runs the working directory is NOT what you think it is! Begin all scripts with a "cd" command to set the working directory. example cd /d c:\comskip or cd /d e:\mc2xml or even cd /d "%~dp0" if you just want to run in the scripts directory.
Templates
This is a set of batch file templates provided by JavaWiz.
"They don't do much except log when they are called and in some cases call IGL to rename or update the EPG. It may be useful to new users who are trying to understand how the hooks work...."
Download:NextPVR_BatchFileTemplates.zip (0 downloads)
Examples
These are examples of batch files which perform NextPVR related tasks. Some users have also posted batch files they use on the forums.
Awaiting user submitted examples...
Page last modified on October 31, 2015, at 08:25 PM