My camera has a video function. Nothing special, but it works okay. Actually the image quality maybe is even better than a typical PAL or NTSC camera. There are other drawbacks - tiny microphone, and I can’t zoom while recording or handle light changes. So it can’t replace a real camera, but it’s okay for some limited use cases.

Last weekend there was a Balboa workshop in Munich, with excellent teachers. At the end of the days we recorded the teachers repeating the moves they tought us during the day. A perfect situation to use my camera: good lighting, no lighting changes, no zoom changing needed.

These videos are quite big, due to the limited compression capabilities of the camera. (the video codec they used is MJPG, i.e. the camera just saves 30 jpg images per second). So I decided to recompress them.

I tried transcode first, but it messed up the audio (which played back at double speed). Mencoder worked like a charm. Size savings of a factor of 8-12 are easily possible (well, depending on your camera, YMMV) without much tuning or serious loss in image quality.

Here’s the commandline I used:

mkdir out
for nam in *.avi; do
  mencoder "$nam" -ovc lavc -oac lavc -vf hqdn3d \
  -lavcopts acodec=mp3:abitrate=48:vb_strategy=1:vbitrate=600 \
  -o "out/$nam"
done

Notice that I also enabled a noise filter. Due to the nature of MJPEG, there is a certain amount of noise in dark areas, which I don’t really care about. Filtering noise both improves compression and image quality IMHO. Depending on your video, of course. Here the dancers are well-lit, just the background isn’t; I don’t want to see noise in the background amplified by a compression trying to adopt to it. :-)