Back when I was using Microsoft Media Center to record TV shows on my Windows 7 PC (with cable set top box and TV Tuner card) I also used a nifty freeware tool called DVRMSToolbox (dtb) to help cut out commercials from my recordings and convert the videos to a format acceptable for my Microsoft Zune HD. Since switching to an Apple iMac desktop system, I had to leave my Microsoft Zune HD for an Apple iPod Touch (which I got last Friday for my birthday). In fact, if you read some of my previous postings you’ll see that I’ve gone to an all-Mac system with regards to recording TV shows using my iMac.
Consequently, I don’t have the ability to automatically remove commercials from my TV recordings (since DVRMSToolbox only runs on Windows systems). After lots of Googling, I came up with a system that might just do the trick for removing commercials from my TV shows and make them acceptable for iTunes syncing with my iPod Touch. Here’s the procedure that I’ve implemented:
- Using the EyeTV HD hardware with the EyeTV3 software, I’ve set up scheduled TV show recordings on my iMac. (The system records shows in MPEG4 H264 file format)
- While the show is recording, I’m using a program called Comskip that will on-the-fly identify the timing segments of all commercials. This procedure is initiated by EyeTV3 automatically by running an AppleScript when the show begins recording.
- After the recording is completed for a show, EyeTV3 will call another AppleScript that allows for post-processing. I do the following after each show is finished recording:
- Wait 60 seconds for the Comskip program to finish up its analysis of the show.
- Get the show’s metadata (e.g., title, description, etc.) and save it
- Run a program called ffmpeg that will extract the proper video and audio stream from the raw recorded MPEG4 file.
- Run a program called mencoder that will take the commercial break information from Comskip and cut out all the commercials.
- Run a program called atomicparsley that will insert the TV show’s metadata into the new mp4 video file.
- Copy this commercial-free video file of the recorded TV show to the iTunes folder called “Automatically Add to iTunes” which will automatically process the file and make it available for syncing with my iPod Touch.
- Do some housecleaning by deleting temp files, etc. and also note in a log file that this recording has been processed.
Thankfully, the makers of EyeTV3 (Elgato) have added provisions to fire off certain AppleScripts so I can do this post-processing. I’ve spend all weekend downloading and compiling source code for programs such as ffmpeg, mencoder, and atomicparsley and doing some heavy AppleScript writing. Note, that I’ve never written AppleScripts before, and it sure does help to have lots of examples available on the Internet!
So, it seems that my test cases are working ok with this process, so I’ll have to let it run for a few days to make sure everything is handled properly. I’m expecting that I’ll need to tweak the Comskip settings file to help it identify commercials better, but that’s for another day!
One thing to note: On my Zune HD I had a skip forward/backward button that allowed me to skip ahead several seconds to pass up commercials if needed. Unfortunately, the iPod Touch does not have such a feature and my only recourse is to carefully use the slider bar control to skip commercials. Since this slider control is very sensitive, it takes a few attempts to pass a commercial without missing too much of my show. Thus, I decided to go down the path of auto editing the commercials to avoid this issue.
Updated: Here’s a good link that describes how to download and compile the ffmpeg and mencoder programs for your Mac: http://lonestar.utsa.edu/llee/HDTV_to_DVD.html
Also, I’ve uploaded my recordingDone.scpt file to the Cloud in case you EyeTV users want to examine it for your use. You can download it from this link.