« January 2009 | Main | August 2010 »



Watching and Recording HD video on Mac OS X

Digital Video Recorders (DVRs) and High Definition (HD) programming have positively revolutionized entertainment, particularly for busy folks who can't always sit down at the time of broadcast to view their favorite show.

While DVRs are convenient, they certainly have limitations. Even after buying your Tivo you must pay a monthy fee to use it. If you get your DVR from your cable provider you must pay a monthly fee *and* you never own the device. Your DVRs can run out of space requiring that you delete shows that you may not want to. Your DVR will not allow you to export your shows and movies to DVD, iPhone or any other device in your household.

After months of torturous research and beta testing of software, I'm here to report how you can assemble a better-than-tivo experience with your Mac, all with equipment that you own and do not have to pay a monthly fee to run.

The easiest way to explain what you will need and how to piece it together is to follow the cables from your wall to your screen. In this article we'll be referring to the below diagram which you can click on to view in 1080p:

HD-on-mac-source-to-screen.png 1-source.png

Your HD signal can come from a number of sources. Because we're running our signal through our computer we will require some form of receiver to accept the television source and send it along to us via the correct cables. Here, we will presume that you have signed up for digital cable service, Direct TV or some paid service that provides HD channels as part of the package.

The back of your receiver will have a number of different outputs which we'll need to choose from in the next step.

2-video-out.png

As you'll soon see, the path to getting an HD signal through your computer is a treacherous one, littered with the bleached bones of old tech and modern MPAA booby traps.

First and foremost, a high definition signal carries a lot of information, cramming 1920x1080 pixels a frame through (for 1080p) or 1280x720 pixels (for 720p) so we will need a connection that is capable of carrying this data.

RCA
The RCA connector was introduced way back in the 1940s. The common "composite video" incarnation (yellow, red, white) is an analog connection that is limited to NTSC resolution of 720x480. FAIL: not enough bandwidth.

S-video
S-Video is a newer technology, introduced by JVC in 1987. It improved the quality of the picture being passed through, but still topped out at "standard resolution" NTSC. FAIL: not enough bandwidth.

Coaxial Cable
The Coaxial Cable is the line that brings the signal into your home or apartment if you subscribe to cable television. It clearly has the bandwidth but you run into a myriad of compatibility problems when you attempt to plug it into anything other than your receiver. At the time of writing elgato sells USB tuners that will accept only coax and will play and record "Clear QAM" video. If you live in a major city you do NOT have clear QAM -- instead you have encrypted or scrambled stations that must go through your cable box to be viewed. FAIL: Interference from encryption

HDMI
HDMI or High Definition Multimedia Interface is a high-bandwidth all-digital interface. These are the cables that electronics stores will try to sell you and for good reason: For devices that are compatible you get plug-and-play convenience and a beautiful distortion-and-noise-free picture. When I plugged my projector into my Mac the two devices communicated with each other and in System Preferences -> Displays my projector even showed up by name.

All of this convenience and quality hides the sinister (and deal-breaking) aspect of HDMI. HDMI uses HDCP to prevent recording of data. Remember the mess with DRM for music? Same thing here, but embedded into the devices and protocol itself--not the files. FAIL: DRM

component.png

Component Video
So we've seen that the old composite and s-video cables aren't capable of carrying the signal we need, and that coax and HDMI are riddled with DRM. Our savior comes in the form of what is often referred to as the "analog hole". The Component Video cables are capable of carrying an HD signal, but due to their analog nature, are INCAPABLE of carrying the broadcast flag that devices are supposed to identify and use to block recording.

3-encoder.png

There are a LOT of video encoders on the market from a myriad of companies. A few will accept the increasingly rare "Clear QAM" signal and record it without a loss in quality but as a practical matter, ALL of them are limited to NTSC 740x480 with the exception of one...

hauppauge-HD-PVR.png

Hauppauge HD-PVR
At the time of writing Hauppauge may be making the only consumer encoder on earth that accepts component video.

It manages to get by on a USB 2 connection by compressing the video using H.264 (the same codec used in Blu-Ray DVDs, Quicktime, iChat videos and more). Even with the help of this dedicated encoder, you still end up having massive processing needs which we'll cover a bit later.

4-software.png

Another easy part of the process is the software. Aside from elgato's eyeTV there pretty much isn't anything out there for Mac that works with the HD-PVR except for a wildly experimental version of MythTV and a command-line app.

Not that eyeTV will leave you wanting for much; it gives you the complete Tivo experience and then some. A quick rundown of key features include:

The big caveat here is that you don't get all of the functionality you might want out-of-the-box. For legal reasons eyeTV can't write software to use the Hauppauge IR Blaster, which you affix to your cable/satellite box and use to change channels without using the television-provider's remote. You also can not use Hauppauge's remote--you must use a third party product such as ATI's Remote Wonder**.

Both the ZephIR and Remote Wonder require you to train them but it is worth the time. eyeTV can use the ZephIR to change channels for you while you're away so that it can perform scheduled recordings. With the Remote Wonder you can tap into eyeTV's time-shifting functions such as pausing live TV. You can also use it to control your Mac's DVD player, iTunes and more.

**The Remote Wonder product has been discontinued but is often available on eBay. The software works but is not a "Universal Binary" which means your computer will run it through Rosetta emulation. I am currently researching a more compatible solution (and encouraging our friends at elgato to get their act together and support the Hauppauge remote).

For those on Linux I understand MythTV is quite good and on Windows we've confirmed that SageTV works with the HD-PVR. We thought that the interface was pretty tortured, requiring 4x the clicks to perform the same functions using eyeTV. The software that comes with the HD-PVR is simply beyond hope. Even if you are a Windows user, expect to purchase additional software to use your device.

5-computer.png

As eluded to above, your encoder will work best when it is set to maximum quality. At the top settings it will be throwing 13.5Mbps of data at your computer to process. If I'm recording a show while watching it full-screen I use 80% of the CPU on my Mac Pro 2.66Ghz Quad Xeon. I record all of my shows to their own dedicated 1TB HD and have eyeTV set to use 1.5GB of RAM as it's scratch disk.

As I understand it, a number of people have been recording on their Mac Minis to some success, but many have to set their compression higher to prevent seeing dropped frames.

6-output.png

Once we have our video captured we need to send it out to be viewed. Here we run into the same problems we had with the input, minus the broadcast flag issue.

We will continue to disregard composite and s-video because of their bandwidth limitation, and will add to that list coax AND our previously favored component due to our graphics card not having these interfaces.

dvi-hdmi.png

As it turns out, DVI (standard on almost every graphics card sold today) and HDMI are THE SAME THING, except their plugs are physically different. You can pick up a DVI -> HDMI converter for cheap online at stores such as monoprice which will enable you to plug your HDMI projector or television into your graphics card with no conversion (or loss of quality) at all.

Audio is the one section that doesn't require a section: both RCA and Dolby Audio work fine. Plug and play.

7-screen.png

Finally, an easy part! When you buy your TV or projector just make sure it has an HDMI port and is listed as "HD". Ask your friendly sales rep if you aren't sure.

While each one of these sections could be a book in an of itself, and some tinkering will be required to get your home entertainment system dialed, this will at least lay out the different parts you will need to assemble to watch, record, and export HD video on your Mac.

At it's best you will have all of the convenience of the $10/month DVR plan through your cable provider but will have the freedom to do what you want with your content, and will own all of your own equipment to bring with you from home to home and from plan to plan.

Posted by Aaron R. Deutsch on May 3, 2009 | Comments (7)

Tunneling with OS X for fun, security, and more

As an internet user used to freedom there are a number of good reasons to create tunnels. A few examples:

So what does a tunnel do? A tunnel is a secure connection made between your computer and another one that is located elsewhere. Instead of having your computer make its connections directly to the websites and services you are trying to reach ALL requests are encrypted and sent through the tunnel to the other computer, THEN relayed to the service you are trying to connect to. Your remote computer will receive the responses and send them back to you in an encrypted form.

So if someone is "watching" you making ordinary connections on a wireless network they will see you connecting to AOL (and probably grab your login), then maybe browse msn.com and cnn.com, etc. If someone tries to eavesdrop on your tunnel connection the most they will see is you making connections to one machine, all of which will be garbled and unreadable. In short: they'll have no idea what you are doing.

There are applications for Mac that supposedly create tunnels but they are hopelessly devoid of any form of documentation and from what I can tell, they are largely special-use tunnels for single apps.

As it was pointed out on paulstamatiou.com, all that you need to dig a tunnel is already built into OS X.

I found his method a little unsatisfying in the way that once the tunnel is open it provides you with...silence. There is no status to let you know that your tunnel is working. In reading the man file I've modified it a bit so that you can have a window that not only allows you to create your tunnel, but also gives you a realtime "pulse" for your tunnel.

In order to create a tunnel you will want to make sure you have two things:


  1. A Mac running OS X

  2. A computer to log into that is running any flavor of Unix or Linux with a static IP address. For my example I am going to create a tunnel between my MacBook Pro laptop and my Mac Pro desktop at home

Here is the walk-through:


First, to prepare the Mac Pro go into the System Preferences -> Sharing and turn on "Remote Login"
remote-login.gif

Next, on the MacBook Pro, open up a terminal window. This will start you out in your home directory. We're going to create a script that you can launch quickly whenever you need a tunnel. Type:

pico tunnel-home

This will create a text document that we'll put our script in to create a tunnel to our computer. Add this to the file:

#!/bin/sh

ssh -D 8080 -f -C -v -N yourname@YourIPaddressOrYourDomain.com

Hit Control-o to save the file. Then click Control-x to close pico.

to run your script type this into the terminal:

sh tunnel-home

...and hit return. This will fire up your tunnel. Since you chose "verbose" mode (-v) it will return results for every command your computer sends through the tunnel. With your display colors set correctly this is the part where you confound your friends by showing them that the matrix does exist, and that you are running it on your computer.

matrix.gif

Now there is one more step left, and that is to set your MacBook Pro to USE the tunnel we've opened up. In your System Preferences -> Network under "Location" choose "Duplicate Location" and name it the same thing with "Tunnel" at the end for easy reference.

Select this new network and choose the Advanced button...
network-dup.gif

Then choose the "Proxies" tab, check the "SOCKS Proxy" box, enter in "localhost" under SOCKS proxy server and "8080" after the colon. Basically this tells your computer to funnel ALL network requests through your tunnel which is running on your machine (localhost) through port 8080 (an alternative http port).

socks.gif

Click OK, make sure your new network is selected and click "Apply". Everything on your computer should be happening through your tunnel.

To test to see if this is working you can visit http://www.whatismyipaddress.com. It should give you the IP address of your REMOTE computer instead of your local network address.

Happy surfing.

Posted by Aaron R. Deutsch on May 1, 2009 | Comments (4)