Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a newbie in video encoding so I'm looking for some expert advice.

I'm looking to transcode media files with ffmpeg or mencoder (or something other) on Ubuntu for my Nokia N900 running Maemo. I'd prefer mencoder, because of ffmpeg's crazy dependencies.

  1. Video output should be AVC/H.264 (probably hardware accelerated on device).
  2. Audio output in AAC (should have preferred Vorbis but not supported natively and requires .mkv which is also not completely supported).
  3. Output video should retain the original aspect ratio.
  4. Resolution of screen is 800x480 (16:10).

(Explanation of why-this-value-is-chosen would be really appreciated).

share|improve this question

If you are a newbie as you're saying, Handbrake might be more your thing. It's available for Mac OS X, Linux and Windows. Last I checked it was in Ubuntu's repositories, but here's a PPA just to be sure.

HandBrake screenshot

I've had good results on my N900 with the following settings:

Container: MP4 file (MKV files are not supported by the N900 by default.)
iPod 5G support: on (Just in case you decide to share a video with an Apple-loving friend.)


Width: 400px (Although the horizontal resolution of the N900 is 800px, video tends to skip for me at that resolution.)
Keep aspect ratio: on


Video codec: H.264 (Results in smaller files than ffmpeg; both work though.)
Avg. bitrate: 500/600kbps
2-Pass encoding: on


Audio codec: AAC (faac) (Most compatible, best sound quality.)
Mixdown: Stereo (You only have two speakers or a headphone, why waste bandwidth on more channels?)
Bitrate: 64/80/96/128kbps (If you have good headphones, go with 96/128kbps.)

All other options may be left unchanged (or feel free to experiment).

share|improve this answer

Here is the code I written in Ruby. It uses ffmpeg to encode and does some calculations to determine the correct size/resolution of output to preserve the original aspect ratio.

share|improve this answer

I found the command-line tool xvidenc did a good job for a similar device (Open Pandora). xvidenc is a Q&A style front-end to mencoder. It is not so easy to use mencoder or ffmpeg directly, if you desire a good result!

There is a similar tool h264enc, which can make video that matches your specific requirements; but I recommend to use xvid.

These tools allow to save the commands to a shell script, you can then edit it and apply it to different files. I changed the filters so that my videos are first scaled to height 480, then cropped to 800x480. It seems to work well.

You could also try avconv, the new version of ffmpeg.

I'll update this answer with a link to my encoding scripts (based on xvidenc and h264enc).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .