I discovered eTiVo (www.prish.com/etivo) some time ago... I was very impressed by it and thought it looked very useful... however unfortunately I have very little use for Windows Media Video files (*.wmv). I asked around if anybody had written a version that would encode to divx, but no one had... So this is my attempt at providing one.
Fortunately, eTiVo has been written in such a way that it is very easy to write new encoders which hook into eTiVo's API. This eTiVo adidn is written in C# and simply makes calls to mencoder (part of the mplayer package). The C# code is very simple, but getting the right flags to pass into mencoder proved more tricky... But I think I've now got it all working sufficiently that it can be released into the public domain.
This addin works for me, but remember it is still in development and may cause harm to your system, you milage may vary, etc. Orvi-wan and Huge on the dealdatabase have been beta testing for me (thanks very much!). It sounds like Orvi-wan has had some reasonable success, but Huge ran into some problems and had to uninstall etivo and start again... Please do not proceed if this is the kind of thing which will bother you...
This addin is released under the GNU GPL license and anyone is free to use or modify the code as they see fit (although I'd like to be informed of any changes you make so I can keep the version on this site in sync.) Just for clarity...
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Right... now that's out of the way on to the specifics of installing the addin.
Before you begin to install the mencoder addin for eTiVo, you will need the following:
A working installation of eTiVo. For more information, go to www.prish.com/etivo, or the deals database thread here: http://www.dealdatabase.com/forum/showthread.php?t=34314
A copy of TyTools (in particular a copy of Vsplit.exe) – one can be obtained here: http://www.dealdatabase.com/forum/showthread.php?t=39740 I unzipped my copy into C:\Program Files\TyTool\VSplit9r16.exe. You can put your copy whereever you like... but if you put it in a different position, you'll need to remember to edit the config files later to tell the mencoder addin where vsplit lives.
A working installation of mplayer/mencoder. I've compiled my own version of mplayer/mencoder by dowloading the source from the cvs repository. Full details can be found here www.mplayerhq.hu. Specific instructions on how to compile mplayer for windows can be found here: http://ftp5.mplayerhq.hu/mplayer/releases/win32/contrib/MPlayer-MinGW-Howto.txt, but beware, this process is not for the faint hearted! For those that do not want to compile their own version, probably your best bet is to download precompiled binaries from here: http://armory.nicewarrior.org/projects/cygmp/, I'd get the latest full release (you'll need mplayer and mencoder)
Please Note: I am no expert in either eTiVo, mplayer/mencoder or TyTool... If you have any problems installing them or getting them working, then please direct any problems or questions to the appropriate forum thread or website...
First off, you'll need the some files... you can either get just the binaries: MencoderAddin_Version2.zip or you can get the full package, including precompiled binaries and all the source: MencoderAddinSrc_Version2.zip
Unzip the files to a temporary location, then copy the MencoderAddin.dll file into your eTiVo addins directory. For me this is: “C:\Program Files\EtiVoServer\Addins”, but it depends on where you have installed eTiVo.
Next, you'll need to edit the encoding profiles (or write some more). The 2 supplied are DivX_Archive.xml and DivX_Palm.xml – the first is meant to provide high quality 2 pass divx encodings for archive purposes. The second is for low quality 2 pass divx, for viewing on a Palm pilot, or similar handheld device.
Open both the files in your favourite text editor (notepad, for example) you should see a file which looks something like this:
<?xml version="1.0"?>
<Mencoder>
<!-- What flags should be passed to mencoder.exe? (on the first or only pass) -->
<Flags>-mc 0 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:acodec=mp3:vbitrate=300:keyint=250:vpass=1:turbo -ffourcc DIVX -vop scale=::::::pal</Flags>
<!-- What flags should be passed to mencoder.exe? (on the second pass... if there is none, then leave empty) -->
<Flags2>-mc 0 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:acodec=mp3:vbitrate=300:keyint=250:vpass=2 -ffourcc DIVX -vop scale=::::::pal</Flags2>
<!-- Where does mencoder.exe live? -->
<MencoderPath>C:\Program Files\Mplayer\mencoder.exe</MencoderPath>
<!-- Where does VSplit.exe live? -->
<VSplitPath>C:\Program Files\TyTool\VSplit9r16.exe</VSplitPath>
</Mencoder>
If you have installed mplayer anywhere other than the default location, or your Vsplit9r16.exe does not live in C:\Program Files\TyTool, then you must edit the <MencoderPath> and <VsplitPath> items to point to the appropriate locations. You must do this for both encoding profiles. Do not change the <Flags> or <Flags2> items unless you have used mencoder before and know what you are doing.
Once you have performed these edits, copy the files into the root of your etivoserver directory (again, for me this is: ““C:\Program Files\EtiVoServer”
On the “General” tab of eTiVos configuration screen:

Click
on “Change...” to change the encoder.

Then
Choose “Other” and for the Class Name, type in:
“MencoderAddin.Mencoder,MencoderAddin.dll” (without the
quote marks...) like this:

OK that dialog, then go to the “Encoding Profiles” tab:

And
add the new .xml encoding profiles.
Save all the new settings and restart the eTiVo server (or your PC). You're now ready to encode stuff into divx.
Basically, the C# simply calls mencoder.exe with the flags that are passed to it in the xml encoding profile... that's about it really...
The flags I pass to mencoder are probably not optimal... for me, they represent a reasonable compromise between size and quality for viewing on my Palm Pilot... I'm no mencoder expert, so there is probably a better way of doing things... if you know / find out some better flags, then please let me know...
I have sucessfully run this code on: Windows XP Professional, running eTiVo version 1.0.1924.0, with a UK Series 1 TiVo.
I've been able to playback the DiVx files on my Kiss DP-500 DVD player and on my Palm Life Drive (using the core pocket media player – http://tcpmp.corecodec.org/about) and of course using mplayer.
Version2 contains the following changes:
Fix bug which stops the percentage progress bar from updating.
Use Vsplit9r16.exe (part of TyTool) to 'clean' the ty stream before processing by mencoder... hopefully this should make mencoder less prone to failures.
Many thanks to Shahar Prish (www.prish.com) for writing eTiVo... it truly is an excellent piece of software. Also, many thanks to the mplayer team (www.mplayerhq.hu) who have written one of the most powerful (and daunting) encoders ever.