Saturday, 7 January 2012

So you want to get your ustream video off your iPhone?

UStream.tv is great for streaming events to distant relatives and such. My wife and I used their iPhone app to great success for our wedding last year. Unfortunately, for videos that we were able to record but not stream due to limited WiFi access, we have had no luck getting the incredibly slow uploads to actually complete. After a year and numerous attempts, I thought I'd find my own way to get these video's off the device without resorting to jailbreaking, etc.

Ustream sends a HTTP request to ask for the location of an FTP server to upload your videos to. We will pretend to be that server.

1. On an ubuntu box (call it 192.168.1.10):

$ sudo apt-get install ftpd wireshark

2. Find or setup a linux router between you and the internet and run this on it:

The first line sends all FTP traffic to your local FTP server instead of wherever it was originally headed.
The second line redirects all ports sent to the ustream FTP server IP subset (at the time of writing at least. ping red37.ustream.tv) to port 21.
Together they make sure all the traffic ustream tries to send to itself gets sent to your ubuntu box instead.

3. Now you either a. mess with your FTP server to allow all usernames / passwords to work (edit the source code, mess with authentication modules, etc.) or b. do as I did and run tcpdump on your linux router: