Issue-
cscript call in PostProcessing.bat works fine when I run PostProcessing.bat from a command prompt.
However, this same cscript call (to clean commercials using VideoRedo) does not work when NPVR calls it.
For instance, I can open up a command prompt and run:
PostProcessing.bat "D:\Recorded TV\Manual Recordings\3 WJXT_20101103171500.ts" 3
And everything works fine. Vprj gets created by comskip, VideoRedoCut.vbs correctly runs videoredo.exe and everything works.
When NPVR executes my PostProcessing.bat file, comskip creates vprj file, and then I can see (through numerous wscript.echo statements) that the VideoRedoCut.vbs script bombs out when it tries to create an object in the script (line of code in that blows up :::: Set VideoReDoSilent = WScript.CreateObject( "VideoReDo.VideoReDoSilent" ).
What could be causing this and are there any solutions?
ALSO, why can I not see a command window when NPVR runs my PostProcessing.bat file? When I try to use PAUSE statements in my PostProcessing.bat to debug, I cannot see what is going on. Is NPVR hiding the command window when it runs PostProcessing.bat?
Thanks for any help....
PostProcessing.bat:
cscript call in PostProcessing.bat works fine when I run PostProcessing.bat from a command prompt.
However, this same cscript call (to clean commercials using VideoRedo) does not work when NPVR calls it.
For instance, I can open up a command prompt and run:
PostProcessing.bat "D:\Recorded TV\Manual Recordings\3 WJXT_20101103171500.ts" 3
And everything works fine. Vprj gets created by comskip, VideoRedoCut.vbs correctly runs videoredo.exe and everything works.
When NPVR executes my PostProcessing.bat file, comskip creates vprj file, and then I can see (through numerous wscript.echo statements) that the VideoRedoCut.vbs script bombs out when it tries to create an object in the script (line of code in that blows up :::: Set VideoReDoSilent = WScript.CreateObject( "VideoReDo.VideoReDoSilent" ).
What could be causing this and are there any solutions?
ALSO, why can I not see a command window when NPVR runs my PostProcessing.bat file? When I try to use PAUSE statements in my PostProcessing.bat to debug, I cannot see what is going on. Is NPVR hiding the command window when it runs PostProcessing.bat?
Thanks for any help....
PostProcessing.bat:
Code:
@echo off
Rem PostProcessing.bat
Rem This script will be run automatically by GBPVR when found after a recording is finished
Rem To enable it put this file inside your GBPVR default program directory (C:\Program Files\devnz\gbpvr\)
Rem together with Comskip.exe, Comskip.ini and Comskip.dictionary
Rem The script is called with two parameters
Rem %1 is the fully qualified name of the recorded mpeg file.
Rem %2 is the channel number of the recording
echo [%date% %time%] Postprocessing.bat invoked on %1 recorded from channel %2 >>postprocessing.log
Rem The part below can be used to not run Comskip on certain channels, please modify for your conveniance.
Rem The channel numbers that should be skipped are the numbers between the double quotes ("").
Rem You can add "if" lines as much as you want
Rem To disable this behaviour use channel numbers outside the normal range, put a "rem" before the "if" or delete the "if" lines
Rem list of channels to not run comskip on
rem if "%2" == "27" goto eof
rem if "%2" == "36" goto eof
Rem this trick also makes it possible to have dedicated comskip.ini file for certain channels.
rem if the filename contains 'Football' go to the sports comskip
rem if not %1:Football == %1 echo [%date% %time%] Starting comskip using sports.ini..... >>postprocessing.log
rem if not %1:Football == %1 goto sports
C:
cd "C:\Users\Public\NPVR\Scripts\comskip"
if %2 == 6 echo [%date% %time%] Starting comskip using cbs.ini..... >>postprocessing.log
if %2 == 6 goto cbs
if %2 == 5 echo [%date% %time%] Starting comskip using abc.ini..... >>postprocessing.log
if %2 == 5 goto abc
if %2 == 11 echo [%date% %time%] Starting comskip using nbc.ini..... >>postprocessing.log
if %2 == 11 goto nbc
Rem use the default comskip.ini for all other channels
goto generic
:sports
comskip --ini=sports.ini %1
goto continue
:cbs
comskip --ini=cbs.ini %1
goto continue
:abc
comskip --ini=abc.ini %1
goto continue
:nbc
comskip --ini=nbc.ini %1
goto continue
rem This is an example of how to reuse a previously learned logo to prevent Comskip from learning the wrong logo
comskip --ini=channel65.ini --logo=channel65.logo.txt %1
goto continue
:generic
Rem The actual run of Comskip. Only one parameter, the name of the mpeg file to process.
Rem Comskip will read its settings from the Comskip.ini found in the same directory as Comskip.exe
Rem Both are supposed to be in the GBPVR default program directory. (C:\Program Files\devnz\gbpvr\)
echo [%date% %time%] Using generic comskip.ini comskip..... >>postprocessing.log
comskip %1
:continue
echo [%date% %time%] Comskip complete..... >>postprocessing.log
echo [%date% %time%] Starting Cutting/Reassembling process..... >>postprocessing.log
cscript //nologo "C:\Users\Public\NPVR\Scripts\VideoRedoCut.vbs" "%~dpn1.VPrj" "%~dpn1_Cleaned.ts" /t1 /q >>postprocessing2.log
echo [%date% %time%] Cutting/Reassembling process complete..... >>postprocessing.log
Rem RENAME the old .ts file and rename the new one to the old name
rem echo "%~dpn1.ts"
rem echo "%~dpn1_cleaned.ts"
rem move "%~dpn1.ts" "%~dpn1_original.ts"
rem move "%~dpn1_cleaned.ts" "%~dpn1.ts"
rem echo [%date% %time%] File renaming complete..... >>postprocessing.log
echo [%date% %time%] Postprocessing.bat complete >>postprocessing.log
echo [%date% %time%] >>postprocessing.log
echo [%date% %time%] >>postprocessing.log
rem RenameRecordings %1 > renamerecordings.log
:eof