How to Guide

...your way to easy computing

  • Increase font size
  • Default font size
  • Decrease font size

How to stream video from your web page using flash player Ubuntu - Linux

E-mail Print
User Rating: / 3
PoorBest 
There are no translations available.

This how to guide, tutorial will provide you with step by step instructions from scratch, on how to stream video files from your web page using ffmpeg to convert the file to .flv type and stream it.

  1. Lets explain couple of things before proceeding. There couple of ways to stream media: one way is by downloading. User downloads the file and then watch it on his favorite player. Streaming is another way, that as soon as it begins downloading the file is being played, user receives it at a regular speed, no waiting is applied but you need a streaming server for this. You can also do live streaming using this method but costs too much.The third way and most common is progressive download, is the one we are going to explain. Is a combination of the above two, as soon as you download a portion of the file it's being played while downloads the next portion (buffering) etc..
  2. Now you will need a flash player, there is a free one (that is very good) called JW FLV MEDIA PLAYER from http://www.jeroenwijering.com click here to download it
  3. Upload the file to your web hosting server and extract it using the following command through ssh unzip mediaplayer-3-16.zip current version is 3.16.
  4. Let us assume that the extracted directory mediaplayer-3-16 is under the /home/<username>/www folder(it should be under the public_html folder) so that the full path to the player is /home/<username>/www/mediaplayer-3-16
  5. Now you have to convert your file to .flv (flash media file). Under Linux enter the following command
    ffmpeg -i INPUT -b -acodec copy 400k -r 30 -ab 128k -ar 48000 -s 320x240 -f flv OUTPUT.flv where INPUT is your video file (e.g sample.avi) and output is your output video file (e.g sample_out.flv)
  6. Upload the file to your web hosting server (e.g www.<mywebsite>.com/media)
  7. Now enter the following portion of code into your html or php file
    <embed src="http://www.<mywebsite>.com/mediaplayer-3-16/mediaplayer.swf" width="320" height="250" allowscriptaccess="always" allowfullscreen="true" flashvars="height=240&width=320&file=http://www.<mywebsite>.com/media/<filename>"/>
    replace <mywebpage> with your url and <filename> with the file you have uploaded (e.g example_out.flv)
  8. Now should look like the following example
Last Updated on Wednesday, 04 February 2009 09:33  
Do you like our new site design?
 

Related Articles