If you want your server to be able to stream videos and audio in your website, it isn’t too hard. People often use 3rd party video hosting service like vimeo, youtube…etc. There are of course benefits of using 3rd party services. For some, you have to pay a price. The fact is that it isn’t really hard to setup your server to do the job. We will be using HTTP Pseudostreaming in this tutorial.
As of writing, the most popular video format is mp4 encoded with the H264 format. So the first thing we want to do is to convert your video files to this format if not done already. For this, I found transmageddon the best and simple to use. If you don’t mind commandline and remembering the options, you can go for ffmpeg or mencoder.
one liner to install transmageddon if using debian/ubuntu,
sudo apt-get install transmageddon
then in the gui, go to applications -> sound and video. Click on the new transmageddon menu being added. add your file to be transcoded and under presets, choose HTC Android G1 to encode to MP4/H264.
Next we want our webserver(apache) to support streaming over http. Go to http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Apache-Version2 and follow the instructions there. At the end of the day, you should have a h264 apache module loaded upon start of apache.
Now we need a player to support the streaming video. jwplayer is the best as of writing.
If using wordpress, download and install the plugin at http://wordpress.org/extend/plugins/jw-player-plugin-for-wordpress/ then, to get the player to embed the file, create a post and add the following shortcode in the post
[jwplayer file="http://yoursite.com/wp-content/uploads/test.mp4" type="http"]
– where “file” points to the location your mp4 is uploaded.