I searched the forum and found several attampts to solve the problem of disks running full. However there was none which would transcode files when the disk nearly full, so I made a little batch file. Please comment on it.
The two variables set the recordings directory (actually the recordings drive is sufficient) and the amount of megabytes to keep free on the disk.
The the script takes advantage of the fact that SUB has all recordings nicely in chronological order in the recording-dump.xml to make the transcode queue
The queue will run as long as the drivespace is below the set minimum.
The script takes an external batch file to transcode the mpg. Put here whatever you like. Make sure the transcode batch file deletes the mpg otherwise there will be no disk space freed up!!
I run the script as postprocessing.bat so after every recording the disk space is checked. You can also run it as pustepgupdate.bat which will run the transcoding at night.
Code:
rem video directory
set video="V:\video"
rem diskspace to keep free in MB
set free=25
rem create transcode queue
c:
cd "\program files\devnz\gbpvr"
del oldfile.txt
for /f "tokens=3 delims=><" %%G IN ('findstr /C:.mpg recording-dump.xml') do echo %%G >> oldfile.txt
:start
rem check diskspace
for /f "tokens=3 delims=., " %%G IN ('dir %video%') do set /a a=%%G
if %a% LSS %free% (goto transcode) else (goto eof)
:transcode
rem put first line in oldfile variable
set /p oldfile=<oldfile.txt
start /low /wait transcode.bat "%oldfile%"
rem move queue up one line
findstr /V /C:"%oldfile%" oldfile.txt > oldfile2.txt
del oldfile.txt
ren oldfile2.txt oldfile.txt
goto start
:eof
The two variables set the recordings directory (actually the recordings drive is sufficient) and the amount of megabytes to keep free on the disk.
The the script takes advantage of the fact that SUB has all recordings nicely in chronological order in the recording-dump.xml to make the transcode queue
The queue will run as long as the drivespace is below the set minimum.
The script takes an external batch file to transcode the mpg. Put here whatever you like. Make sure the transcode batch file deletes the mpg otherwise there will be no disk space freed up!!
I run the script as postprocessing.bat so after every recording the disk space is checked. You can also run it as pustepgupdate.bat which will run the transcoding at night.
Regards Koen,
GBPVR 1.4.7
AMD 780G with X2 BE2350, 2gb ram, LCD-TV, Win XP
PVR500, PVR150 & PVC150 MCE MediaMVP D3A, 2 networked clients
GBPVR 1.4.7
AMD 780G with X2 BE2350, 2gb ram, LCD-TV, Win XP
PVR500, PVR150 & PVC150 MCE MediaMVP D3A, 2 networked clients