SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

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 07-08-2008, 02:08 PM
CousinJed's Avatar
CousinJed CousinJed is offline
Sage User
 
Join Date: Jun 2008
Posts: 13
Process Recorded TV w/ComSkip VBS added to downloads

All,

I just wanted to let you know I have added a file to the download section I developed for processing my recorded TV with ComSkip on an automated basis; I hope this helps some of you out there.

http://forums.sagetv.com/forums/down...do=file&id=237

Here's the scoop from the read me file included in the download.

If you have any questions for suggestions, please let me know and be sure to back your stuff up first!!

=============================================
Description:
This VBS script is used to clean up orphaned ComSkip files and create a batch (BAT) file used to fire up ComSkip and process the recorded files.

=======================================================

Reasoning:

1. While there are other excellent applications (DirMon) and services (ComSkip Monitor (http://forums.sagetv.com/forums/down...o=file&id=138; my initial choice) for monitoring the recorded TV directory for new files, I was having trouble getting ComSkip monitor to work effectively in Vista; primarily due to permission issues and the Java wrapper. (It is an excellent application and should be your first choice.)

2. Because of this and the fact that I do development for a living, I saw it as a challenge and I suspected I could write a VBS script to accomplish this.

3. This in itself provided certain hurdles:
a.Automated processing:
i. While this script can be run manually, it can also be scheduled via Windows Task Scheduler or another application. An EXCELLENT application for scheduling such tasks is Cobian Backup and I highly recommend it (http://www.educ.umu.se/~cobian/cobianbackup.htm). This application runs as a service is primarily used for backing up files (I use it to backup my SageTV directories – you should too) but it can also be used for scheduling tasks; it is a VERY GOOD application and should be considered.
ii. In addition, some folks may want to have the script generate the batch file but not run it. I have added an option in the script to accommodate this and the user can run the batch file manually or can schedule it separately from the VBS file.
b. Multiple processes:
i. I don’t really like multiple processes running and in the case of ComSkip, a significant amount of CPU usage can occur when multiple instances are running; this was the reasoning for utilizing a batch file. The CALL command is utilized in the lines written to the bat file for each ComSkip operation; this will cause the first command to finish before the next command is initiated, preventing multiple instances of ComSkip.
ii. Additionally, when the script is run, it will check to see if ComSkip is running and if it is, it will abort the process and simply wait for it to be triggered again by the scheduler.

Logic Flow:

1. Check for running instance of ComSkip and if it is running, script is aborted, otherwise it continues.
2. Generate a list of ComSkip files and video files in Recorded TV directory; these lists will be used to process the files.
3. ComSkip Files:
a. A check is made for orphaned ComSkip files (those files where the video file has been deleted); if found, these are deleted.
4. Video Files:
a. A check is made for a ComSkip EDL file matching the name of the video file. (NOTE: I only use EDL files as these are the most accurate; if the EDL file does not exist, the video was not processed.) If no EDL file is found, a command line is written to the auto generated batch file to process this file.
5. NOTE: If no video files need to be processed, the bat file is deleted.
6. If the user has elected to run the batch file after the script has created, the script will run it.

Requirements:
1. ComSkip:
a. This version must have the hiderun.exe application included as this is used to run the batch file and ComSkip hidden.
ComSkip can be found here: http://www.kaashoek.com/files/. This is an excellent application so please donate to the author
2. Hiderun.exe:
a. This in included with ComSkip and I think requires .NET; check the documentation.

Usage:
1. IMPORTANT: Depending on your system’s permissions, when the batch (BAT) file is first run, either by the vbs file or by double-clicking it, you may be asked to allow either the hiderun.exe or the comskip.exe to run. There is check-box you can uncheck indicating that you don’t want to be asked for this file to run in the future; this will prevent the dialog box coming up while the bat file is run unattended.
2. If possible, backup your Recorded TV directory before the first use. This script DOES NOT take any action on the video files except passing the file to ComSkip for processing. (For the first time you may want to have the script generate the batch file ONLY, and then you can run it manually; see below).
3. Set parameters in script:
a. Using a text editor (notepad works well), edit the following parameters based on your needs:
i. strRecDirectory: This is the directory where your recorded video files exist. Note: There is NO trailing backslash (\)
Example: strRecDirectory = "C:\Recorded TV"
ii. strComSkipPathtoExe: This is the directory where your ComSkip.exe exists. video files exist. Note: There IS a trailing backslash (\)
Example: strComSkipPathtoExe = "C:\comskip\"
iii. strComSkipFileTypes: A comma delimited list of ComSkip file types you want deleted; no spaces.
Example: strComSkipFileTypes ="edl,txt,log"
iv. strVideoFileTypes: A comma delimited list of the type of video files you want scanned; no spaces.
Example: strVideoFileTypes = "mpg,mpeg,avi
v. blnHaveScriptRunBatchFile: A True or False used to tell the script to run the batch file or not. True = Run batch file, False = Do not run batch file.
Example: blnHaveScriptRunBatchFile = True
==============================================================

Last edited by CousinJed; 07-08-2008 at 02:36 PM. Reason: Upated formatting
Reply With Quote
Reply


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

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
XMLTVImportPlugin: Demideus Demideus SageTV EPG Service 156 08-09-2020 05:58 PM
SageTV V6.3.3 Release Candidate Narflex SageTV Beta Test Software 1 12-04-2007 09:36 PM
STV: Cayars17 Ultimate STV (Release 17 - Jan 18) Cayars SageTV Customizations 3664 12-13-2005 05:35 PM
STV: Meekell Beta 0.3 Release (April 3, 2005) meekell SageTV Customizations 287 08-01-2005 08:42 PM


All times are GMT -6. The time now is 07:05 PM.


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