NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) Slimm GB-PVR and GBPVRcli v
« Previous 1 2 3 4 Next »
request: {MinutesToStart} for gbpvrcli

 
  • 0 Vote(s) - 0 Average
request: {MinutesToStart} for gbpvrcli
pvruser
Offline

Member

Posts: 230
Threads: 42
Joined: May 2007
#11
2007-10-02, 11:14 PM
yes works great! added it to the script instead of K.S.'s calculations (though still using the for to get the tokens).
i'll probably need to refine it a bit but for now it serves its purpose Big Grin

thanks again!
GBPVR 1.4.7
3 x HVR-950Q USB OTA ATSC HD TUNER
T2250 @ 2.5 GB RAM + ASUS Moca-AR Calcite
Roku HD + XD
K.S.
Offline

Senior Member

Posts: 526
Threads: 12
Joined: Oct 2006
#12
2007-10-04, 03:54 PM
pvruser Wrote:yes works great! added it to the script instead of K.S.'s calculations (though still using the for to get the tokens).

shame on you! you've dared to drop my hack in favor of a newly-built-in feature! Big Grin
glad you found the time to muse over my batch, it's the fun part where you learn something new Wink
sub Wrote:Yep, what he said.

curiosity killed the cat Big Grin
pvruser
Offline

Member

Posts: 230
Threads: 42
Joined: May 2007
#13
2007-10-05, 01:56 AM
i know it can be improved but anyway here's my PostProcessing.bat script:

Quote:@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 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

REM Cancel any Shutdown session
psshutdown -a

set gbpvr_dir=%ProgramFiles%\devnz\gbpvr

set logfile="%gbpvr_dir%\logs\postproc.log"
SET checkfile="%gbpvr_dir%\progress.txt"

rem flags to be used for standby decision
set recording_pending=no
set time_to_recording=30
set transcoding_now=yes

echo finished recording... channel %2, file %1... checking if we need to sleep... >> %logfile%
date /t >> %logfile%
time /t >> %logfile%

REM clean up temporary files
del %checkfile%

rem decide how to handle recordings based on chan rez and possibly name or other things like that
rem make sure HD recordings that you want to keep as HD do NOT go to conversion!
echo %2 %1
rem fox2 == 80
if "%2" == "80" call Confused_720p2sd %1
rem cw50 == 87
if "%2" == "87" call Confused_1080i2sd %1
rem cbs62 == 91
if "%2" == "91" call Confused_1080i2sd %1

rem dont standby if file no_sleep.txt exists - just exit - computer will run until user decides
if exist "no_sleep.txt" goto nosleep

rem wait for another consecutive recording to start (assuming we didnt transcode)
ping -n 5 127.0.0.1

REM Check for recording in progress
echo checking if another recording in progress...
"%gbpvr_dir%\gbpvrcli.exe" /inprogress 1 /mes "{Status}\n{Title}\n{DescriptionNoWrap}\n\n" > %checkfile%

rem wait for gbpvrcli.exe to finish... maybe add start /wait to upper option?
ping -n 5 127.0.0.1

rem see if anything is being recorded now (file of non zero length)
rem echo before running progress
rem we have "progress" so do nothing
find /c "progress" %checkfile% && goto data
rem echo after running progress


rem echo before running pslist
rem make sure other ffmpeg tasks NOT running before shutting down
pslist ffmpeg > "%~dpn1running.txt"
find /c "not found" "%~dpn1running.txt" && set transcoding_now=no
rem echo after running pslist
rem del "%~dpn1running.txt"


rem check if any recording pending soon
for /F "tokens=1,2,3,4,5 delims=#" %%a in ('gbpvrcli.exe /pending 1 /message "{MinutesToStartWithPadding}#{MinutesToEndWithPadding}#{RecordingLengthWithPadding}#{StartTimeWithPadding}#{Title}"') do (

rem Setlocal EnableDelayedExpansion needed to get the current values inside for-loop
Setlocal EnableDelayedExpansion

if %%a LSS %time_to_recording% (
echo %%e pending recording in %%a minutes at %%d
echo %%e pending recording in %%a minutes at %%d >> %logfile%

rem Endlocal needs to be set inside the for-loop to preserve the pending_recording value beyond for-loop
Endlocal
set recording_pending=yes
)
)


if %transcoding_now%==no if %recording_pending%==no (
rem nothing happening now - sleep!
goto empty
)

rem any other case means its recording/transcoding/pending recording soon
GOTO data



:empty
echo not recording...
echo nothing is currently recording or transcoding... standby in 5 minutes... >> %logfile%
date /t >> %logfile%
time /t >> %logfile%
del "%~dpn1running.txt"
del %checkfile%
rem make sure we dont get double shutdown!
psshutdown -a
rem standby interactive 5 minutes
psshutdown -d -c -t 300
goto end


:data
echo recording or transcoding... do nothing
echo still recording or transcoding... no standby yet... >> %logfile%
type "%~dpn1running.txt" >> %logfile%
del "%~dpn1running.txt"
type %checkfile% >> %logfile%
del %checkfile%

date /t >> %logfile%
time /t >> %logfile%

goto end


rem sub for converting 720p to sd (remove side pillars)
Confused_720p2sd
echo transcode 720p %1
echo transcode 720p %1 >> %logfile%
psshutdown -a
rem convert low priority to allow normal use of windows
rem this does not work --- start /low /wait /b /d".\Third Party\FFmpeg\"
".\Third Party\FFmpeg\ffmpeg.exe" -y -i %1 -b 4000k -ab 128k -r 29.97 -s 1024x490 -f svcd -cropleft 160 -cropright 160 -croptop 10 -aspect 4:3 -async 15 -threads 8 "%~dpn1temp.mpg" >> "logs\%~n1ffmpeg.log" 2>&1
rem this keeps recording
ren %1 "x%~nx1"
rem use same name to avoid need for database updates
ren "%~dpn1temp.mpg" "%~nx1"

goto end


rem sub for converting 1080i to sd (remove side pillars)
Confused_1080i2sd
echo transcode 1080i %1
echo transcode 1080i %1 >> %logfile%
psshutdown -a
rem convert low priority to allow normal use of windows
rem this does not work --- start /low /wait /b /d".\Third Party\FFmpeg\"
".\Third Party\FFmpeg\ffmpeg.exe" -y -i %1 -b 4000k -ab 128k -r 29.97 -s 1184x500 -f svcd -cropleft 240 -cropright 240 -croptop 20 -aspect 4:3 -async 15 -threads 8 "%~dpn1temp.mpg" >> "logs\%~n1ffmpeg.log" 2>&1
rem this keeps recording
ren %1 "x%~nx1"
rem use same name to avoid need for database updates
ren "%~dpn1temp.mpg" "%~nx1"

goto end

:nosleep
echo sleep disabled (found no_sleep.txt)... do nothing
echo sleep disabled (found no_sleep.txt)... do nothing >> %logfile%
date /t >> %logfile%
time /t >> %logfile%
del "%~dpn1running.txt"
del %checkfile%

goto end


:end
GBPVR 1.4.7
3 x HVR-950Q USB OTA ATSC HD TUNER
T2250 @ 2.5 GB RAM + ASUS Moca-AR Calcite
Roku HD + XD
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  gbpvrCLI Formatting Tuner Status possible? martint123 2 5,786 2010-05-27, 04:55 PM
Last Post: martint123
  GBPVRCLI pending list problem (v1.7.3245.23786) b00sfuk 3 6,965 2010-05-23, 08:55 PM
Last Post: martint123
  gbpvrcli and lcd smartie few questions ryanmc 8 12,476 2009-09-15, 01:39 PM
Last Post: Sykor
  Need to check for Live TV with GBPVRcli keith_leitch 3 6,234 2009-05-28, 04:00 PM
Last Post: Mister Slimm
  What are the options for GBPVRCLI? keith_leitch 3 6,443 2009-02-03, 08:50 PM
Last Post: keith_leitch
  Request: Playback Info Dava 2 3,288 2008-08-15, 08:49 AM
Last Post: Dava
  Request: Maintenance Mode for xx (sec/minutes) JavaWiz 2 2,960 2007-10-04, 10:02 AM
Last Post: Mister Slimm
  Disable Request to Delete Recording betbest1 3 3,214 2007-06-01, 11:21 AM
Last Post: Mister Slimm
  GBPVRcli - extract information from GB-PVR for use in batch and text files Mister Slimm 2 9,514 2007-02-20, 01:40 PM
Last Post: Mister Slimm

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

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

Linear Mode
Threaded Mode