Create High Quality Flash Videos in Ubuntu

I recently got a nice new camera that can shoot HDTV videos, and the only way to show off the awesome quality to the world is by creating flash videos by myself. Here is an example:

Get the Flash Player to see this player.

I use Ubuntu, so this tutorial won’t work on Windows. I have encoded the video into the H.264 format, left the original resolution at 848 x 480, and the framerate at 30 Hz. I use constant quality setting because then the video look very good even when the camera moves quickly, and it uses less bitrate when not needed. The disadvantage is that the required bitrate is uneven, so make sure youre buffer is large enough before you start playing.

Here is how to do this:

  1. Encode your video with mencoder (click to install). It has to be x264 for video (0 or 1 bframes), and faac for audio.
  2. Convert the result into an mp4 using mp4creator (click to install), as described here.
  3. Now you have an mp4 file that can be played with JW player. Download it, have a look at the readme.html, and follow the example described there.
  4. The player requires 20 pixels in height, so add this to the SWFObject creation.

I have written a small ruby script to convert any movie to a MP4 file. The first parameter is the input file, second parameter is the framerate. Save this file as e.g. convert2mp4.rb.

Have fun!

7 Comments on "Create High Quality Flash Videos in Ubuntu"

Notify of

Thanx for the tutorial, the result looks very good.


Three questions:

What type of camera is that?

How did you mount it to your head?

What software did you use on Ubuntu to pull the video off of your camera and edit it?

Martin Ankerl
Hi tc! I have used a Panasonic Lumix DMC TZ5, here is a review. To mount it on the head I have basically used a bicycle helmet and a rubber band. It looks a bit adventerous, but it is very sturdy. I would like to create a blog entry on how to do this but I need a second camera to take pictures… To get the video off the camera I just plug it in, it is recognized as an USB disk and you can copy the mpg file. I did not edit the movie at all but just converted… Read more »
I tried this on an avi and an ogg file and i get errors. Does this only work on particular file types? /media/USB\ Disk/convert2mp4.rb thine-eyes-ask.ogg 1 50 mencoder “thine-eyes-ask.ogg” -o “thine-eyes-ask_tmp.avi” -x264encopts threads=auto:crf=50:subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=1:b_pyramid:weight_b -oac faac -faacopts br=192 -channels 2 -srate 48000 MEncoder 2:1.0~rc2-0ubuntu19+medibuntu1 (C) 2000-2007 MPlayer Team CPU: Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz (Family: 6, Model: 15, Stepping: 10) CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. success: format: 0 data: 0x0 – 0x17b5dfb4 [Ogg] stream 0: video (Theora v3.2.1), -vid 0 [Ogg] stream 1: audio… Read more »
Martin Ankerl

Hi Janson! I had a bug in the script, I have forgotten the option -ovc x264. I have updated it, now it should work

Sumer Kolcak

i can not get this to work either
i am sooooooooo confused
this is the error i get

Error decoding sei message

i am testing it on a .mov file i downloaded from


seems to be an older howto, but hey, ist still working. thx