As a developer, sometimes I want to share a video inside of an existing web application. In the past, I have relied on progressive download streaming, for simplicity. Unfortunately, there are some limitations with progressive streaming. Generally, one has to limit quality to get a video that will play on most devices. Seeking can also be an issue on longer videos.
Back in 2009 Apple released a solution to this problem called HTTP Live Streaming. While the name indicates it’s only for live events, it’s quite adaptable to recorded content as well. Unfortunately, the software to prepare these streams is usually expensive, cumbersome, or doesn’t provide good quality. Most tutorials will point you at a cloud service like YouTube or Vimeo. Some will recommend using a product like Sorensen Desktop. Others may recommend using something like Zencoder. That’s all a bit excessive, as this can be a simple process you can do on your computer! Once the stream is prepared, you don’t need anything fancy to publish it. Any web host will do, be it Amazon S3, Dreamhost or your own private server.
If you’ve got a Windows machine, grab this zip file. I’ll wait. Unzip it somewhere with some free space. Create a folder named “input” and drop a video file or two in there, and run the transcode.bat file. Mac & Linux users can try the bash version and let me know if it’s working.
In a few minutes, depending on the speed of your computer, you should have a new folder with the name of your video file. You can now upload that folder up to your website and you’re ready to go! Check out the example below or visit it directly here.