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://
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.






