Cable TV + Mac + Firewire == HD-PVR
With all the hype surrounding appleTV I’ve started to rethink the whole PVR vs. TV-media client tradeoff. I have a server at home, a bulky black box with 2×250GB hard disks that I use for storage and backups. I’ve recently considered turning it into a PVR or a TV-serving media server, but the lack of good HD options has stopped me from doing so. I have an HDTV, and I pay for HD cable. Naturally, I want an end-to-end HD solution. I could purchase and install a tuner in the server (which runs Ubuntu, by the way), such as the pcHDTV550 that’s guaranteed to run on linux — but it only takes analog inputs (coaxial and s-video) and only decodes ATSC, which is already exported via firewire by the cable tuner. When I thought about it, I noted that all I really want to do was capture the video stream.
After a little research, I found that any Firewire-equipped Mac can be made into an HD-PVR for unencrypted content at the expense of an appropriate firewire cable. Apple even provides the necessary capture software that you need, provided that you know where to look.
The Project
Building a super-low-cost, HD-PVR.
Materials
- A cable box with Firewire output
- A Mac (with an available Firewire port)
- A Firewire cable for connecting the cable box to your computer (with appropriate connection interfaces)
- Some spare hard drive space (HD required ~100MB/min)
- Apple Firewire SDK
- MPlayer (or, alternatively, VLC)
In my case, I used a Scientific Atlanta 3250HD Cable Receiver, a 12 inch 1.33Ghz Aluminum Apple Powerbook, and a spare Belkin male-male firewire cable that I had laying around from a Mac-to-Mac data transfer I did at some point. The Apple Firewire SDK is downloadable (free registration required) from the Apple Development Kits Page. MPlayer and VLC are also free downloads.
In theory, any combination of 1-3 should work. If your cable set-top box lacks Firewire connectivity, ask for it. The FCC mandates that all cable services provide firewire output (on request if necessary) as of April 1, 2004 [2, 3].
Install the Prerequisites
In order to record and playback a signal from the cable box, we basically need 3 things: a signal/physical connectivity, some software for video capture, and some software for playback.
Before getting started, make sure you do the following:
- Check that your cable box is operational (I hope that goes without saying).
- Connect it to your Mac via Firewire.
- Download and install Apple’s Firewire SDK
- Download and install your choice of MPlayer or VLC
Now we’re ready for the fun.
Recording Content
Recording content couldn’t be easier. In fact, Apple’s Firewire SDK ships with all the capture software that we need. It contains a nifty little program called ‘AVCVideoCap’ that provides an interface for connecting to and capturing DVHS video streams via firewire. It’s located (on my machine, using version 23 of the Firewire SDK) at:
/Developer/FireWireSDK23/Applications/AVCVideoCap.app
Fire it up. If everything goes well you should see your cable tuner in the ‘attached devices’ list:
Capturing a video is as simple as choosing a filename:
and some basic options:
In the capture options window you can choose a specific channel to record. Unfortunately, I was unable to get this feature to work on my SA3250HD (I have read reports of it working on some other models though). In any event, AVCVideoCap will capture the current channel on the set-top-box:
Playback
The AVCVideoCap application captures the raw MPEG2 Transport Streams as .m2t files. Lucky for us, MPlayer and VLC readily support playback of this media, if the channel that was recorded is unencrypted. At a minimum, this applies to standard broadcast channels (i.e. those available outside the realm of cable tv) and will vary from service provider to service provider.
Since these files are streams, they lack timing information for random-access playback, that is, seek and skip functionality. Timing information can be added with a few mousclicks using another utility in the Apple Firewire SDK — VirtualDVHS. Open this application, load the .m2t file, and create a navigation file for the selected MPEG2 transport stream.
If you are fortunate enough to have an HDTV with a firewire input, you can use VirtualDVHS to stream the m2t transport stream directly to the TV [3].
Caveats, Notes and Other Discussion
Recording HD content is awesome. It looks amazingly crisp on my powerbook LCD screen. I’m glad I figured this out before the season premiere of 24.
Now it’s time for a few words of caution. It takes significant firepower to process streams of this capacity. At over 100MB/min, recording HD content averages about 7-8GB/hour for HD content. My powerbook suffers from screen-jitter during HD playback. It’s 2 years old — 1.33Ghz PPC, 1.25GB RAM, 32MB Video Card — and not designed for this kind of abuse. In addition, my meager 60GB hard disk proves much too small to record anything regularly — I’m glad that my server has ~500GB of spare disk capacity.
Just make sure that whatever disk you store your .m2t files on has large file support — Fat32 filesystems only support files up to 4GB. Thankfully, HFS+ formatted drives (standard on Macs) do not suffer from this limitation.
The final caveat that I wish to mention is that of encryption. Many channels will be capturable but you’ll lack the ability to play them back due toan inability to decrypt the stream. With some time I bet a suitable decryption application will spring up.
On a final uplifting note, it turns out that someone has already wrapped up all the recording details into a slick carbon app — iRecord.
Update
As pointed out by one Digg user (thanks teif), instructions for capturing content over Firewire on PCs is available at hdjunkie.com.
References
[1]http://www.avsforum.com/avs-vb/showthread.php?t=386740
[2]http://www.gizmodo.com/gadgets/tag/fcc-requires-firewire-on-all-cable-boxes-9313.php
[3]http://www.macosxhints.com/article.php?story=20040426151111599
[4]http://www.ammesset.com/software/irecord/
[5]http://hdjunkie.com/tutorials.html





Posting your comment
jbelkin | January 15, 2007 @ 7:48 pm
iMovie will also see anything coming thru Firewire - you do have to live with the clips pane to the right - or you can wait until it’s done recording and then output it - everything from QT compressed to DV.
ecb29 | January 24, 2007 @ 7:22 pm
You write with references. I am officially impressed. Unfortunately, though, your blog is so mac-y. If only it had some IE or XP goodness…
DataTracer | February 7, 2007 @ 1:16 am
I don’t know about for HD streams, but for standard def, I use a Pinnacle RCA->FireWire breakout box to get my cable signal into the Mac. Then I use a program called Vidi to schedule recordings. Vidi records as native DV, so you can import the files into iMovie or Quicktime Pro to remove commercials.
matt | February 7, 2007 @ 3:37 pm
Do you know if you can then burn those m2t files to DVD for backups of your recorded shows. I know that they will be compressed from HD (1080i 720p) down to DVD (480p?) but that would be good enough for archiving shows. Thanks for the great walk through by the way, I plan on trying it out tonight.
Jeff | February 8, 2007 @ 2:14 am
I can’t get iRecord to record at a specific time. The time slot comes and goes and iRecord does not activate. Any other programs that might do this and actually work?
jackal | February 20, 2007 @ 3:51 am
I’m fortunate enough to have the DC6412, too, with active FireWire ports. I’ve recorded quite a bit of content with success following pretty much the same steps you’ve outlined.
Since I’m away from home quite a bit, I’ve been looking at the Slingbox as a way to watch TV over the Internet while I’m at work (I work customer service and it can be slow during the off-season), but it’s expensive, and the purist in me doesn’t like converting from digital to analog and back to digital. It seems to me that I already have the majority of what the Slingbox does; I just don’t have the software that will process the signal the way I want it to.
If I could get some program that works like AVCVideoCap or iRecord to get the MPEG2 stream off of the cable box but instead of saving it as a .m2t file would dump the output to something that could reencode it in real-time as a streaming H.264 (if the processor can handle it–H.264 is probably the most compatible and best quality option). Perhaps it could emulate a DV cam and QuickTime Broadcaster could encode it, or perhaps I could get it to work with VLC. (Actually, I almost have VLC working streaming the raw .m2t file–the only problem is the m2t file keeps growing and would eventually fill the hard drive. I really need it to be a pipe of sorts.)
If you have any ideas, post ‘em (and maybe email me, if you have access to my email address)…
OddyOh | February 25, 2007 @ 2:06 pm
Sweet, I had tried this two years ago on my Mac Mini, but couldn’t really make heads or tails of it. Now on my 24″ iMac, I can capture unencrypted HD from my cable box!
Friendly Stranger | March 13, 2007 @ 10:31 am
EXCELLENT info!!! I learned a lot, I tried to record from my HDTuner before, and was not successful. I’ll give this a try…
DaniCalifornia | March 15, 2007 @ 2:03 am
Will you please eloborate on how to open and use mplayer or vlc for playback? This was a very good tutorial, but I need a little more information.
Also, Jbelkin, if you happen to stop by here again, I’m curious as to how capturing video on iMovie.
I’m new to my mac, and so far its been frustrating switching. For getting content off of my dvr(the same one you have) to my old pc, I used my camcorder as a medium, however I’m looking for something easier and less time-consuming now.
ejonesss | March 17, 2007 @ 10:18 am
@ jbelkin you did not mention what version of imovie and what modle mac you are using.
i am assuming it is probably imovie hd (because i have seen somewhere that imovie can handle mpeg ) on a fairly newer mac either a mac upgraded with a 1 gig or faster processor or a intel based mac.
if that does not apply then make sure you don t happen to have a video digitizer connected at the same time (i made that mistake too and falsely thought the dvr was outputting in dv stream)
aj | March 20, 2007 @ 10:00 am
I see a lot of potential here for a real living-room UI Mac PVR. SnapStream, who make the great Beyond PVR for Windows, have a very cool site now called CouchVille, an AJAX-powered channel grid website which has quite extensive north american coverage. If there was some way to get that data through some sort of API, even RSS or something, there could be a customized channel grid UI that one could navigate with an Apple Remote for tuning (simple pass-through of the stream) or recording. Dual tuner support would be nice too, so you can watch one channel while recording another, but that might require hardware encoding.
RazorSharp iPods & Raw Gadgets » Blog Archive » TUAW Review: HDTV with the EyeTV Hybrid | March 20, 2007 @ 5:12 pm
[…] If you can’t get HD via the airwaves, cable subscribers with Firewire-equipped set-top boxes do have another DIY option for recording unencrypted HD programming (the broadcast networks, basically) — the Apple Firewire SDK. Check out this post for a brief how-to, and this macosxhints thread for more; it’s not a supported solution but it may be worth a try. There’s even an all-in-one tool under development (iRecord). None of these approaches, however, will let you watch live HDTV on your Mac like the Hybrid does. […]
RocketBoy | March 20, 2007 @ 10:08 pm
What about the “final” step - recording these files to a DVD in the Mac?
Can DVD Studio or iDVD play these files and record them onto a DVD?
Do they need to be converted in some way for that to happen?
Or can it be done at all?
Thanks. Great article, and I hope you can answer my questions.
ende | July 24, 2007 @ 10:10 pm
Ok, here goes… from STB (set top box) -> video iPod (or iPhone)
* Follow the directions as above, then open the .m2t in VLC.
* From VLC, go to File>Streaming/Exporting Wizard
* Check Transcode/Save to File, click next
* Select your stream, click next
* Transcode video to MPEG-4 Video, audio to MPEG-4 Audio
* Play around with the bit rate here. I tried 128, but the video looked a little grainy
* Follow the remainder of the menu (pretty self explanatory), selecting MP4 as the output format
You’ll get a .mp4 file which you can load into iTunes, and with a little tinkering load onto your video iPod. Any advice on the bit rate would be welcome.
DigitDog | July 30, 2007 @ 2:00 pm
Glad you wrote exactly what I needed. Buying a DV recorder but Apple TV turns out to be just an HD, Best blog ever, even bookmarked it. Actually factual, too.
scott | October 4, 2007 @ 12:14 pm
Hi Guys,
Recently mac converted. Lots of luck with me so far and am hoping to push it further. I correctly have my scientific atlanta 3250hd box connected to the firewire port on a mini stack that then is connected to my mac mini via firewire. Able to view and record tv.
I would like to use the eyetv software to make this nicer, do you know if in this situation I could use their software (80 bucks) and not their hardware?
Ryan | October 21, 2007 @ 7:26 pm
Anybody found a way to play encrypted video? I just tried to playback a clip I recorded on FOX, and it won’t playback. It appears the rule that over the air stations would be unencrypted doesn’t always hold true.
Stefani Koorey | November 17, 2007 @ 9:41 am
I finally figured out a way to get the previously recorded video off the DVR and onto the computer. Thanks to the above plan of attack I modified it slightly and it worked.
I am running Leopard on a 2.16 GHz Intel Core 2 Duo i MacBook.
Here is what I did:
I purchased the QuickTime MPEG-2 playback component at http://www.apple.com/quicktime/mpeg2/ for $19.99 plus tax. Downloaded it and installed it.
I downloaded and installed Apple Firewire SDK (free registration required) from the Apple Development Kits Page http://developer.apple.com/sdk/
I downloaded and installed the free MPEG Streamclip from http://www.squared5.com/
I connected my computer to the DVR from Brighthouse Networks (Explorer(R) 8300HD) with a firewire plug.
I ran the recorded show on my TV and put it on pause at the part I wanted to record.
I followed the instructions above regarding Recording Content:
“Recording content couldn’t be easier. In fact, Apple’s Firewire SDK ships with all the capture software that we need. It contains a nifty little program called ‘AVCVideoCap’ that provides an interface for connecting to and capturing DVHS video streams via firewire. It’s located (on my machine, using version 23 of the Firewire SDK) at:
/Developer/FireWireSDK23/Applications/AVCVideoCap.app”
I selected the device from the list, chose a file name, selected a recording time and hit Capture from device.
I hit play on the DVR to play the clip I wanted that I had previously recorded.
When the capture was complete I opened MPEG Stream clip and there it was!
I used iMovie to edit further and make the M4v file to upload to YouTube. You can see the video I recorded off the DVR here: http://www.youtube.com/watch?v=XCc_5Wdo0V0
Cheers!
shellio | November 20, 2007 @ 12:21 pm
Hi there-
I have been working on this for a couple of days, as I’m about to cancel comcast and want to get some shows recorded that I have on the DVR. I have no programming experience and don’t understand a lot of the techie stuff but this is my experience:
I followed the above guide. I thought the image quality was actually not great. I have comcast and a scientific atlanta explorer 8300HD but we don’t have HD. Had no problem with the firewire on the cable box. I downloaded and used SDK firewire with no problem. I couldn’t get mplayer to play the m2t file but then was able to get it to play with no problem in VLC. I wanted to edit out the commercials and attempt to put it on a dvd, so I used VLC to convert the format to mp4 in order to use imovie for editing. I did this with the transcoding wizard and used “mpeg 4″ for the codec in both audio and video, with bitrates of 1024 and 192 respectively. Initially, to save time, I tried to transcode without viewing the file (no local playback), but the audio was not in sync with the video and there seemed to be some sort of skip in the middle of the show, and at the end it basically got stuck on one frame for a long time. Then i did it while just playing the whole episode (”local playback” checked) and it converted fine, although pretty poor quality. This may be because I used 1024 as video bitrate although it already looked like pretty poor quality when i watched on VLC so I’m not sure if it would look better with a higher bitrate or not. Also, the show is in widescreen but the ratios seem to be a little messed up on imovie and I’m not sure what to do about that. But, I have the episode saved on the computer now and I can mess around with it a little bit, I guess. At least it shows up in imovie so I know I’ll be able to edit it and make a dvd of the show.
I don’t have quicktime pro or mpg reader but simply changing the file name to end in .mpg made it so i could watch as mpg, I am not sure whether getting quick time pro would allow me to edit the video or change the format although i considered it. I got streamline but it won’t play the video, not sure about its capabilities but maybe I’ll try doing as the above poster did and just get the quicktime mpeg reader.
So hopefully this will help someone out, I have spent a lot of time on it so maybe I can save someone else a little time. I would also like some help with the whole process to make my videos better, it is just a workout video so quality isn’t too important but I would like to know how to do this better:
1. How can I improve overall picture quality?
2. How can I ensure that the video maintains the proper aspect ratios? (not sure if this is even the correct term.) When I play in VLC at “Normal Size” it looks fine in the window but even as I make that bigger, it seems to distort it, and it also seems distorted in imovie.
3. Is there a way to make this process faster? It ends up taking almost 3 times as long as the entire episode, and I haven’t even started editing out the commercials.
This is a great post, here’s a link to a similar topic:
http://karmicaxiom.blogspot.com/2007/09/how-to-watch-hdtv-on-your-mac-live.html
Gary Watts | January 3, 2008 @ 12:09 am
Thanks for this tutorial. I was able to successfully record to my G4 mac mini the first time I tried.
Mike Sanchez | January 28, 2008 @ 2:31 am
In regards to this topic, I have the FireWire SDK and everything necessary. I know you can record in real time but is there a way that you can watch the video output in real time as I use my HDTV as a massive computer monitor. If anyone could help it would be appreciated. Thank you.
Thorhallur | February 19, 2008 @ 11:23 pm
I hooked my Comcast HD DVR which is a DCH-3416 (Motorola). I opened the AVCVideoCap… the box is listed there and Attached = YES. However, the button “Capture from Device” is grayed out and not clickabe? What am I doing wrong?
Eric | February 24, 2008 @ 1:08 am
This sounds great, I’m going to look into it.
Anyone have luck using DirecTV?
I’d like to record some HD content from channels like ESPN. I’m assuming this is encrypted - any way around that?
KingOfSpain | March 6, 2008 @ 9:54 pm
Thank You Chris Columbus.
Without people like you, I would not have a whole new world to watch.
Drainerguts | March 12, 2008 @ 10:47 am
This process seems like it would be very well suited for short music videos to play on iTunes and on the iPod. I was able to capture the .m2t file and then, using VLC export function, re-format to MPEG 4 using the h.264 video codec. This file played very well on VLC, however, when I imported the file into the iTunes library and played it with iTunes (or QuickTime), the audio quality degraded (video was fine). I lost about 75% of the decibels…plays back very quietly. Any ideas what may have caused this?