Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create progressive-downloading Flash videos Internet
If you are seeking the largest audience possible with embedded streaming video, Flash video is a good choice, since it is allegedly supported by 98% of all browsers. One can easily create Flash video that can be downloaded progressively with a few open source or other freely available tools. The easiest way to encode the video is with ffmpeg (available through Fink) with something along the lines of:
ffmpeg -i movie.dv -f flv -r 12 -me full -subq 5 -mbd 1 -b 150 \
-qmin 2 -qmax 31 -s 360x240 -acodec mp3 -ar 11025 -ab 16 -ac 1 video.flv
This will create a Flash video with settings of 12fps, 360 by 240 pixels, 150 video bitrate, and a 16 bitrate mono audio track. Now to make the Flash video support progressive downloading in all the major browsers, we need flvtool2. Once installed, run the following command:
flvtool2 -u video.flv
At this point, all you need is to provide a SWF wrapper for your Flash video. There's a serviceable one here. Download it, expand the archive, and follow the instructions in the readme folder to install and link to your webpage.

Addendum: Using ffmpeg to encode your Flash video will yield quality about on par with what you could get with shareware product such as video2swf. But even better results can be attained with mencoder. The catch is that you have to compile mencoder from source to get it to work -- a venture ill-advised for the unix-challenged.

In any case, with a newly-compiled mencoder, the following command should work:
mencoder input.dv -ofps 12 -o video.flv -of lavf -lavfopts \
i_certify_that_my_video_stream_does_not_use_b_frames -oac lavc -lavcopts \
acodec=mp3:abitrate=32 -srate 22050  -ovc lavc -lavcopts vcodec=flv:\
vmax_b_frames=0:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2 \
-vop scale=360:240
To get an idea of the sort of quality produced by mencoder, go here. You can create Flash video that will play nice with slow internet connections by changing the abitrate to 8, the srate to 11025, and the vbitrate to 35.
  • Currently 1.78 / 5
  You rated: 1 / 5 (9 votes cast)

Create progressive-downloading Flash videos | 9 comments | Create New Account
Click here to return to the 'Create progressive-downloading Flash videos' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Vs h264?
Authored by: DamienMcKenna on Sep 28, '06 08:11:17AM

For anyone who has done either trick, what is the filesize and quality like in comparison to h264?

[ Reply to This | # ]
Only starting from DV?
Authored by: shmuel on Sep 28, '06 08:32:28AM

Do these encoders only work when they start from dv as a source? Or could I convert the little avi videos made by my digital still camera with these encoders as well?

To revise: Does avi to flv work?

[ Reply to This | # ]
Only starting from DV?
Authored by: xkalibur on Sep 28, '06 08:39:37AM


[ Reply to This | # ]
Create progressive-downloading Flash videos
Authored by: dleifelohcs on Sep 28, '06 06:58:38PM

incorrect command for flvtool2, should be:
flvtool2 -u video.flv

and to answer questions, it will work for any type of video that your encoder can support. I just did mine from an MPEG4

[ Reply to This | # ]
Is this a VP6 flash movie?
Authored by: gjm25 on Sep 29, '06 07:46:33AM

Is the command given for encoding with mplayer using the VP6 codec?

And are there any guides available for compiling mplayer on osx? I've been going through man files but it's taking ages to figure out all the errors and missing header files.

[ Reply to This | # ]
Create progressive-downloading Flash videos
Authored by: bluehz on Oct 02, '06 08:16:49PM

OK - maybe its just me, but I find some issues with this hint - mainly - I have spent hours trying to work through it and I get nothing.

First - there doesn't seem to be any method the avg person can compile and/or install a version of mencoder that supports the options above.

Ok - that give - we try to use ffmpegx for lower quality.

Now we have our flv - and attempt to use flvtool2 - unfortunately the downloaded flvtool2 is a .exe file. I attempted to enable execution (chmod..) thinking heck it might just be a mislabled binary...nope appears its a windows binary. All my attempts to run flvtool2 in Tiger have failed.

Anyone else seeing this sort of massive HINT failure???

[ Reply to This | # ]
Create progressive-downloading Flash videos
Authored by: mcamou on Oct 03, '06 05:44:01AM

Did you select the .zip or the .tgz download? I went to the flvtool2 page and hit the Download link. I selected the .tgz option. It contains a binary called "setup.rb" and in the bin directory there's a shell script called "flvtool2" which calls on a set of Ruby files. No .exe or anything similar.

[ Reply to This | # ]
Create progressive-downloading Flash videos
Authored by: bluehz on Oct 04, '06 06:09:16AM
Thx for the advice that seems to have worked. Although you first need to run Setup.rb like such:
sudo ruby setup.rb
To actually install the needed components. The flvtool2 file included in the bin directory is nothing but a pointer. After running setup.rb everything seems to be installed and working now

[ Reply to This | # ]
Create progressive-downloading Flash videos
Authored by: mesa on Oct 03, '06 07:59:59AM

If you download the tar file instead of the zip file you will get a Unix script that you can use.

[ Reply to This | # ]