Can’t Remove the Commercials!!!!

If you search for “comskip” among my older postings, you’ll see that at one time I had developed a procedure for identifying and cutting out commercials from my video recordings. I used an application called Comskip (which is a Windows app so I ran it using the Wine cross-platform emulator) for identifying commercials in a video, ffmpeg and mencoder for video data manipulation and cutting. Unfortunately, with the upgrade in my video recording software (EyeTV3) these scripts and procedures no longer work.

I’ve spent hours and long evenings trying to develop a new method, but I’ve hit a big roadblock. I can still use Comskip to identify the commercial time points in a video file, but I have no way of automatically editing the video to remove the commercial segments. In the past, I used mencoder to do the video cutting in batch mode, but now it just won’t work with the MPEG-2 file that is created by the recording software. I tried extracting the video from the original MPEG-2 file first and using that in mencoder, but no dice. I can remove the commercials  manually using the EyeTV3 software, but I want an automated procedure that just does it for me.

Unfortunately, other video processing programs such as ffmeg and Handbrake can’t cut out the commercials from a video file as effectively as how mencoder did it. So, I’m stuck now with lots of commercials that I have to manually skip by. It’s not a super big deal, but when you’re use to watching a show with no commericals, it’s hard to go back!

So if anyone reading this blog posting has any ideas or suggestions, please let me know! 🙂

Updated (12 Aug 2012): Ok, I finally figured out how to do this. I won’t go into the nitty gritty details, but the following Unix command on my iMac system is what I use to identify the commercials in a EyeTV recorded raw mpeg-2 file then create a new mp4 file with the recordings stripped out:

export DISPLAY=:0.0; /usr/bin/nice -n 5 “/Library/Application Support/ETVComskip/Wine.app/Contents/Resources/bin/wine” “/Library/Application Support/ETVComskip/comskip/comskip.exe” –ini=”/Library/Application Support/ETVComskip/comskip/comskip.ini” /Users/dave/Documents/EyeTV\ Archive/Enemy\ of\ the\ State.eyetv/0000000015cdc458.mpg &> /dev/null; /bin/sleep 10; /usr/local/bin/mencoder /Users/dave/Music/iTunes/iTunes\ Media/Android\ Videos/Enemy\ of\ the\ State.mp4 -o /Users/dave/Music/iTunes/iTunes\ Media/Android\ Videos/Enemy\ of\ the\ State\ \(No\ Commercials\).mp4 -edl /Users/dave/Documents/EyeTV\ Archive/Enemy\ of\ the\ State.eyetv/0000000015cdc458.edl -ovc copy -oac faac -faacopts mpeg=4:object=2:raw:br=164 -srate 48000 -of lavf > /dev/null 2>&1 &

I basically use Comskip to identify the commercials in the original mpeg-2 video file, then use Mencoder to strip out the commercials from the converted video (which was created using HandbrakeCLI, converting the original mpeg-2 file to mp4 format) and create a new mp4 file. The trick, was getting the latest version of Mencoder downloaded, compiled, and installed on my iMac system.

Advertisements

10 Responses to Can’t Remove the Commercials!!!!

  1. Jason says:

    Does this procedure work if you do not have EyeTV software? If so, how could this be done?

    • zunetips says:

      The procedure should work on any mp4 video file. You don’t need EyeTV to scan for commercials and remove them.

      • Jason Pinkett says:

        Have you written a post on exactly how you were able to do this? I have even googling and jumping from forum to forum and I can’t find a simple, detailed procedure.

        >

      • zunetips says:

        What kind of desktop machine are you using? Windows or Mac?

      • tomar says:

        Im using a 2010 Mac Mini running Mavericks 10.9

      • zunetips says:

        Ok, can you give me more details on your setup? Are you recording TV shows with commercials on your Mac Mini? If so, what are you using? Is your ultimate goal to identify all the commercials segments in a recorded TV show and have a way to remove them?

      • tomar says:

        Sorry for being so vague. The Mac OS I’m using is Mountain Lion, not Mavericks.

        Yes I would like to have the commercials tagged and removed automatically. I’m using a Hauppauge PVR 2 (1512) to record the HD video. The software that is doing the recording is hdpvrcapture. The recorded content contains commercials. The files are saved with m2ts file extensions. I have the option of using either hdpvrcapture or handbrake to convert the files to either mp4 or some other format.

        I having been trying to install etvcomskip for some time. When installing from the dmg, I would get the following error:

        “The operation couldn’t be completed. (OSStatus error 100030.)”

        I learned this has something to do with the file system being read only. I got around this problem by copying the package contents of the dmg into a folder. I then ran the installation script contained within the newly created folder and now I getting error related to missing directories. I installed Xcode and downloaded the command line scripts. Does Xcode or some other app need to be running in the background for the install to work?

        Assuming it get the app installed, I don’t know how to use it. I read that it only works for MPEG 2 files which is why I was surprised to see that you are using it for mp4 files also. Any help you can render would be greatly appreciated.

      • zunetips says:

        Ok, here’s basically how I did it in the past. I used a great program called “Comskip” which was written specifically to scan through an mpeg2 video file and identify markers for the position of commercials. Unfortunately, Comskip is a Windows DOS program so you should be running it on a Windows machine. I’ve been able to run it on my Mac OSX machine using a helper program called “wine” which is a Windows runtime emulator. When you installed EVTComskip on your Mac, you were essentially wine, Comskip, and a few python scripts as well.

        Unfortunately, I’m getting some errors now when I try to run wine/Comskip on my Mac machine after upgrading to Mavericks (missing X11 libraries). Also, I believe Comskip can only work with mpeg2 files, not mp4 files.

        I’ll try a few experiments with the latest version of Comskip and wine and will write a blog posting with my discovery.

      • zunetips says:

        Ok, I’ve just created a post describing my attempts to cutting commercials on my Mac. If interested, check out the posting. I plan to keep trying, so stay tuned!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: