2009-10-14, 07:23 PM
Folks,
I've create a util for use within batch files (mostly postprocessing.bat) that will put the batch file to sleep for a random period.
I created this as often JavaWiz Rename programme often errors when attempts to update the GBPVR database. I realised that it's because I'd completed two recording the I was executing two versions of WizRename and they where tripping over each other...
So how to use it...
just put randomsleep.exe into the batch file and it will stop for a random period.
Commandline Usage :-
Randomsleep.exe ... sleeps for a random period. max is 5 seconds
Randomsleep.exe 6000 ... sleeprs for random period max is 6 seconds.
RandomSleep.exe /? - the help screen.
How to use this :-
Here a copy of my postprocessing.bat :-
@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 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
: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\)
comskip %1
call Comclean %1 >>Comclean.log 2>>Comclean.err
RandomSleep
REM RenameRecording.exe -t %1 > rename.log
WizRenameRecording.exe "%1" "{show} {episode}"
:continue
Rem Once the commercials have been identified you can run comclean to delete the commercials from the recording.
Rem Do this only when you are not using the Skip function in the GBPVR viewer.
Rem To enable comclean remove the word "Rem" from the following line.
rem call comclean %1
:eof
I've create a util for use within batch files (mostly postprocessing.bat) that will put the batch file to sleep for a random period.
I created this as often JavaWiz Rename programme often errors when attempts to update the GBPVR database. I realised that it's because I'd completed two recording the I was executing two versions of WizRename and they where tripping over each other...
So how to use it...
just put randomsleep.exe into the batch file and it will stop for a random period.
Commandline Usage :-
Randomsleep.exe ... sleeps for a random period. max is 5 seconds
Randomsleep.exe 6000 ... sleeprs for random period max is 6 seconds.
RandomSleep.exe /? - the help screen.
How to use this :-
Here a copy of my postprocessing.bat :-
@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 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
: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\)
comskip %1
call Comclean %1 >>Comclean.log 2>>Comclean.err
RandomSleep
REM RenameRecording.exe -t %1 > rename.log
WizRenameRecording.exe "%1" "{show} {episode}"
:continue
Rem Once the commercials have been identified you can run comclean to delete the commercials from the recording.
Rem Do this only when you are not using the Skip function in the GBPVR viewer.
Rem To enable comclean remove the word "Rem" from the following line.
rem call comclean %1
:eof
Regards Systemshark
[COLOR="Silver"]
Lounge: HDPC Intel i5, Asus Motherboard with Intel HDMI, 4Gb of Ram, 1Tb Disk, 60Gb SSD, Blackgold BT3595 Tuner, Hauppauge Nova T500 and HVR1700 in a LianLi C39 B Case.
Other Room : Liteon Wireless Media Centre/DVD Player
Software : Windows7 32 Bit, RedRat, XMLTV GUI and NPVR [/COLOR]
[COLOR="Silver"]
Lounge: HDPC Intel i5, Asus Motherboard with Intel HDMI, 4Gb of Ram, 1Tb Disk, 60Gb SSD, Blackgold BT3595 Tuner, Hauppauge Nova T500 and HVR1700 in a LianLi C39 B Case.
Other Room : Liteon Wireless Media Centre/DVD Player
Software : Windows7 32 Bit, RedRat, XMLTV GUI and NPVR [/COLOR]