WSN Knowledge Base
Featuresspacer Showcasespacer Reviewsspacer Demosspacer Purchasespacer Manualspacer Support
Convert videos to FLV
Convert videos to FLV
By Paul

If your directory involves video content you may wish to convert it to FLV, to be embedded in a player using Macromedia's Flash plugin. Flash reaches a wider audience than WMV, QuickTime and the like and embeds more smoothly.

You have a switch in your switches to convert to FLV (it handles mov wmv avi mjpeg mpeg ogg), but you need to install some software on your server first:
1) lame
2) ffmpeg

Optionally, in order to get meta-data set to allow skipping to particular spots in a video without loading the whole video, you can install these:
3) ruby 1.8+
4) flvtool2

3&4 are not required, videos will convert to flv and play fine without them -- so don't worry about them if you have trouble.

Make sure your host will allow you to install lame and ffmpeg -- some shared hosts may not. Dreamhost has instructions here.

If on dedicated/VPS you may be able to install from your distribution's repositories with apt-get (debian-based distros), yum (Red Hat-based distros) or urpmi (Mandriva). Servers will usually lack the required repositories so you'll have to hunt through google to locate the needed repositories. You can also try a direct RPM/DEB installation though you'll find this takes a long time due to dependancies you have to track down. If you go this route you can search for all needed dependancies here for any RPM-based distro. Use the support channels of your web host for help installing these items.

Also note that since movies tend to be very large files you need to ensure your PHP configuration is set to allow large uploads. Your php.ini should have upload_max_filesize set to something large enough to handle the sorts of videos you want to process.

Once you have everything installed you'll be able to convert files to FLV automatically on upload (when the switch is on). You can control the size of the resulting FLVs at Admin -> Settings -> Articles with the FLV resolution option there. Note the width and height must be multiples of 2 or ffmpeg will refuse to process it.

In order to play the movies WSN Knowledge Base uses the Lovely Video Player 0.1. WSN Gallery has the playback built into the image details page, but in order to use it somewhere else or in another WSN script you can use this template code:
<IF {ATTACHEXTENSION} is flv>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="{FLASHWIDTH}" height="{FLASHHEIGHT}" id="ploneskin" align="middle" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{DIRURL}/videoplayer.swf?video={ATTACHFLASHPATH}&autostart=0" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="http://scripts.webmastersite.net/wsnkb/manual/{DIRURL}/videoplayer.swf?video={ATTACHFLASHPATH}&autostart=0" quality="high" bgcolor="#ffffff" width="{FLASHWIDTH}" height="{FLASHHEIGHT}" name="ploneskin" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</IF>


Put it anywhere within the scope of an attachment and it'll show the player when it's an FLV.

Thumbnails for FLV work the same as for images (use {ATTACHTHUMBURL}). There's also a full-size preview image available which you can access via {ATTACHFLVPREVIEW}.

Rating:


0/5 based on 0 votes. The median rating is 0.

Submitted: 02/06/07 (Edited 10/24/07)

Description: Display video files in a flash player.

Views: 1395 views. Averaging 2 per day.
In the most recent 30 day period, there've been 4 views.

Previous Article | Next Article


Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support