Converting Video for iPad 3
27/05/2012The new iPad isn’t too bad minus the video playback problem. Now that I no longer have the Xoom, one problem that I have run into is video. So far, Arista, HandBrake and Avidemux have not done the trick, so I have resorted to ffmpeg in a terminal. Some of the issues that I have already run into is that ffmpeg no longer support faac. The problem is that all videos must be is mp4 with h264 video up to 720p at 30fps and have aac audio at 160Kbps at 48kHz. The solution is simple (so I thought) but since ffmpeg doesn’t support faac, I have realized that I need to manually build that support in.
In Arch Linux, I found this to be a fairly simple process, simply compile abs, and then modify the PKGBUILD so that the support is added.
|
1 |
# pacman -S abs && abs |
I like to work out of a root directory ‘/work’.
|
1 2 3 4 |
$ cd /work $ sudo cp -r /var/abs/extra/ffmpeg /home/random/abs $ cd ffmpeg/ $ sudo nano PKGBUILD |
Add the following to PKGBUILD after the ‘./configure \’ line:
|
1 2 |
--enable-nonfree \ --enable-libfaac \ |
Now, all you have to do is build it.
|
1 2 |
$ makepkg -s $ sudo pacman -U ffmpeg-*.pkg.tar.xz |
After that, it’s time to start using ffmpeg. Make sure that x264 is installed. (The x264-git version installs, but for some reason, it doesn’t work right with ffmpeg. I believe that it names all of it’s files x264-git vice x264 so that both packages can exist in the Arch repositories without conflict, but I am not certain).
Following the guidelines above, the following is required for a video to properly play back on the iPad 3:
- Video container is mp4
- Video type is x264
- Video size is 1024×768/720p or greater
- Framerate 30fps
- Audio is AAC (the reason why faac support was added to ffmpeg)
- Audio is 160kbps at 48kHz
So, in order, the ffmpeg breakout becomes:
-vcodec libx264
-s 1024×768
-threads 0
-crf 21
-r 30
-acodec libfaac
-ab 160k
-ar 48000
-ac 2
So, the command would be:
|
1 |
$ ffmpeg -i VIDEO.FILE -vcodec libx264 -s 1024x768 -threads 0 -crf 21 -r 30 -acodec libfaac -ab 160k -ar 48000 -ac 2 OUTPUT.mp4 |
The process takes about an hour, so I will provide an update if it worked or not.