SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-28-2008, 01:07 PM
grauchy grauchy is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 90
Automated VideoRedo (DOS batch files)

Just thought I'd share this with everyone else. I spent quite a bit of time perfecting this and it works for me rather well. I use ShowAnalyzer to generate .vprj VideoRedo files. And VideoRedo to remove the commercials.

After doing this I can then view shows in SageTV seamlessly. Plus it gives my SageTV machine 25% more recording capacity.

I wrote some batch files that will select the oldest** .vprj file in the recording directory and run VideoRedo automatically. I have several computers running the batch files 24/7. They don't quite keep up with my recordings but it's pretty close. Anyway here's what I've got:


I have three recording directories on my Sage machine and all three are shared on my network as shown below:
\\hdtv\recordings-e\
\\hdtv\recordings-f\
\\hdtv\recordings-g\

VideoReDoBatch-E.bat
This batch file finds the oldest .vprj file in the folder then is launches VideoRedo. After that it Launches VideoReDoBatch-F.bat.
VideoRedoBatch-F.bat is just like E except for the next folder.
F then calls on G, G then calls back to E, and the sequence runs forever.

Code:
@echo off
for /f %%a in ('dir \\hdtv\recordings-e\*.vprj /b /a:-d /o:-d') do set Oldest=%%~na
IF EXIST \\hdtv\recordings-e\%OLDEST%.mpg call c:\VR_Launch \\hdtv\recordings-e\%OLDEST%.vprj
wscript.exe "C:\invis.vbs" "VideoReDoBatch-F.bat"
VR_Launch.bat
This batch file launches VideoRedo and specifies where to write the output .mpg file.
I have it going to e:\videos\videoredo\ on the local machine but you can send it anywhere.
After VideoRedo is done the batch file moves the .mpg file back to the recording directory.
Then the batch file deletes the .cut .edl .vprj files and places a blank .txt file to prevent Dirmon2 from generating another .vprj file.


Code:
call c:\windows\system32\cscript //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" %1 e:\videos\videoredo\%~n1.mpg /t1 /e /q
@echo on
@echo Moving %~n1.mpg back to \\%~p1
move e:\videos\videoredo\%~n1.mpg \\%~p1
@echo Deleting extraneous files
del \\%~pn1.cut
del \\%~pn1.edl
del \\%~pn1.vprj
@echo replace .txt file
copy c:\blank.txt c:\%~n1.txt
move c:\%~n1.txt \\%~p1
**I have this code running on 4 computers. One of them grabs the oldest .vprj file as in the example above. The second one grabs the newest .vprj file it can find. I can't remember what the other ones do but they grab something else like the smallest file or the biggest file or something like that. This is to prevent any two machines from working on the same file at once.

You can change the sort on the "dir" command to anything you want. It's the /o switch.
Quote:
/O List by files in sorted order, sortorder:
N By name (alphabetic)
S By size (smallest first)
E By extension (alphabetic)
D By date & time (earliest first)
G Group directories first
- Prefix to reverse order
A By Last Access Date (earliest first)
I am not running this code on my actual SageTV server as I do not want to grind the machine to a halt.

Admittedly the batch files are a crude way of getting this done but it works for me. If you have any questions how to get this working for you just post here I'd be glad to assist. Or if you have a better solution let me know.
Reply With Quote
  #2  
Old 09-05-2011, 10:27 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Quote:
Originally Posted by grauchy View Post
Just thought I'd share this with everyone else. I spent quite a bit of time perfecting this and it works for me rather well. I use ShowAnalyzer to generate .vprj VideoRedo files. And VideoRedo to remove the commercials.

After doing this I can then view shows in SageTV seamlessly. Plus it gives my SageTV machine 25% more recording capacity.

I wrote some batch files that will select the oldest** .vprj file in the recording directory and run VideoRedo automatically. I have several computers running the batch files 24/7. They don't quite keep up with my recordings but it's pretty close. Anyway here's what I've got:


I have three recording directories on my Sage machine and all three are shared on my network as shown below:
\\hdtv\recordings-e\
\\hdtv\recordings-f\
\\hdtv\recordings-g\

VideoReDoBatch-E.bat
This batch file finds the oldest .vprj file in the folder then is launches VideoRedo. After that it Launches VideoReDoBatch-F.bat.
VideoRedoBatch-F.bat is just like E except for the next folder.
F then calls on G, G then calls back to E, and the sequence runs forever.

Code:
@echo off
for /f %%a in ('dir \\hdtv\recordings-e\*.vprj /b /a:-d /o:-d') do set Oldest=%%~na
IF EXIST \\hdtv\recordings-e\%OLDEST%.mpg call c:\VR_Launch \\hdtv\recordings-e\%OLDEST%.vprj
wscript.exe "C:\invis.vbs" "VideoReDoBatch-F.bat"
VR_Launch.bat
This batch file launches VideoRedo and specifies where to write the output .mpg file.
I have it going to e:\videos\videoredo\ on the local machine but you can send it anywhere.
After VideoRedo is done the batch file moves the .mpg file back to the recording directory.
Then the batch file deletes the .cut .edl .vprj files and places a blank .txt file to prevent Dirmon2 from generating another .vprj file.


Code:
call c:\windows\system32\cscript //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" %1 e:\videos\videoredo\%~n1.mpg /t1 /e /q
@echo on
@echo Moving %~n1.mpg back to \\%~p1
move e:\videos\videoredo\%~n1.mpg \\%~p1
@echo Deleting extraneous files
del \\%~pn1.cut
del \\%~pn1.edl
del \\%~pn1.vprj
@echo replace .txt file
copy c:\blank.txt c:\%~n1.txt
move c:\%~n1.txt \\%~p1
**I have this code running on 4 computers. One of them grabs the oldest .vprj file as in the example above. The second one grabs the newest .vprj file it can find. I can't remember what the other ones do but they grab something else like the smallest file or the biggest file or something like that. This is to prevent any two machines from working on the same file at once.

You can change the sort on the "dir" command to anything you want. It's the /o switch.


I am not running this code on my actual SageTV server as I do not want to grind the machine to a halt.

Admittedly the batch files are a crude way of getting this done but it works for me. If you have any questions how to get this working for you just post here I'd be glad to assist. Or if you have a better solution let me know.
Thanks for posting this. I'm looking to do something similar. A couple questions:
1) you batch file reference c:\invis.vbs - what is that? what does it do?
2) I have the .vprj being generated on the server. thus the .vprj file references the path relative to the server. If I have a client processing the video and the associated .vprj file, how does it handle the different path to the video file?
Reply With Quote
  #3  
Old 09-06-2011, 09:00 AM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
I did this same thing once upon a time, but the (lack of) stability was a problem for me. It work fine for 2 or 3 days, but then a process would fail and it would hang. i had to kill them to get the batch files running again, and that was a hassle.

my server certainly may have been underpowered for what I was asking of it, but i'm not sure.

how is your stability? do these processes ever hang?
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
Reply With Quote
  #4  
Old 09-08-2011, 10:01 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,568
Quote:
Originally Posted by grauchy View Post
**I have this code running on 4 computers. One of them grabs the oldest .vprj file as in the example above. The second one grabs the newest .vprj file it can find. I can't remember what the other ones do but they grab something else like the smallest file or the biggest file or something like that. This is to prevent any two machines from working on the same file at once.
Wow - 4 computers! How many files do you record? I haven't used VRD in batch but it is pretty fast when you are doing cuts on mpg files. And it doesn't take too long to do the comm scan does it? I know that Comskip can do it in about 6X realtime (ie 5 mins for a 30 min show) on my PC.

Or are they just really slow PCs.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
STV Import: Comskip Playback for Default STV (v1.5.4 30/August/2008 for SageTV 5/6) JREkiwi SageTV Customizations 600 11-23-2011 07:58 AM
Edit and Encode HDTV Files? falltime SageTV Software 5 05-24-2006 09:58 AM


All times are GMT -6. The time now is 12:29 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.