How do I schedule ShowAnalyzer to process a directory?

23 posts / 0 new
Last post
Offline
Joined: 10 Sep 2010
How do I schedule ShowAnalyzer to process a directory?

I would like to eliminate the filewatcher and folder watching. I would like to have ShowAnalyzer process a directory each night at a specified time.

Does anyone know how?

Offline
Joined: 4 Apr 2007

write a bat/cmd file that iterates through all the files in the folder looking for ones w/o artifacts then call showanalyerengine.exe pathtofile.ext

Senior Editor | @babgvant

Offline
Joined: 10 Sep 2010

Hello Andrew,

Thanks.  I like your idea.  Just a bit above my abilities.  With the ShowAnalyzer's  ability to process a directory in the GUI I had hoped there may be the same function addressable thru a command prompt, which then even someone like me could make a scheduled bat file for.

 

Offline
Joined: 4 Apr 2007

This might be a good starting point.

Senior Editor | @babgvant

Offline
Joined: 10 Sep 2010

babgvant wrote:

This might be a good starting point.

Hi Andrew.  Thanks for the link.  I am open to learn.  Would you mind helping me understand since batch files are new to me? 

Based on what was written in the link the simple one liner command would be fine by me even if it does not keep track of which files have already been scanned.

for %%f in ("R:\Recorded TV\*.dvr-ms") do (if not exist "C:\Program Files\DVRMSToolbox\CommercialsXml\%%~nf.xml" ("C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe" /if="%%f" /of="%%f" /act=nativecommdetect))
 

("R:\Recorded TV\*.dvr-ms") -  Keep () and "" , change to my path where my recordedtv is stored, and change extension to .wtv for Win7?

"C:\Program Files\DVRMSToolbox\CommercialsXml\%%~nf.xml" - Keep "", Change path to folder where my XMLs are stored?  I setup DVR-MS toolbox with all defaults.  My XMLs are stored in the same folder as the recordedtv.  

("C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe" /if="%%f" /of="%%f" /act=nativecommdetect)) - same, keep (), "", verfiy path to DVRMStoMPEG

Am I thinking correctly?

 

 

 

 

 

 

 

 

 

 

 

Offline
Joined: 4 Apr 2007

Yes, but the xml files should end up in the %public% folder by default.  If they are in the Recorded TV folder SA might not be setup correctly.

Senior Editor | @babgvant

Offline
Joined: 10 Sep 2010

babgvant wrote:

Yes, but the xml files should end up in the %public% folder by default.  If they are in the Recorded TV folder SA might not be setup correctly.

Yes, you are right.  The XMLs were in C:\Users\Public\DvrmsToolbox\CommercialsXml

Here is my batch file.

for %%f in ("B:\Recorded TV\*.wtv") do (if not exist "C:\Users\Public\DvrmsToolbox\CommercialsXml\%%~nf.xml" ("C:\Program Files\DVRMSToolbox\DVRMStoMPEG.exe" /if="%%f" /of="%%f" /act=nativecommdetect))

Wife watching TV.  Will test later.

Offline
Joined: 10 Sep 2010

Testing did not go well. Something must be wrong.   I ran the batch file manually.  An DOS window popped up for a millisecond and disappeared.  I checked the XML folder and nothing was added.  Then got a message that system was running slow.  Which I had already noticed.  It seemed like whatever I did had it trying to do something, but it was unsuccessful.  I ended up rebooting to get things back in order.

I have re-read your link.  Decided to go down further and try your more involved solution.   Will report back.

 

skirge01's picture
Offline
Joined: 21 Dec 2006

Open up a regular command prompt window and run the batch file from there.  This will ensure that the windows stays open and you can see what sort of feedback/errors you get.

Server: WHS, SuperMicro dual Xeon X7DWE, 1 x Xeon L5410, Thermalright HR-01, 4GB Crucial ECC, 8 port PCI-X SATA, 4 port RocketRAID 2300, 5x1 PortMultiplier, Corsair HX1000W PSU, Lian-Li PC343B case [blog]
Storage:
2 x Addonics 5-in-3 bays, 13TB
Client:
SageTV 7, Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion [blog]
Tuners: 2 x HD-PVR (serial control), 2 x HDHR, USB-UIRT

Offline
Joined: 10 Sep 2010

Hi George,

I sort of did.  As stated at the end of my last  I moved on to Andrew's version with more lines of code.  I changed the directories to match.  I THINK I have them correct, but here is what I get.

 

First run by double clicking the "commprocess.bat" from the desktop I get this.

I created a log file named Process_List.log in root drive and no change.

Next I opened a command prompt window and got this .   Still has issues.  Any clues?

 

skirge01's picture
Offline
Joined: 21 Dec 2006

It looks like a permissions issue.  Are you running the CMD prompt as the administrator?

Server: WHS, SuperMicro dual Xeon X7DWE, 1 x Xeon L5410, Thermalright HR-01, 4GB Crucial ECC, 8 port PCI-X SATA, 4 port RocketRAID 2300, 5x1 PortMultiplier, Corsair HX1000W PSU, Lian-Li PC343B case [blog]
Storage:
2 x Addonics 5-in-3 bays, 13TB
Client:
SageTV 7, Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion [blog]
Tuners: 2 x HD-PVR (serial control), 2 x HDHR, USB-UIRT

Offline
Joined: 10 Sep 2010

At that point it was not a administrator command prompt.  I ran it again.  Still did not process, but I do see a processed_list.log and completed.log on my root drive.  They are empty but the update when the batch is run.  Thus I think we are closer.

Trying to dissect this the first error could be a syntax thing. The batch file text is below.  Note the first command in bold and then compare to what it replied back when run.  All  I did to this line was to change the extension from *.DVR-MS to *.wtv.

Batch file

 @echo off

set recfolder=D:\Recorded TV\
set logfolder=C:\

:process_recfolder
echo %DATE% %TIME% Starting commercials scan
call :processed_list
for %%f in ("%recfolder%*.wtv") do (call :scan_comms "%%f")
if not exist "%logfolder%completed.txt" goto :end
type "%logfolder%completed.txt"
del /q "%logfolder%completed.txt"
call :processed_list
goto :end

:scan_comms
find /I %1 "%logfolder%processed_list.log" >nul
if %ERRORLEVEL%==0 goto :eof
"C:\Program Files (x86)\DVRMSToolbox\DVRMStoMPEG.exe" /if=%1 /of=%1 /act=nativecommdetect >nul
echo Completed: %~dpnx1>>"%logfolder%completed.txt"
goto :eof

:processed_list
echo PROCESSED FILE LIST>"%logfolder%processed_list.log"
echo %DATE% %TIME%>>"%logfolder%\processed_list.log"
for %%f in ("D:\Recorded TV\*.xml") do (echo %recfolder%%%~nf.dvr-ms>>"%logfolder%processed_list.log")
goto :eof

:end
echo %DATE% %TIME% Finished commercials scan
goto :eof

Response

 

 

skirge01's picture
Offline
Joined: 21 Dec 2006

I'm looking at the results screenshot and noticing that you aren't running a batch file.  It looks like you're pasting it into the CMD window.  Simply put, you can't do that.  Paste the text into a text editor (i.e.  notepad...  do not use word or wordpad) and save it as commscan.bat to your C: drive and then just type commscan.bat at your C: prompt.

Server: WHS, SuperMicro dual Xeon X7DWE, 1 x Xeon L5410, Thermalright HR-01, 4GB Crucial ECC, 8 port PCI-X SATA, 4 port RocketRAID 2300, 5x1 PortMultiplier, Corsair HX1000W PSU, Lian-Li PC343B case [blog]
Storage:
2 x Addonics 5-in-3 bays, 13TB
Client:
SageTV 7, Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion [blog]
Tuners: 2 x HD-PVR (serial control), 2 x HDHR, USB-UIRT

Offline
Joined: 10 Sep 2010

You are correct.  That is what I was doing.   As I mentioned above this is all new to me.  I moved the batch file to the root drive and am now running it from the command prompt you stated.  No errors.  Waiting for a result.  Will post back.

skirge01's picture
Offline
Joined: 21 Dec 2006

Glad to hear it.  That whole DOS thing is like hieroglyphics nowadays.  It's definitely a good thing to be familiar with, though, as you're finding out.  Now, you'll probably find more uses for it in the future.

Server: WHS, SuperMicro dual Xeon X7DWE, 1 x Xeon L5410, Thermalright HR-01, 4GB Crucial ECC, 8 port PCI-X SATA, 4 port RocketRAID 2300, 5x1 PortMultiplier, Corsair HX1000W PSU, Lian-Li PC343B case [blog]
Storage:
2 x Addonics 5-in-3 bays, 13TB
Client:
SageTV 7, Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion [blog]
Tuners: 2 x HD-PVR (serial control), 2 x HDHR, USB-UIRT

Offline
Joined: 10 Sep 2010

Good News!  I am pretty sure it worked.  The DOS prompt box shows the files processed, but the log shows nothing but a date and time in it.  No files listed.

Now for the weird part.  The XML files were not in the CommercialXML directory.  In fact they were no where.  I know I saw them starting to populate this directory, but when I came back after processing stopped there was nothing there.  Thinking it may be something to do with file cleanup I dropped a spare XML file in that folder.  Gave it a couple seconds and it was gone.

I see no where that cleanup is supposed to delete XMLs.  Any idea?

 

Offline
Joined: 10 Sep 2010

I simply could not find out why the XMLs were being deleted as soon as they were dropped in the in the CommercialsXML folder.  I took a stab in the dark and assumed DTB was deleting them as part of some file cleanup. 

It did not hurt too that there was a newer version out.  I went to the new version and all is good.  I created a scheduled task using the commscan.bat.  Everything is working great.  Thanks for all the help.

 

Offline
Joined: 1 Jun 2011

good thread.  I have showanalyzer set up with a directory watcher so all I do to have this run overnight is to set up a task to start the service at a specific time and then another task to stop it early in the morning before everyone wakes up.  That gives plenty of time for it to run through all of the days recordings and it makes the script really simple.

to start it:

net start ShowAnalyzerMaster

Offline
Joined: 10 Sep 2010

Interesting and easy approach. Since starting this thread i did a full refresh of my MC and have not yet installed Showanalyzer.  I will try this.  Thanks.

Offline
Joined: 24 Jun 2009

TheEmirOfGroofunkistan wrote:

good thread.  I have showanalyzer set up with a directory watcher so all I do to have this run overnight is to set up a task to start the service at a specific time and then another task to stop it early in the morning before everyone wakes up.  That gives plenty of time for it to run through all of the days recordings and it makes the script really simple.

to start it:

net start ShowAnalyzerMaster

This is exactly what I do, but I use DTB to monitor the directory rather than ShowAnalyzer, because I have DVRMToolkit do other tasks (like move the files off the SSD to the NAS).   Basically, Task Scheduler just does the following:

@3AM: net start DTBService

@8AM: net stop DTBService

Seems to do the trick.

mikinho's picture
Offline
Joined: 19 Mar 2007

I made a post with the script I use as well http://www.missingremote.com/forums/show-analyzer-nightly-task

Mikinho | Missing Remote | Windows Entertainment and Connected Home MVP

Offline
Joined: 20 Nov 2010

This is great information... I also recently got back into the commercial skipping game only to find there was no one product that was a clear favored...  After researching the issues I have to-date attempt (3) three different configurations involving: BATCH files, JS scripts, DTBAddin, DVRMSToolbox, ShowAnalyzer, MC-TVConverter, WTV Watcher, etc, etc.

One major consideration in the software to be used is continue development as we now this type of software does not have a long shelf-life...  In my current configuration, I use a script that runs after and EVENT 1 of a recording...  The script basically moves the file from the local device to a NAS. Note however, that part of the process involves renaming the file and saving it in a directory hiearchy that structured based on SERIE, SHOW and EPISODE-NAME...  All recorded movies are save in the root of this folder... 

My second consideration is that I prefer to have my directory structure as indicated above so I need a program that will scan my recorded shows based on the structure indicated above...

Finally, I need on the fly processing...  I'm willing to wait for 1 hour to pass before assuming a recorded show is ready to be viewed with commericials...  In short I want to record HOUSE @ 20:00 est and by 22:00 be watching without commericals...

*  THE RESULTS  *

My first configuration, I used WTV Watcher but it did not do subdirecotries.

My second configuration, I used DTBAddin, DVRMSToolbox and ShowAnalyzer - but did not get consistant results...  It never automatically scanne the subfolders for the recorded tv...

I'm currently testing BATCH files, JS scripts, DTBAddin, DVRMSToolbox, MC-TVConverter...  The ideal I'm using with this configuration is that I will use the script to get the file to the NAS and in the folder structure I want and an attempt to test to see if the MOVE|RENAME process is faster with the script or by using MC-TVConverter...  I have never heard anything good about DVRMSToolbox file moving ability so I have not tried it. 

Once the file is on the NAS, I'm using MC-TVConverter to scan the ROOT and subfolders for new files and then running the DVRMSToolbox process...  It's my hope that the file can be moved from my local device and immediated process for viewing while maintaining my directory structure...

I've just configured the above settings and will do some testing and post back...  So far it does look good but I might have the ability to get rid of the script because MC-TVConverter does allow you to rename a file once process based on the structure listed above.

Note:  I visted AVSForum, LifeHacker, Engadget and of course this site while doing research.

Offline
Joined: 3 Jul 2011

I use DVMST with ShowAnalyzer (mostly for on-the-fly comm skipping) FileWatcher is always running and SA's directory watcher is OFF.

I also use WTV-MetaRenamer http://wtvmetarenamer.codeplex.com/

IT. IS. AWESOME...once you get it up and running. I was able to figure it out with the provided help/readme files, and a small amount of Googling. I think the newer version has everything you need. I installed this over a year ago and had to dig for this wierd Ionic.Zip.dll file.

I run WTV-MetaRenamer everyday at 3AM (Task Scheduler) to scan for new shows. It then gathers show info (from theTVDB.com), renames, and moves it to my Drobo (DAS). If a show is unknown (usually new shows) it can be placed in any file I desire (I have an "unknown folder" where these live). If a file new recording already exists it gets deleted (these are usually Seinfeld episodes Smile ). Its really a matter of editing an XML file to tell it what to do. 

My biggest issue now is converting all of these already comm-skipped,  renamed & sorted WTV files to either a trully chopped WTV/DVR-ms file or even better - MP4/MKV ...something HTPC & Tablet friendly...and smaller in file size.

I just saw that MC-TVConverter 2 is out and looks promising. I'll try to have it scan my directory.

My end result is:

1. Current recordings live in C:\Users\Public\RecordedTV - I use Win7MC default "Recorded TV" to view current WTV files (already comm-skipped, or I hit 4 to processes for comm skipping)

2. Next I use TVLibrary to view all my ripped DVD tv shows (not ISOs but VIDEO_TS folders, MP4, MKV, WMV etc.), Amazon downloads, Zune Downloads. Even my sorted WTV files too.

I might go back to Media Browser for the DVD folder/ISO support for TV shows.

 

 

 

 

Login or register to post comments
Website design by Yammm Software
Powered by Drupal