Skip to content

How you can use your DVR’s Firewire port to stream live TV over the web

Believe it or not, your standard cable box or dvr is (likely) capable of exporting or “streaming” video over firewire to another i1394 enabled device. It seems that there is some law that requires cable companies to provide a way for the consumer to use a third party device for recording and archiving video.

First thing you’re going to need is a computer. Really any computer will do the job as long as it is firewire capable. I’ve have good success using a single core, Intel 1.4 ghz laptop, that has one of those mini firewire ports. Now of course, this computer is not going to do any heavy lifting, it will just be in place to read the raw video stream from the cable box and then immediately (with out transcoding) make the video available for consumption over TCP/IP, or more specifically, HTTP. A laptop works decently for this purpose as it is compact, quiet and doesn’t consume a lot of power. To get the video off of the cable box, you are going to want to download the linux ieee1394 library. I’ve got the version I used here, or you can find newer versions at this location. Inside the tar ball, there is directory called “examples” that contains a c program called “test-mpeg2.c”. Compile this, you will need it to read the uncompressed video from your cable box and “print” it to STDOUT.

sudo ./test-mpeg2 -r 0 | vlc - -I Dummy --sout '#standard{mux=ps,dst=,access=http}'

This command, combined with vlc, will read the firewire and stream the uncompressed video over HTTP. You can now watch the video on another computer, by using VLC and connection to a network stream address of: http://:8080. In its original, uncompressed state, the video stream will be around 15-18mbps. It looks great and you will enjoy the quality. However, this is going to be a challenge for most cable modem’s upstream capabilities, or even some (G) wireless networks, so if you want to watch the video over the internet, or over wifi, you will need to first transcode the video into a smaller resolution and bit rate. This is where we start to leverage more of the mystical VLC’s powers:

cvlc -I Dummy http://192.168.1.110:8080 --sout='#transcode{vcodec=h264,vb=0,scale=0,height=480,acodec=mp4a,ab=128, channels=2,samplerate=44100}:standard{mux=ts,dst=,access=http}' :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

This is going to transcode the stream into a 852×480 (480p) sized video that will transfer nicely over a cable modem. I think the quality still looks great, and you can reliably watch it over most internet connections. All you need to watch is the VLC client. Depending on the quality of the incoming video, you will need a decently fast computer to keep up with the encoding demands. I have a “Core2Quad” that runs at 3.0Ghz, and when doing 1080p video, the CPU is maxed out at 370% utilization.

Streaming to your iPhone isn’t too hard as long as you provide your a web server and you use the nightly development builds of vlc. As of this post, you need vlc 1.2.x or greater to use this. The following command will give you a decent quality video, with great audio, should work well over wireless or even 3G:

cvlc -I Dummy http://192.168.1.110:8080 –sout=’#transcode{height=480,fps=25,vcodec=h264,vb=1024,venc=x264{aud,profile=baseline, level=31,keyint=31,ref=1},acodec=mpga, ab=64,channels=2,samplerate=44100}:std{access=livehttp{seglen=10, delsegs=true,numsegs=5,index=/var/www/streaming/mystream.m3u8,index-url=http://192.168.1.105/streaming/mystream-########.ts},mux=ts{use-key-frames},dst=/var/www/streaming/mystream-########.ts}’

You’ll notice I’m using internal addresses for the url value. This is the value that is used when building the index or .m3u8 file. If you want to stream it over the internet, you will need to replace this internal address with something publicly available. If you make this file available through a web server, and all of the counterpart stream files, you should be able to access the index file from Safari on an iPhone and watch the video.

This is of course how it should work… I find, at times I am unplugging my firewire cable, plugging it back in, turning the cable box off and etc, before I can get it to go. You learn the nuances of the setup over time, and after doing it enough I can now reliably stream any major west coast only sports event to a computer, live, on the other side of the country.

Categories: Uncategorized.

exiftool can fix your Aperture library

After waiting for the barrier to entry to become feasible for my pocketbook, I finally jumped into the DSLR world by purchasing a new Nikon D5100. Thus far it has been an absolutely wonderful camera and has provided me many photos that I will cherish for many years to come. My first one thousand exposures or so were taken with an incorrect date programmed into my camera. Every bit of date related metadata in my images is off by exactly one year. Looks like I forgot it was 2011 and put 2010 into the settings. I use Aperture to process, organize and edit my photos, but I could find no way to increase the year by one on all of my images.

Enter ExifTool. The amazing perl script that will read and save metadata to almost every digital photo file format known to man.

ExifTool makes it easy to increase the year by one, with this simple command that can be run on an entire Directory, or individual file:

exiftool -AllDates+="1:0:0 00:00:00" DIR (or filename)

Now, I peeked inside my Aperture Library and found the directory called “Masters”, where all Master image files are stored. I ran the following script inside the directory and it took care of business. My semi complicated find command ignores files with spaces, ignores Canon, iPhone and other unwanted files. What I’m left with is my Nikon pictures, which I can then run the exiftool command on.

#!/bin/bash
 
function is2010() {
	fileName=$1
	creationYear=$(exiftool $fileName | grep "Date/Time" | sed 's/^.*: //g' | awk -F":" '{print $1}' | grep 2010)
	return $?
}
 
imageFiles=$(find . -type f ! -name "*(*" ! -name '* *' \( -iname "*.jpg" -or -iname "*.nef" \) ! -iname ".*" ! -iname "IMG_*" ! -name "CSC_*")
 
for f in $(echo $imageFiles)
do
	if ( `is2010 $f` ); then
		exiftool -AllDates+="1:0:0 00:00:00" $f
	else
		echo "skipping $f"
	fi
done

Categories: Uncategorized.

Fatherhood

more photos

Categories: Uncategorized.

Floors almost done! Next up, a darker finish…

Categories: Uncategorized.

systems engineering can be dangerous

While talking about how excited I am for tonight’s national championship game, I spilled boiling hot green tea all over my foot. It went through my socks and down into my shoe where it continued to sit and further burn my skin. It hurts bad. If the Ducks lose tonight, the pain from my foot should override the devastation from a BCS loss.

UPDATE: If you want to see some seriously gross foot burn action follow this link. I’m warning you, it is quite disgusting. I guess burns get worse after a couple of days.

Categories: Uncategorized.

Camera phone provides window into brain

The subject matter of the average iPhone photo is so comically different from what you see come out of traditional single-use cameras. By all known and accepted photography standards, my phone snapshots are horrible. They are out of focus, framed poorly, the lighting usually sucks, but they have a certain quantity of “realness” thanks to the impulsivity that usually plays a role in their capture.

Categories: Uncategorized.

global iphone pics

An almost complete trail of where I’ve been over the last couple of years. Missing ATL, LAX and DENVER, but close enough!

Categories: Uncategorized.

I spent some time in the garage this weekend

I love my garage. It is, with out a doubt, my favorite room in the house. Here are some photos of my latest efforts to organize my server infrastructure. At the bottom of the gallery you’ll find a little video tour I shot with my iPhone. If you’re curious, I’ve got an AppleTV running Ubuntu 8.04, a Dell D520 Laptop running Ubuntu 10.04 LTS and a Dell XPS 720 with Ubuntu-Server 10.04 installed.

Categories: Uncategorized.

I wrote this to learn iOS development

QuickFactor is an application I originally wrote to find factors for a given number. What I didn’t realize is that there is an application already in the App store that gives factors for a number as well as GCF, LCM and prime factors. I felt it was necessary to at least offer the same feature set so I went ahead and added those things to the existing design. When I had just one input and one task to worry about, it was pretty simple to have a bar across the top of the window, similar to what you’d see in Safari. It’s a familiar layout to most and the feel of the application doing work while input is being inserted encourages efficiency. This application is not a feat of engineering by any means, but I did learn plenty about what it takes to get an app into the App store
QuickFactor

Categories: Uncategorized.

Tags:

Tunes to do work

Straight Lines by Silverchair
Cult Logic by Miike Snow
I’ll Get You (feat. Jeppe) by Classixx
Satellite by Guster
Jesus Christ by Brand New
Stop Me by Mark Ronson featuring Daniel Merriweather
Moar Ghosts ‘n’ Stuff by Deadmau5
Natural Disaster by Fischerspooner
So Easy by Royksopp
Making Me Nervous by Brad Sucks
Du What U Du (Trentemoller Mix) by Yoshimoto
Tribulations by LCD Soundsystem
Bonafied Lovin’ (Yuksek Remix) by Chromeo
Language Symbolique by Thievery Corporation
One Minute to Midnight by Justice
Love Is Gonna Save Us by Benny Benassi Presents The Biz
Elephant (Dub Mix) by Spiral System & Lottie Child
Supreme Illusion (Nickodemus Remix) by Thievery Corporation
Sad Sad City by Ghostland Observatory
The Geeks Were Right by The Faint

Categories: Uncategorized.

Tags: