This post describes how to setup VLC to transcode live video streams to iPad/iPhone 4 compatible H264 mp4 format. Unfortunately the iPad/iPhone 4 does not support any kind of normal streaming, but something Apple calls Http Live Streaming. This means you need to do a bit more as well. I’m going to use an ASF stream from the national television channel in Norway (NRK) as a sample. The same method should work on all streams that VLC supports. NRK has a mobile portal (m.nrk.no) where there is an iPad compatible stream, but the quality if quite low in comparison with what I get with this method and a HQ stream.
What I use:
- VLC player from http://www.videolan.org
- Http segmenter from http://www.espend.de
- A web server capable of serving static content (Apache, IIS or any old web server)
- A powerful computer. Transcoding video in realtime eats CPU. My Intel Core i7 Q720 (4 x 1.6 GHz) barely manages three streams at a time.
Firstly I use a small script to make VLC fetch the ASF stream and convert it to a new H264 transport-stream. This stream is piped into the http segmenter. The segmenter is responsible for chopping the stream into nice small 10 seconds segments and save them to separate .ts (transport-stream) files. A list of these files are stores in a continuously updated m3u8 playlist file. The playlist contains a list of the 5 latest files each containing about 10-seconds of video. The iPad continuously reloads this file and fetches new .ts chunks and needed. These segments are played back-to-back without gaps thus creating an illusion of viewing a stream.
The first thing you need is to setup the VLC | segmenter pipe. I’ve created a small script that does this.
Click to see full size
Then setup a web server to serve the .ts and .m3u8 file. Make sure to setup the mime-types as specified in the specification from Apple.
If you have an iPad you can open safari and navigate to http://ipad.codewrench.net/ to see a demo. This serves a low-quality stream of NRK1. I don’t own an iPhone 4 so I dont know if it works there as well.
I don’t have the server power nor the bandwidth to serve this to everyone, nor do I probably have the right to. So if you want to watch live TV use this description to setup your own system.
I’ve added everything I use to a bundle archive so you can easily start yourself:
download bundle (28 MB RAR file). It’s pre-setup if you unpack to C:\Streaming\
Just unpack and start “00 start_stream_nrk1.cmd”. Wait a bit and navigate to http://your-computers-ip-or-name/ on the ipad.

Det fungerer fint å streame NRK-programmer til iPad fra http://m.nrk.no, så du kunne spart deg litt koding ved å gå dit
Hehe, jo du kan jo se sånn på det. Løsningen jeg beskriver kan brukes også på andre streams. Den som er tilgjengelig via http://m.nrk.no er ganske lunken i kvalitet. Bruker jeg HQ streamen fra NRK.no så blir det meget lekkert på iPad-en. Dessuten er litt koding aldri bortkastet
Syns m.nrk.no fungere like bra. Den starter i crappy kvalitet så stiller den opp kvaliteten.. Men en fin løsning for streaming
Hi, and thanks for posting this! I was wondering if you could help me with this. I edited the cmd file in your download for my streams, and added your the “stream” folder IIS, configured the MIME types, and can see the TS files being created. However when I enter my IP address in the browser on the iPad, I only get a black screen, and idea why this is happening? Thanks.