13.09.2008
multimedia/ffmpeg-devel - Converting to iPod video
Do you know the ffmpeg-package? It's very useful to convert nearly any kind of video to an iPod compatible video format. Just convert your favorite video from the googletech channel on YouTube to an iPod format and take it with you. That's quite simple. Just take a video you'd like to convert and use the following commandline to convert it:
ffmpeg -i foo.avi -f mov -b 1800 -vcodec mpeg4 -qmin 3 \
-qmax 5 -s 320x180 -acodec libfaac -ab 128 foo.ipod.mov
Please note - this example is for a 16:9 aspect ratio, change the
-s parameter to 320x240 for 4:3 aspect radio.Update:
I was asked if there is a way to detect the resolution of a video file. There certainly is and it's just easy. As we are using ffmpeg to detect the solution we could use it to identify the resolution for us.
ffmpeg -i sample.flv 2>&1 | awk '/Stream/ && /Video/ {gsub(/,/," ");print $6}'
If you want to check the results mplayer is also a handy tool.
mplayer -identify sample.flv -ao null -vo null -frames 0 2>/dev/null | \ grep -E -e '^ID_VIDEO_(WIDTH|HEIGHT)'btw, don't blame me if you Linux box bails out - this is NetBSD land
