If you're interested I created a python script to create compatible mp4 video for android G1/Dream/Hero from any video file using ffmpeg. It will figure out the padding top and bottom to fit the screen and keep the original video aspect ratio, see attached. To install and use:
To install:
- save attached file to /tmp/
- put the file into a folder in your PATH, in this case /usr/bin: "sudo cp /tmp/android-video.py /usr/bin"
- give the file exec rights: "sudo chmod +x /usr/bin/android-video.py"
- install ffmpeg with mp4 etc support, try using the following (works for Jaunty and Intrepid):
Code:
sudo apt-get install ffmpeg ubuntu-restricted-extras
A full set of methods can be found in this thread: HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg
To use:
- go to the terminal and cd to the directory where video exists
- run "android-video.py videofile1 videofile2..."
- new gnome-terminals will be spawned for each video conversion required
- New files with the same name as originals will be created but with a .mp4 extension added
Note: you'll need ffmpeg installed...
If you want to change the video conversion settings they are all set at the top of the script as follows:
Code:
TEMP_INFO_PATH = "/tmp/android-video.info"
TARGET_VIDEO_WIDTH = 480
TARGET_VIDEO_HEIGHT = 320
TARGET_AUDIO_CHANNELS = 2
TARGET_AUDIO_SAMPLING_RATE = 16000
TARGET_AUDIO_BIT_RATE = 64000
TARGET_FRAME_RATE = 23.976
TARGET_VIDEO_BIT_RATE = 500000
NO_PADDING = False
In theory it could be used for future devices with other screen sizes and requirements...
Hope you find it useful..I do
Edit: I've updated the script to handle input video aspect ratio's lower than what the android offers, this will result in left and right padding of the output video rather than the usual top and bottom padding as seen with modern day films.
Bookmarks