Wednesday, February 29, 2012

Resize video for Android

A 32GB MicroSD card is now around £20, room enough for a large music collection and a few TV shows and movies. But although 32GB is a lot of space, why store a 300MB file that has a bigger size in pixels than the mobile device, and is not compatible with the stock Android video player, when you can store a 50MB file exactly customised for the screen size of your mobile device and plays on the stock player?
I was looking around for an application that would do this in Linux, but in the end found a command line application that does the job. I've lost the original link, so I'll just post the command, using an example file name, and screen dimensions for an Android phone. The frame rate is a bit low, but perfectly watchable. First install ffmpeg. Then in a Terminal, in the directory where the original file is, issue this command:

ffmpeg -i "TOS - S02E19 - The Immunity Syndrome.avi" -s 480x320 -vcodec mpeg4 -acodec aac -strict experimental -ac 1 -ar 16000 -r 15 -ab 32000 -aspect 3:2 "TOS - S02E19 - The Immunity Syndrome.mp4"


No comments:

Post a Comment