Twitter Feed

Links

Ask Aaron

Converting Videos For The Android T-Mobile G1 Phone With Linux

I got my G1 this week and I must say I am impressed. There are a few things I don't like, but I will save those for an upcoming podcast where I review the phone. In the meantime, if you want to check out playing video on the phone here is what you need to do. First make sure you have an "unencumbered" version of ffmpeg on your linux box. Here is a way to get this on Ubuntu. You can find it for Fedora from the Livna repositories. Now before I give you the command line goodies let's talk a little about the capabilities of the G1. The display on the G1 is 480x320 pixels. So that is a 3:2 aspect ratio. Also, apparently there is a hardware decoder chip in the phone for H264. (Can anyone say YouTube? This is why YouTube works, but flash does not.) So H264 will be the best bet for smooth playing video. The phone supports AAC audio as well as MP3, OGG, MIDI, WAV and WMA, but we will stick with AAC for now since I have tested that and know it works. So here is the command to convert a 3:2 aspect ratio video to work on the G1. Please note that this is a two pass process and you will have to run the same command again changing the "-pass 1" to "-pass 2" to get the best quality.
ffmpeg -i inputfilename.ext -aspect 3:2 -s 480x320 -vcodec h264 -b 480k -r 23.976 -acodec aac -ab 96k -sameq -pass 1 outputfilename.mp4
Here is the command for a 4:3 aspect ratio video.
ffmpeg -i inputfilename.ext -aspect 3:2 -s 400x300 -vcodec h264 -b 480k -r 23.976 -acodec aac -ab 96k -padtop 10 -padbottom 10 -padleft 40 -padright 40 -sameq -pass 1 outputfilename.mp4
And here is the command for a 16:9 aspect ratio video.
ffmpeg -i inputfilename.ext -aspect 3:2 -s 480x270 -vcodec h264 -b 480k -r 23.976 -acodec aac -ab 96k -padtop 24 -padbottom 26 -sameq -pass 1 outputfilename.mp4
Notice that we need to pad the videos that have aspect ratios which are dissimilar to the G1 so that they will not distort when we convert them. Also make sure you change the filename placeholders I put in the commands. Now plug your G1 into your computer and copy the file over. You will find a video player in the Marketplace that works quite nicely. And if you really must do this in Windows here is a nice tutorial. Enjoy!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Will iriverter work?

Thanks

I didn't want to bother messing around with finding a good set of parameters :)

WinFF, avidemux

Supposedly these work as well. Scroll down for linux. http://forums.tmonews.com/index.php?topic=3261.0 Let me mention that the captcha is friggin' impossible.
anewcomb's picture

Thanks for the heads up on

Thanks for the heads up on the captchas. I switched to reCaptcha. Aaron

Script to do the conversion and install all dependencies here

I've created a script to handle all the setup and conversion process. See here: http://www.harelmalka.com/?p=120

Linux script for conversion

I changed a script I wrote for this. Here's the link
http://sprackle.org/?p=291

ACC/264

On Ubuntu, I found a couple of differences for acc and 264.

ffmpeg -i DVD.vob -aspect 3:2 -s 480x320 -vcodec libx264 -b 480k -r 23.976 -acodec libxaac -ab 96k -sameq -pass 1 out.mp4

kursun degil

second oldest player on the 2008 Team's roster. The Redeem Team has six players porno 24 years old or younger.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Call Us NOW!

Cumulus Tag Cloud

Feeds

mpeg4 (G1/iPod)
theora
xvid (Nokia Compatible)
iTunes Video

Donate

Support Open Source!

Syndicate

Syndicate content