Commercical Skipping: Round 3

tv_setSomeone recently responded to a previous posting asking some questions regarding identifying commercials in TV recordings and cutting them out on a Apple Mac system. So, I dived in and try to come up with the necessary software and procedures to doing so. Unfortunately, I’ve seemed to run into a few snags and can’t get it to work. Here’s what I found out so far:

In the past, I’ve used the following software to do my bidding:

  1. Comskip – A Windows DOS program that scans through a MPEG2 video file and identifies the cut points for the commercial segments.
  2. Mencoder – A Windows/Mac OSX program that can take the commercial cut points from Comskip and cut out the commerical segments, creating a new video file with no commercials.
  3. Handbrake – A Windows/Mac OSX program that can convert your new video file into any format you want (Optional).

These are the three programs that I have used in the past to do my video commercial cutting. Because Comskip is a Windows DOS program, I have to use a program called Wine which allows me to run this DOS program on my Mac OS system.

Below are the steps I followed to get these programs installed on my iMac system:

1) Download and install XQuartz on your Mac OSX machine from this link:

If you’re running the new Mavericks OS update, make sure you install XQuartz version 2.7.5 rc4.

2) Install “Brew” on your Mac OSX machine. Installing Brew will make it so much easier to download and install other software packages. Go to this web site and follow the instructions:

This site will discuss how to install Brew, and also the Wine software for running Windows exe files.

3) Install “Wine” using the instructions from the link in step (2).

4) Get the latest version of Comskip from this site:

If your video recordings are HD, you’ll need to get the “Donor” version of Comskip. This means you’ll need to click the “Donate” button and pay a nominal fee to have access the the enhanced version of Comskip (which should be faster, also than the standard version).

At this point, you should have what you need to run Comskip and have it scan through a MPEG2 video file to identify all the commercial segments. I did this by running this UNIX command in a Terminal shell window on my Mac:

export DISPLAY=:0.0; “/usr/local/bin/wine”  “/Share/com_test/comskip.exe” –ini=”/Share/com_test/comskip.ini”  “/Share/com_test/test.mpg”

Here you’ll see that I copied the comskip.exe file and comskip.ini file from the files I downloaded over to a test folder called “/Share/com_test”. I also copied my video file in that location.

When I run this command, Comskip is running by using the Wine program and will generate a file with an .edl extension. This is a text file containing the cut points identifying the commercials in the test.mpg video file. This seemed to work fine, and Comskip identified all the commercial segments. Great!

The next step is to cut out the commercials from the video file and create a commercial-free version. In the past, I’ve used mencoder which I tried to install using the following procedure:

1) Type the following command in a Terminal window to have brew install the program called mplayer (which will automatically compile and create mencoder):

brew install mplayer

Ok, this is where I hit a snag. Mplayer will not install and compile on my Mac! I did a Google search and discovered other people have reported the same install/compiler issues that I’m seeing after upgrading to the new Mavericks OS update.

I was able to get Mplayer compilied and installed using a few different options, and I tried running this command to cut the commercials out:

mencoder /Share/com_test/test.mpg -o /Share/com_test/test.mp4 -edl /Share/com_test/test.edl -ovc copy -oac faac -faacopts mpeg=4:object=2:raw:br=164 -srate 48000 -of lavf

However, I would get this error message:

MEncoder dev-SVN-r28038-4.0.1 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Core(TM) i7 CPU         870  @ 2.93GHz (Family: 6, Model: 30, Stepping: 5)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
success: format: 0  data: 0x0 – 0xb9986b68
TS file format detected

VIDEO H264(pid=35) AUDIO AAC(pid=34) NO SUBS (yet)!  PROGRAM N. 1
FPS seems to be: 29.970030
[V] filefmt:29  fourcc:0x10000005  size:0x0  fps:29.970  ftime:=0.0334
Requested audio codec family [faad] (afm=faad) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Could not open codec.
ADecoder init failed 😦
ADecoder init failed 😦
Cannot find codec for audio format 0x4134504D.
Read DOCS/HTML/en/codecs.html!
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder’s libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
OK, exit.
videocodec: framecopy (0x0 24bpp fourcc=10000005)
Read 5 EDL actions.
Writing header…
[mp4 @ 0x12c5800]dimensions not set
Floating point exception: 8

So at this point, I’m not sure how to continue. I suspect that something got “broke” in the Mavericks OS update that is causing issue with mencoder working properly. Unfortunately, I can’t seem to find any other program that will run on the Mac OSX and cut out commercials. I’m going to continue to investigate, but I don’t know if I’ll find any solution soon…


Leave a Reply

Please log in using one of these methods to post your comment: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: