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) GB-PVR Support (legacy) v
« Previous 1 … 557 558 559 560 561 … 1231 Next »
more batch file help

 
  • 0 Vote(s) - 0 Average
more batch file help
agidius
Offline

Senior Member

Posts: 469
Threads: 77
Joined: Apr 2006
#1
2007-04-18, 11:50 PM
this week, I discovered that if 4 instances of mencoder are running at a time, the server decides to clock out and go home.
not everything I record is transcoded, but this week there was a marathon of shows that are.

how can I have the batch file check to see if it is already running??
I want to have the batch file check to see if mencoder.exe is running as a process.
if it is, I want it to wait a certian amount of time and check again.

just for kicks, here is my current postprocessing.bat

Code:
@echo off
cd c:\program files\devnz\gbpvr
sleep.exe 120

rem adds recorded show to RECORDED list
rectracker %1
sleep.exe 5

rem removed pending shows that are on RECORDED list
rectracker -purge
sleep.exe 5

rem ---------------------------------------------------

rem Checks available diskspace on the recordings drive and sends text message to my phone if it gets too low
cd c:\program files\devnz\gbpvr\disklimit
disklimit.exe -disk f -limit 25gb -messagefile PVRmessage.txt

rem ---------------------------------------------------

cd c:\program files\devnz\gbpvr

rem get first 8 letters of filename
SET RECORDING=%~n1
SET SHOW=%RECORDING:~0,8%

rem sends file to appropriate commands based on first 8 of filename
IF "%SHOW%"=="Battlest" GOTO GALACTICA
IF "%SHOW%"=="It Takes" GOTO THIEF
IF "%SHOW%"=="The Sara" GOTO SARAH
IF "%SHOW%"=="Bullrun_" GOTO BULLRUN
rem IF "%SHOW%"=="Planet E" GOTO PLANET

rem If none are true, Batch exits
GOTO END

rem ---------------------------------------------------

rem Commands for Battlestar Galactica
:GALACTICA

rem Transcodes the show and saves to G:\TEMP
start /low /wait C:\Progra~1\mplayer\mencoder.exe %1 -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128    -vf filmdint,softskip,scale=720:480,hqdn3d=3:2:3:3  -ofps 24000/1001 -o "G:\TEMP\%RECORDING%.avi"

rem Moves file to proper directory on website
MOVE "G:\TEMP\%RECORDING%.avi" "G:\HTTP\htdocs\shows\battlestar\%RECORDING%.avi"

GOTO WEBFREE


rem ---------------------------------------------------

rem Commands for It Takes a Thief
:THIEF


rem Transcodes the show while cutting out commercials and saves to G:\TEMP
if exist %~dpn1.edl copy %~dpn1.edl %~dpn1.ptl

start /low /wait C:\Progra~1\mplayer\mencoder.exe %1 -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128    -vf filmdint,softskip,scale=720:480,hqdn3d=3:2:3:3  -ofps 24000/1001 -o "G:\TEMP\%RECORDING%.avi"

rem Moves file to proper directory on website

MOVE "G:\TEMP\%RECORDING%.avi" "G:\HTTP\htdocs\shows\ItTakesAThief\%RECORDING%.avi"

GOTO WEBFREE

rem ---------------------------------------------------

rem Commands for The Sarah Silverman Program
:SARAH


rem Transcodes the show while cutting out commercials and saves to G:\TEMP
if exist %~dpn1.edl copy %~dpn1.edl %~dpn1.ptl

start /low /wait C:\Progra~1\mplayer\mencoder.exe %1 -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128    -vf filmdint,softskip,scale=720:480,hqdn3d=3:2:3:3  -ofps 24000/1001 -o "G:\TEMP\%RECORDING%.avi"

rem Moves file to proper directory on website
MOVE "G:\TEMP\%RECORDING%.avi" "G:\HTTP\htdocs\shows\SarahSilverman\%RECORDING%.avi"

GOTO WEBFREE

rem ---------------------------------------------------

rem Commands for Bullrun
:BULLRUN


rem Transcodes the show while cutting out commercials and saves to G:\TEMP
if exist %~dpn1.edl copy %~dpn1.edl %~dpn1.ptl

start /low /wait C:\Progra~1\mplayer\mencoder.exe %1 -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128    -vf filmdint,softskip,scale=720:480,hqdn3d=3:2:3:3  -ofps 24000/1001 -o "G:\TEMP\%RECORDING%.avi"

rem Moves file to proper directory on website
MOVE "G:\TEMP\%RECORDING%.avi" "G:\HTTP\htdocs\shows\Bullrun\%RECORDING%.avi"

GOTO WEBFREE

rem ---------------------------------------------------

rem Commands for Planet Earth
:PLANET


rem Transcodes the show while cutting out commercials and saves to G:\TEMP
if exist %~dpn1.edl copy %~dpn1.edl %~dpn1.ptl

start /low /wait C:\Progra~1\mplayer\mencoder.exe %1 -edl "%~dpn1.edl" -ovc xvid -xvidencopts bitrate=900:me_quality=6:chroma_me:noqpel:chroma_opt:vhq=4:bvhq=1:trellis:hq_ac:gmc:quant_type=mpeg:max_key_interval=240 -oac mp3lame -lameopts mode=2:cbr:br=128    -vf filmdint,softskip,scale=720:480,hqdn3d=3:2:3:3  -ofps 24000/1001 -o "G:\TEMP\%RECORDING%.avi"

rem Moves file to proper directory on website
MOVE "G:\TEMP\%RECORDING%.avi" "G:\HTTP\htdocs\shows\PlanetEarth\%RECORDING%.avi"

GOTO WEBFREE

rem ---------------------------------------------------

rem Checks available diskspace on the website drive and sends text message to my phone if it gets too low
:WEBFREE

cd c:\program files\devnz\gbpvr\disklimit
disklimit.exe -disk g -limit 5gb -messagefile webmessage.txt

GOTO END

rem ---------------------------------------------------


:END
exit
Server--AthlonXP 2100+ \ PVR150MCE \ HVR1600 x2
Client 1--Athlon64 3200+
Client 2--Athlon64 3700+
Client 3--Turion64x2 1.9 laptop
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#2
2007-04-19, 01:05 AM
SysInternals (now acquired by MS) has many batch file tools that can provide advanced functionality in batch file programming. (http://www.microsoft.com/technet/sysinte...fault.mspx)

The one in particular you need for this is called PsList.exe and can be found in the Process Utilities sub-section. It will list all the current processes running on your system.


Here is an example of a batch file that will test if a process is running or not.

@Echo off
pslist 2>NUL | findstr "%1" 2>&1 NUL
if %ERRORLEVEL% == 0 (
echo %1 is running
) else (
echo %1 is NOT running
)
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  file types of recorded TV paul1 3 3,758 2012-09-30, 05:20 PM
Last Post: sub
  No Data In the Recorded File zb1 5 2,354 2010-08-24, 01:08 AM
Last Post: zb1
  Path to file being recorded. brianj 5 2,425 2010-08-08, 10:58 PM
Last Post: brianj
  error: failure playing back file yonu 4 2,116 2010-07-12, 12:52 AM
Last Post: yonu
  UK Freesat Scan.cache File jeffers 3 2,130 2010-05-25, 10:34 PM
Last Post: jeffers
  3 AC3Filter instances when playing back a still recording TS file? jksmurf 3 1,985 2010-05-17, 12:30 AM
Last Post: jksmurf
  Recording stops at 4gb file size experiencebliss 5 2,476 2010-05-04, 02:54 AM
Last Post: pBS
  Hauppage HVR-950q, no file created when recording, no pause. donbrowne 5 2,105 2010-04-08, 04:03 PM
Last Post: sub
  ffdshow postprocessing on .ts file playback alibert 2 1,742 2010-04-05, 05:33 AM
Last Post: alibert
  ATI Mux / mpeg file recordings playback issues topperdude 10 4,396 2010-03-29, 11:44 PM
Last Post: ww4397

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

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

Linear Mode
Threaded Mode