by utilising vlc’s built-in video on demand mechanism, we can take our video streaming to iphone one step further, by serving up any video we want watch. if we exclude the vlc web configuration, the only thing we’ve really changed in our previous “how to”, was the mechanism to transfer the transcoded stream to the segmenter. Instead piping the data from one process to another, we’re now sending the data via udp.
caveats
this “how to” is not even remotely secure i.e. unless you’ve enabled logging you won’t know someone is dictionary attacking you. saying that, the worse they (hacker) can do is change what you’re watching!
no doubt, as soon as i publish this post, someone from the videolan team contacts me to say you can run remote arbitrary shell commands via the web interface!
if you’re paranoid about leaving everything on, i’d suggest you setup a kill switch to stop mac web server and stop port forwarding on your dsl/cable router.
pre-reqs
same as previous streaming how to post.
i neglected to mention you needed to setup port forwarding too, see [1] for further assistance.
vlc http configuration
first let’s attempt has some half-assed security, by password protecting the interface.
cd /Applications/VLC.app/Contents/MacOS/share/http
create a new file called .access and add a login and password. the format is as follows:
login:password
yup that’s right, it’s just a single line.
now the dangerous bit, accept connections from every where. to date i know of no cell provider that allocates static ip address to iphones. in theory you could dig your current ip address and at least limit access to iphones on your cell network.
.hosts (uncomment the last two lines):
::/0 0.0.0.0/0
setup video transcoding and streaming segementer
fire up two terminal sessions (or screen if you’re hardcore)
screen 1:
/Applications/VLC.app/Contents/MacOS/VLC -vvv -I http \
--sout-x264-level=31 --sout-x264-profile=baseline \--sout-x264-aud \
--sout="#transcode{vcodec=h264,vb=96,acodec=mp3,ab=64,\
height=240,width=320,scale=1}:\
standard{mux=ts,dst=127.0.0.1:1234,access=udp}"
screen 2:
mediastreamingsegmenter -f /Users/booyaa/Sites -D 127.0.0.1:1234
load up and watch
almost there, now we just need to pre-load vlc’s playlist. i tried using the web page on the iphone to add media, but the experience is awful. so i would recommend you setup the playlist on a desktop browser. by default vlc’s web server will be listening on port 8080.
irrespective of if you use the vlc web interface on an iphone or desktop the experience is crap. having used boxee (beta) for some time now, the bar has been set very high and the file explorer way of finding media is just so last millennium!
thankfully the web interface is just about usable on the iphone for pausing, skipping to the next item in the playlist. the http interface can be customised, but so far the mobile contributions i’ve seen don’t provide any mechanism to load media, just the basic video player controls i.e. pause, play, etc.
sources:
[1] – http://portforward.com/




how to: stream video on demand on your iphone « booyaa dot org: http://bit.ly/cIZl1M