Saturday, May 31, 2008
« Guide to kiteboarding – lessons learned | Main |

Universal Web Video Compression to FLV

 

Are you sick of having to download many players?  Many sites like youtube utilize FLASH.  I wanted to figure this out for my own site.  I have gone the Semi-Free way, which always takes some time…  Here are the steps.

 

You will need three pieces of software, that are open source.  Start downloading them from the various sites:

 

  1. 7Zip compression software
    1. A new high compression software to replace zip
    2. Download this and install it
    3. 7-Zip Compression
  2. FFMPEG – Converts your video file to FLV
    1. Flash video is the key to the player problem, as it’s installed on 99% of browsers!
    2. You can read about it here: ffMpeg Converter
    3. Its very geeky, but ill make it a little easier with a simple Batch file
    4. Download the file here: FFmPeg download

                                                              i.      Grab the one with the most recent Date

    1. Unzip it with the 7Zip software above
  1. A Web Player – JW FLV Player
    1. It’s a player that’s free for personal sites and cheap for commercial
    2. It’s very extensible
    3. FLV Media Player Download
  2. Update IIS to stream FLV
    1. Add a mime time for FLV
    2. Set it to: flv-application/octet-stream
    3. See notes: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19439

 

Conversion Steps

I moved the FFMPEG.exe to a know location, like

c:\program files\VideoCompression

 

I then move the video file to that directory, like input.avi.

 

Then I run this from the command line:

 

Ffmpeg.exe  -i input.mov -ar 22050 -ab 32000 -aspect 4:3  -b 2000 -r 12 -f flv -s 320x240 -ac 2 output2.flv

 

Parameter

Example

Description

-i

 

Input File Path

-ar

22050

Audio Sample Rate in Hz

-ab

32000 for Talk

64000 for Music

Audio Bit Rate in Bits / Sec.  Use 32000 for Speaking and 64000 if there is music.  But play around with the right setting for the file, as you can go down and not lose quality.  Going up makes the files bigger

-aspect

4:3

Aspect ration of the video width : height

-b

500-2000

Video Bit Rate.  Use 500-2000 

-r

12

Frame Rate: 12 seems to work well, for action you may want to go higher.

-f

Flv

The format switch.  Many formats are built in.  But for ease of your users, use flv.

-s

320x240

640x480

Size:  For web use 320x240.  You could always do an optional bigger version for the patient people

-ac

1

2

Audio Channels – use 1 for web stuff, use 2 if you really need it, but 1 works.

Output file name

Output.flv

At the end, type in the file name of the result:  output.flv

 

 

 

Publishing

 

After you generate your file, output.flv, you can then edit your html page and include the JW FLV Player.  Look at the readme.html example that comes with it, when you unzip it.

 

  • Place the support objects in a known location on the web server.
  • Reference the Javascript file first
  • There are many options and also a great configurator on the author’s website.

 

 

<div id="container">

<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>

      <script type="text/javascript" src="swfobject.js"></script>

      <script type="text/javascript">

var s1 = new SWFObject("mediaplayer.swf","mediaplayer","300","185","8");

            s1.addParam("allowfullscreen","true");

            s1.addVariable("width","300");

            s1.addVariable("height","185");

            s1.addVariable("file","output.flv");

            s1.write("container");

      </script>

 

Good Luck!

 

More Tips

Video Compression Tutorial

Embedding Flash Tutorial

 

 

 

Saturday, May 31, 2008 10:17:50 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Related posts:
Skiing at Northstar in Big Storm
First Blog Entry - What is this about?

Comments are closed.