Get off my lawn.

Sunday, November 06, 2011

How to use the LookSee Encoder API

A few people have been asking about how to use the LookSee Encoder API, so I thought I would post something about it. I hadn't really planned on other people wanting to use it, but apparently I'm not the only person who wants to encode a video out of a series of JPG images.

LookSee Encoder
LookSee Encoder is essentially a slimmed-down FFmpeg implementation that runs on Android. It can encode a video from a series of images, create a series of images from a video file, and convert videos between formats. It's packaged as a standalone application that you download to your device. Once downloaded, an application communicates with it via broadcast Intents. Some example code illustrating how to use it can be downloaded here.


  • If you're encoding a series of images into a video, be sure and name the image files sequentially as 9-digit 0-padded numbers, for example 000000005.jpg. The numbers cannot skip. FFmpeg finds the files to include the video as "%09d.jpg". It will run through the list of files in sequence until it can't find any more files. If the file names skip a number (e.g. 000000005.jpg, 000000007.jpg), FFmpeg will stop at #5.
  • Following the link to LookSee Encoder, you'll notice a low rating. This is the result of a total of 1 rating from someone named "kristhian" who tried to convert a 2-hour movie on his Android device. It took a very long time. If kristhian had tried to perform the same task on a dual-core desktop PC, it's likely it would have taken more than the hour he complained about. Honestly, I hadn't considered someone trying to convert a feature-length film with it. So, just a note. If you write an app that handles long videos, you might want to warn the user about the time required to extract all the frames from Lord Of The Rings.
If you want to see LookSee Encoder in action, try LookSee Animator or LookSee Draw.