Open iMovie with the video you have...
File -> Export
Click QuickTime button on top
Compress movie for: Expert Settings
Click Share
Export: Movie to QuickTime Movie
Click Options
Click Settings...
Compression Type: H.264
Frame Rate: Current
Key Frames: Every: 24
Frame Recording: checked
Quality: High
Encoding Best Quality (multi-pass)
Data Rate: Restrict to 500 kbits/sec
Optimized for: Streaming
Click Size...
Dimensions: Custom: 480x360
Deinterlace Source Video: checked
Sound: Settings...
Format: AAC
Rate: 48.000
Quality: Normal
Target Bit Rate: 96
Prepare for Internet Streaming:
Fast Start
...and you've got near perfect web streaming quality!