Webmaster - Easily publish a video on a web page

October 2016

Publishing a video on a web page is not always obvious: Depending on the format used (AVI, MPG, MOV ...), everyone does not necessarily have the right and proper codec/plugin to read them. In contrast, almost all browsers supports the Flash plugin (SWF). Flash is commonly for video streaming. Here's how to publish a video using Flash, thus making it available to a larger audience.

Windows - Convert video to FLV

Install a FLV converter

Download and install Riva FLV Encoder (Free - 4.9 MB).

Convert video to FLV

  • Select your video, choose the output name and format (resolution, number of frames / second, etc..), click on the "Encode" button and wait. This will generate a .FLV file.
  • The Riva encoder supports most of the popular formats: AVI, MPG, WMV and QuickTime. (list of supported video formats: http://rivavx.de/?encoderhelp).

Linux - Convert video to FLV

Install a FLV converter

Install ffmpeg.
  • For example, under Debian, type: sudo aptitude install ffmpeg

Convert video to FLV

  • Type: ffmpeg -i mavideo.avi mavideo.flv
  • The default rate is 200 kilo-bits/sec. (=25 kb/sec.)
  • If you want better quality, add the -b option to select the out put.
  • For example: ffmpeg -i myvideo.avi -b 512 myvideo.flv

Note: Some distributions come with a version of ffmpeg which is compiled without MP3 support (like Ubuntu). In this case, the conversion will be performed, but the video will be muted.

In this case:
  • Install multimedia codecs : sudo aptitude install mencoder lame
  • And finally to convert your video:
  • mencoder myvideo.avi -o myvideo.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=400:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -srate 22050 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames
  • This should fix the problem (successfully tested on Ubuntu 7.10).

Install the FLV player (Flash based player)

Create the HTML page

  • Copy your FLV file and flvplayer.swf in the same directory and create the HTML file.
  • Example:

  <title>My video</title>   
<object style="width:320px;height:260px">   
  <param name="movie" value="flvplayer.swf?file=myvideo.flv" />   
  <param name="quality" value="high" />   
<embed  width="320" height="260"  src="flvplayer.swf?file=myvideo.flv" quality="high" type="application/x-shockwave-flash" />   
  • It is up to you to adjust the size of the video (width and height) and the name of the flv file. (myvideo.flv).

Related :

This document entitled « Webmaster - Easily publish a video on a web page » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.