Convert video files for Maemo (Nokia N900) using ffmpeg/mencoder

1

1

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).

Vikrant Chaudhary

Posted 2010-08-11T12:36:14.007

Reputation: 359

Answers

1

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.)

Picture:

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:

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

Audio:

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).

oKtosiTe

Posted 2010-08-11T12:36:14.007

Reputation: 7 949

0

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.

http://code.google.com/p/vikrant-incubator/source/browse/ruby/ffmpeg_n900.rb

Vikrant Chaudhary

Posted 2010-08-11T12:36:14.007

Reputation: 359

0

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).

Sam Watkins

Posted 2010-08-11T12:36:14.007

Reputation: 675