Friday, March 23, 2007

mencoder goodness for TivoDecode Manager

As a follow up to yesterday's entry, I have finally managed to compile a custom Mac Intel Core 2 Duo build of mencoder that provides drop in functionality to TivoDecode Manager (TDM) while cutting encoding times in half. 7 hours of sleepless night-time later I present to you the new & improved Mac Intel-optimized mencoder binary (7.5MB).

Here are the benchmarks I have so far:
TDM's provided mencoder binary

$ time /Applications/TiVoDecode\ Manager.app/Contents/Resources/mencoder -af volume=13:1 -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -demuxer lavf -lavfdopts probesize=128 -oac lavc -ovc lavc -lavcopts keyint=15:aglobal=1:vglobal=1:coder=1:vcodec=mpeg4:acodec=aac:vbitrate=1800:abitrate=128 -vf pp=lb,scale=640:480,harddup -o ~/Desktop/clip.tdm.mp4 ~/Desktop/clip.mpg

real 1m9.518s
user 1m7.768s
sys 0m0.847s


Mac Intel-optimized mencoder binary

$ time ./mencoder -af volume=13:1 -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -demuxer lavf -lavfdopts probesize=128 -oac lavc -ovc lavc -lavcopts keyint=15:aglobal=1:vglobal=1:coder=1:vcodec=mpeg4:acodec=aac:vbitrate=1800:abitrate=128 -vf pp=lb,scale=640:480,harddup -o ~/Desktop/clip.custom.mp4 ~/Desktop/clip.mpg

real 0m29.061s
user 0m27.210s
sys 0m0.743s


and here are the file sizes

$ ls -ltr clip.*
-rw-r--r-- 1 xxx xxx 12654193 Mar 22 01:59 clip.mpg
-rw-r--r-- 1 xxx xxx 20839638 Mar 23 01:50 clip.tdm.mp4
-rw-r--r-- 1 xxx xxx 20859165 Mar 23 01:51 clip.custom.mp4


and just for fun, I lowered the bitrate down to 600kbs so that it actually does compression and here are the times and filesizes.

TDM:

real 1m7.573s
user 0m59.340s
sys 0m0.904s

Intel-optimized

real 0m31.287s
user 0m25.143s
sys 0m0.787s


$ ls -ltr clip*
-rw-r--r-- 1 xxx xxx 12654193 Mar 22 01:59 clip.mpg
-rw-r--r-- 1 xxx xxx 8135459 Mar 23 02:26 clip.custom.mp4
-rw-r--r-- 1 xxx xxx 8131077 Mar 23 02:27 clip.tdm.mp4


And well if you've managed to wade through all that I guess I'll leave you with some installation instructions for the mencoder binary.
1. Download
2. Backup old mencoder binary
mv /Applications/TiVoDecode\ Manager.app/Contents/Resources/mencoder /Applications/TiVoDecode\ Manager.app/Contents/Resources/mencoder.old

3. Copy in new mencoder binary
cp mencoder /Applications/TiVoDecode\ Manager.app/Contents/Resources/mencoder

4. Enjoy (Did I mention this probably only works for the Core2Duo??)
5. Digg this

2 comments:

Aaron Hilliard said...

Thanks for putting this together! I tried replacing the mencoder file in my TDM package with your new one, but it made TDM inoperable, unable to process my Tivo files. Do I need to leave the original file in the same folder and add the .old (as per your instructions)? I had just removed the old one altogether.

Dag Ă…gren said...

This build doesn't work, because you're dynamically linking to libfaac. You need to make it statically link or else the executable won't work anywhere without installing libfaac.