I used to use some Windows applications. After I abandoned my home Windows Server (converted to a terabyte OpenSolaris file server), it is time to find a way to do this job in Linux. Here is the solution by using the powerfull ffmpeg tool.
1. Modify the ffmpeg to enable x264 and xvid support. I followed the instruction here.
remove the system installed version and prepare for compiling
sudo apt-get purge ffmpeg x264 libx264-dev
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaad-dev libfaac-dev libfaad-dev libschroedinger-dev libmp3lame-dev libtheora-dev libvorbis-dev libxv-dev libxvmc-dev
Also, find the name of package libavcodec libavdevice libavutil installed in the system and purge them - to prevent linking issues caused by conflicting library versions! You should not find any file started with libavc* libavf* libavd* libavu* in either /usr/lib or /usr/local/lib. Clean them if necessary to avoid trouble later.
install libamr from mediaubuntu
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list --output-document=/etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install libamrnb-dev libamrwb-dev
install nut from svn
svn co svn://svn.mplayerhq.hu/nut/src/trunk/ nut
cd nut
make
sudo checkinstall --fstrans=no --install=yes
install x264 from git
sudo apt-get install libgpac-dev
git clone git://git.videolan.org/x264.git
cd x264
./configure --prefix=/usr/local --enable-shared
make
sudo checkinstall --fstrans=no --install=yes
sudo ldconfig
install libxvid from source
sudo apt-get install nasm
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar xvfz xvidcore-1.2.1.tar.gz
cd xvidcore/build/generic
./configure --prefix=/usr/local
make
sudo make install
install ffmpeg from svn
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-nonfree --enable-libvorbis --enable-libgsm --enable-libxvid --prefix=/usr/local
make
sudo checkinstall --fstrans=no --install=yes
lock the local version
sudo aptitude hold x264 ffmpeg nut
2. Use Thomer's mp4ize to do the rest.
mp4ize --iphone movie1.avi movie2.asf movie3.mpg
In this example, the output files will be named movie1.mp4, movie2.mp4, and movie3.mp4.
The script above is using xvid to encode the mp4 file. How does x264 behave? I don't know. Can I change the xvid in the script to x264 to test it? On the net, I found a post about how to use x264 with ffmpeg to encode files for iPod/iPhone:
-vcodec libx264 -vpre hq
default - x264 CLI default values
fastfirstpass - disables options unnecessary for first pass, recommend choice for first passes
normal - Dark Shikari’s Q55 preset
hq - Dark Shikari’s Q75 preset, recommend choice for single pass or the second pass of two passes
max - all options maxed out
More to play with!
- 作者:cail
- 版权声明:署名-非商业性使用-禁止演绎 CC BY-NC-ND 3.0
- 原文网址:http://en.dogeno.us/?p=3808
- 最后修改时间:2009年5月22日 10:30 PDT
Previous:
哇,下载《笑侃三十年...
Next:
Induce primordial germ cells from epiblast by defined factors - BMP4, LIF, SCF, BMP8b and EGF
One Response to “Convert any video file for iPhone in Intrepid (Ubuntu 8.10)”
Leave a Reply
blog by cail
- » the Paper Link - my latest Creation for PubMed users
- » How to use ImageJ to analyze images?
- » 2shRNA - design oligos for RNAi
- » Play background music
- » about this blog
- » about me
Hot in 'How-To'
- analog - analog/digital - digital, VGA - DVI - HDMI - 74,618 views
- Ez-12 windsurfer antenna - 54,007 views
- Import custom ringtones to iPhone via iTunes (no jailbreaking required) - 47,084 views
- How to add new ringtones to iPhone - 42,499 views
- Use GParted to align partitions on a SSD hard drive for better performance - 40,990 views
"-vpre hq" just works; however, when I used the absolute path, it did not work in Mac OS X with MacPort