So I'm definitely a novice at streaming media, but interested in how swift could perform as a media server. Maybe you could start with educating me a bit on your requirements and and I'll try to offer what I can WRT how swift supports pseudo streaming.
I started by installing 'nginx-extras' on my precise box and setup a location for /video/with a mp4 directive and a couple of mp4's. To my surprise Chrome and Safari's built in players both used native range requests (instead of the start=0 query params) and I was able to watch the videos (and jump around) even when serving them directly out of /usr/share/nginx/www.
After that i was less surprised when pseudo-streaming "just worked out of the box" with swift, after I uploaded the files into swift, added .r:* to my video container and hit swift directly from the web-browsers.
However, I'm guessing that some older browser's won't have built in players, or some sites may require a specific media player that doesn't support native range requests.
I did some tests with jwplayer using the following html snippet uploaded into the same container next to the video:
<html>
<script type="text/javascript" src="http://www.longtailvideo.com/jwplayer/jwplayer.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
jwplayer("myElement").setup({
file: "movie.mp4",
});
});
</script>
<body>
</body>
</html>
Not matter what I set (or didn't set) for startparam (see http://www.longtailvideo.com/support/jw-player/29392/flash-pseudo-streaming/ (http://www.longtailvideo.com/support/...) ), I couldn't verify it was doing anything other than normal byterange requests.
Any suggestion how I can get a browser old enough that it doesn't support native byterange psudeo streaming onto my mac? Do you think your intended audience is going to have HTML5 capable browsers?
That said, if we can find a test senario that requires support for startparam style requests, we could try to make something work with nginx just proxying requests to a local swift-proxy bound to loopback. You'd probably still want general swift traffic (i.e. uploads) to go directly into a swift proxy server (either running on the same box/different interface or another machine entirely).
I'm not sure how successful we'd be serving swift's proxy application inside the wsgi module for nginx. You could try it though!
Another option would be to implement some middleware that can request the the first few bytes of the video and read/cache the keyframe offsets - although a quick search seems to indicate that there may not be a widely adopted python library which can parse seekpoint metadata - but I'd be glad to know if one exists?