I loathe being advertised to, and I don’t understand how ads are even effective, since I very rarely ever go buy a product/service based on an ad I’ve seen. When they appear on a DVR recording, I have to manually fast-forward them, and they waste precious space on my hard disks. Fortunately, there are tools that allow you to do that. Unfortunately, they’re generally buggy, don’t come with any documentation, and difficult for one to understand and use.
One such tool is DVRMSToolbox. Unlike other tools, it actually works on Windows 7, but it’s essentially a mish-mash of executables, with documentation for Windows Vista that’s hard to follow and to make matters worse, a web forum with loads of “me too, I can’t get this working either, please help” kind of replies instead of working solutions. I was able to get something working, though I could not figure how on earth to get it to work with .wtv files (it’s built for Vista which uses .dvr-ms files). Another issue I ran into is that it works on the recordings as they come in, which grinds the system down to a halt (even on a quad-core).
Fortunately, I was able to poke around and take a look at the package and figure out what’s going on, and how to write batch scripts to accomplish things, and wrote a nice batch file which I can trigger through the built-in Windows Scheduler at 4 am when I am sleeping and the system is idle:
@echo off
set mediafolder=%1
set wtvconverter=%systemdrive%\windows\ehome\wtvconverter.exe
set dvrmstool=%systemdrive%\Program Files (x86)\DVRMSToolbox\DVRMStoMPEG.exe
echo Usage: runcomskip.cmd [path/to/media/folder]
if mediafolder=="" goto:eof
for /r %mediafolder% %%a in (*.wtv) do call:do_conversion "%%a"
goto:eof
:do_conversion
rem do conversion here args = %~1 ...
set wtvfile=%~1
set dvrmsfile=%wtvfile%.dvr-ms
set mpegfile=%dvrmsfile%.mpeg
echo *** Begin processing file %~1 ***
echo Converting to dvr-ms %dvrmsfile%
%wtvconverter% "%wtvfile%" "%dvrmsfile%"
echo Running comskip and converting to mpeg %mpegfile%
"%dvrmstool%" /if="%dvrmsfile%" /of="%mpegfile%" /p=32 /act="converttompgwocommercials"
rem Rename the wtv file so we don't attempt to re-convert it if we run the script again.
rem I'll be changing this to delete the file when I'm sure my script works 100% of the time.
rename "%wtvfile%" "%wtvfile%.old"
echo *** End processing file %~1 ***
goto:eof
(to use, copy this into a text file and save it as runcomskip.cmd)
I’m using the WTV to DVR-MS converter that ships with Windows to convert the files to the older DVR-MS format. There are no tools (that I know of) that will work with WTV. Once the file has been converted, DVRMStoMPEG will run Comskip, a freeware tool included with DVRMSToolbox to find commercials in the video, and will output the stripped video to MPEG. I ouptut MPEG since it’s a lot more portable than DVR-MS and WTV, and AFAIK there’s no transcoding involved, all it should be doing is changing the container. I’m a bit wary of deleting the original files just yet. I want to make sure that the tools work right before running it on my recordings. I rename it so that the same files don’t get processed twice. The next step is to find a good batch encoder for archival purposes before my 1 TB DVR disk fills up. Right now I’m thinking of writing a simple cmd line encoder using the Expression SDK.