
While working on streaming Flash video support for
jpandmeghan.com, I encountered some very interesting buffering problems with
Flowplayer. Turns out the way I was originally loading videos into Flowplayer was filling up its in-memory buffer too quickly causing it to generate an "
out of memory" error. The video would start to buffer and then about 20 MB or so into the buffering process, it would just stop. I dug into this a little more, and found that the way I was loading the video stream into Flowplayer wasn't optimal:
I was trying to load a 30MB Flash video file entirely into memory, which is bad.
A better approach is to use a
Flash video streaming server (RTMP) to deliver your streaming content to the browser.
But, if you don't want to spend the money on an expensive RTMP solution, you're in luck because you can simulate a primitive RTMP server using Apache and PHP ...
Rich Bellamy provides
a good solution here on his Wiki, which I used on
jpandmeghan.com. Essentially,
this PHP streamer acts as a bandwidth controller by only sending small chunks of video at a time from the server to the browser (Flowplayer). This simulates a real streaming server. As a result, this lets you stream very very large video files without having to buy into an expensive RTMP server solution. All you need is a
decent server that supports PHP, and a lot of bandwidth.
I've provided
a mirror of the PHP streamer here for your download convenience.
FOLLOWUP 2/7/09- You also might like to read Flowplayer's guide to Pseudostreaming, which explains how to convert just about any web-server into a fully functional streaming server.
- Remember to add meta data to your FLV files using flvtool2. From the Flowplayer Pseudostreaming site: "Without this magic touch (flvtool2) you cannot make random seeks to your FLV file.
What this actually does is that it makes keyframe metadata available
for Flowplayer. When the user seeks in the timeline the player gets the
closest keyframe position from this metadata and passes it to the
server. The server then serves the file starting from this position."
Did you find this post helpful, or at least, interesting?