HOWTO: Right Click-Convert videos to Ipod / Smartphone format Quickly and Easily
Found a little script that will convert videos to IPod video format (i.e. mp4 with xvid and aac encoding) utilising ffmpeg and ruby. The nice thing about this is that it will preserve the original aspect ratio and add black bars depending, so videos look like they should do (well aside from being in QVGA 320x240 resolution!). Some smartphones (such as the Nokia N95) are also able to display this format =)
The script can be found here
For a little HOWTO:
Open up synaptic and ensure that you have ffmpeg and ruby installed/
apt-get install ruby ffmpeg liblame-dev libxvidcore4-dev libx264-dev libfaac-dev libfaad2-dev
sudo apt-get build-dep ffmpeg
Download the script:
wget http://thomer.com/howtos/mp4ize
chmod +x mp4ize
sudo mv mp4ize /usr/local/bin
If everything goes well, your output will look like this:
root@ion:/extra/movies/Life.Support.DVDRip.XviD-BeStDivX/Sample# ls
bestdivx-lifes-sample.avi
root@ion:/extra/movies/Life.Support.DVDRip.XviD-BeStDivX/Sample# mp4ize bestdivx-lifes-sample.avi
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --prefix=/usr --libdir=${prefix}/lib --shlibdir=${prefix}/lib --incdir=${prefix}/include/ffmpeg --enable-shared --enable-mp3lame --enable-gpl --enable-faad --mandir=${prefix}/share/man --enable-vorbis --enable-pthreads --enable-faac --enable-xvid --enable-dts --enable-amr_nb --enable-amr_wb --enable-pp --enable-libogg --enable-libgsm --enable-x264 --enable-a52 --extra-cflags=-Wall -g -fPIC -DPIC
libavutil version: 49.0.0
libavcodec version: 51.11.0
libavformat version: 50.5.0
built on Nov 3 2006 21:14:27, gcc: 3.3.5 (Debian 1:3.3.5-13)
Input #0, avi, from 'bestdivx-lifes-sample.avi':
Duration: 00:01:00.0, start: 0.000000, bitrate: 1071 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 576x320, 23.98 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 160 kb/s
Must supply at least one output file
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --prefix=/usr --libdir=${prefix}/lib --shlibdir=${prefix}/lib --incdir=${prefix}/include/ffmpeg --enable-shared --enable-mp3lame --enable-gpl --enable-faad --mandir=${prefix}/share/man --enable-vorbis --enable-pthreads --enable-faac --enable-xvid --enable-dts --enable-amr_nb --enable-amr_wb --enable-pp --enable-libogg --enable-libgsm --enable-x264 --enable-a52 --extra-cflags=-Wall -g -fPIC -DPIC
libavutil version: 49.0.0
libavcodec version: 51.11.0
libavformat version: 50.5.0
built on Nov 3 2006 21:14:27, gcc: 3.3.5 (Debian 1:3.3.5-13)
Input #0, avi, from 'bestdivx-lifes-sample.avi':
Duration: 00:01:00.0, start: 0.000000, bitrate: 1071 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 576x320, 23.98 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 160 kb/s
Output #0, mp4, to 'bestdivx-lifes-sample.mp4':
Stream #0.0: Video: xvid, yuv420p, 320x240, q=3-5, 400 kb/s, 23.98 fps(c)
Stream #0.1: Audio: aac, 48000 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 1439 q=3.0 Lsize= 3734kB time=59.9 bitrate= 510.6kbits/s
video:2763kB audio:936kB global headers:0kB muxing overhead 0.928542%
root@ion:/extra/movies/Life.Support.DVDRip.XviD-BeStDivX/Sample# ls
bestdivx-lifes-sample.avi bestdivx-lifes-sample.mp4
root@ion:/extra/movies/Life.Support.DVDRip.XviD-BeStDivX/Sample#
Comments (31)

Comments by IntenseDebate
· 918 weeks ago
· 917 weeks ago
· 917 weeks ago
sudo apt-get install liblame-dev libxvidcore4-dev libx264-dev libfaac-dev libfaad2-dev
sudo apt-get build-dep ffmpeg
· 917 weeks ago
You can install the codecs you need with the following commands:
sudo apt-get install gstreamer0.8-plugins
sudo apt-get install gstreamer0.8-lame
sudo apt-get install gstreamer0.8-ffmpeg
sudo apt-get install w32codecs
sudo apt-get install libdivx4linux
sudo apt-get install lame
sudo apt-get install sox
sudo apt-get install ffmpeg
sudo apt-get install mjpegtools
sudo apt-get install vorbis-tools
gst-register-0.8
· 917 weeks ago
Video/audio codec, flash, mp3, dvd playback, and win32 Codec install for Feisty Fawn for beginners. If your a new user, copy and paste commands into the terminal, should be relatively easy from that point forward.
For mp3, etc.
Open up Add/Remove programs from your Application bar.
Go to Sound&Video and Find and Check all of the packages below (easily done by searching for gstreamer)
* "GStreamer ffmpeg video plugin"
* "GStreamer extra plugins"
* "GStreamer plugins for aac, xvid, mpeg2, faad"
* "GStreamer plugins for mms, wavpack, quicktime, musepack"
Then go to Other subsection of Add/Remove and find
* "Ubuntu restricted extras"
For Flash support
While under the "Other" section enable
* "Macromedia Flash plugin"
For DVD Playback and Win32 Codecs
Edit the file /etc/apt/sources.list using either of the following commands in a terminal:
Code:
$gksudo gedit /etc/apt/sources.list
to open it in the GUI text editor
or
Code:
$sudo vim /etc/apt/sources.list
to open it in the Vim command line text editor
Add the following lines to add the Medibuntu repository to the file:
Quote:
## Medibuntu - Ubuntu 7.04 "feisty fawn"
## Please report any bug on <a href="https://launchpad.net/products/medibuntu/+bugs
deb ">https://launchpad.net/products/medibuntu/+bugs
deb http://medibuntu.sos-sts.com/repo/ feisty free non-free
deb-src http://medibuntu.sos-sts.com/repo/ feisty free non-free
Import the gpg key for the Medibuntu repository to ensure that the packages are installed without warnings/errors regarding trust:
To do this, run the following command from the terminal:
Code:
wget -q http://medibuntu.sos-sts.com/repo/medibuntu-key.g...-O- | sudo apt-key add -
Now update the local list of packages to get the list of packages from the newly added Medibuntu repository:
In a terminal execute the following command:
Code:
sudo apt-get update
Now you can install libdvdcss2 and w32codecs using the following command:
Code:
sudo apt-get install libdvdcss2 w32codecs
· 917 weeks ago
· 917 weeks ago
http://www.getautomatix.com/wiki/index.php?title=...
· 917 weeks ago
· 917 weeks ago
· 917 weeks ago
How exactly do we do that?
· 914 weeks ago
(Really nice tool btw.)
so long,
cheers!
· 905 weeks ago
Greg · 873 weeks ago
Thanks, I hope,
Greg
jofo · 856 weeks ago
alikebabay · 853 weeks ago
/usr/local/bin/mp4ize:68: warning: regexp has `]' without escape
Couldn't figure out aspect ratio.
Patrick · 853 weeks ago
Thank you very much. Great work!
Ged · 848 weeks ago
Alfonso · 848 weeks ago
Chris · 847 weeks ago
norvo · 846 weeks ago
izzie · 844 weeks ago
i pasted in my video name and it said permission denied!
XP
John Hamelink · 841 weeks ago
chmod +x [drag mp4ize script onto the terminal and the path should show up here]
Then try running the script again :)
ThiloK · 841 weeks ago
Any fix?
ThiloK · 841 weeks ago
Running Interpred...
conley · 839 weeks ago
anyone know how i can fix this?