Hari's Corner
Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and theniPod video encoding guide for Linux users
Filed under:
Tutorials and HOWTOs by
Hari
Posted on Wed, May 23, 2007 at 17:54 IST (last updated: Wed, Oct 1, 2008 @ 22:15 IST)
- Rip the DVD chapter by chapter, using acidrip. It's the most convenient way of doing it. I generally scale the video to the iPod size (320x240) at this stage since ripping becomes less time consuming. Other parameters don't matter much since you won't be using this format anyway. I also set the audio to MP3 using LAME (you need liblame for this) and bit rate to 64. You can set other parameters if you wish.
- Convert the resulting mpeg file(s) one by one to mp4 (with h264 codec) using the script (see below).
- Take a long coffee break
- Use a tool like gtkpod to transfer the mp4 file to your iPod. Hopefully it should play properly now.
ipodenc.sh
) and make it executable using the command chmod +x ipodenc.sh
.
The script's usage is (from the command line):#!/bin/bash #Encode iPod Video input_file=$1 output_file=$2 ffmpeg -i "${input_file}" -vcodec h264 -b 150k -bufsize 244 -maxrate 768k -s 320x240 -bf 0 -level 13 -f mp4 -acodec aac -ar 48000 -ab 64 "${output_file}"
./ipodenc.sh inputfile.mpg outputfile.m4v
You can alter some of those ffmpeg settings if you want to. I deliberately kept the bit rate low because the encoder will always choose higher bit rates. But you need the -bf 0
and the -level 13
parameters if you want the video to play (with the h264 format). I found this obscure bit of information on a mailing list archive. Earlier, when I encoded with h264 without those flags, it refused to play on the iPod.
This is more like a reminder to myself, but I hope you find this useful anyway.
Comments closed
The blog owner has closed further commenting on this entry.
4 comment(s)
Comment by Dominic (visitor) on Wed, May 23, 2007 @ 19:11 IST #
Comment by hari (blog owner) on Wed, May 23, 2007 @ 19:32 IST #
Comment by RT Cunningham (visitor) on Wed, May 23, 2007 @ 21:53 IST #
Comment by hari (blog owner) on Thu, May 24, 2007 @ 11:16 IST #