First off, you'll need to install Cygwin I recommend doing a full install of all the packages. It's about 200mb total. It's more than likely overkill but it'll save you from having to go back and rerun the setup again for anything that's needed if something bombs out later.
With my first attempt at this, I did only the minimal Cygwin install - I was following the post on the SAB forum pretty much to the letter... and the author didn't go into too much detail about which packages would be needed. To top it all off, the link to the additional pre-compiled packages they gave wasn't good anymore so I had to follow along with another guide on how to manually compile libdca and aften from scratch. After about the 3rd time of not having a package needed for the process, I just said screw it and did a full install. (Note: the full install might not even be needed now since we're no longer using libdca and aften noted in guy2545's post... but it wouldn't hurt.)
Next, you'll need mkvtoolnix and FFmpeg.
Extract mkvextract.exe, mkvinfo.exe, mkvmerge.exe and place the individual .EXEs in the cygwin home user dir. (For me it was: C:\cygwin\home\Tom)
Extract the FFmpeg archive into it's own ffmpeg sub-directory in the home user dir.
Finally, get the mkvdts2ac3 script and extract that into a new mkvdts2ac3 sub-directory in your home user dir.
(Note: This also requires "rsync", but that is included in the full install of Cygwin - if you want to try doing the minimal install, make sure you add the "rsync" package.)
Now, go to where your SAB scripts live and make a new batch file out of this... name it whatever you like...
@ECHO off CD /D %1 IF NOT EXIST *.mkv GOTO NOMKV MOVE *.mkv C:\holding\directory\input.mkv CD /D C:\cygwin\bin bash --login -i C:/cygwin/home/user/mkvdts2ac3/mkvdts2ac3.sh -d -n --wd C:/holding/directory C:/holding/directory/input.mkv CD /D D:\holding\directory MOVE input.mkv %1\%3.mkv :NOMKV MOVE %1 C:\processing\directory\for\cp EXIT
Since we're blending Linix scripts with Windows, a couple items had to be hard coded instead of nicely passing the variables directly from SAB... so you'll have to change some things to suit your setup.
First, create a holding directory somewhere on your drive and change the paths in the batch... make sure you keep the slashes going the proper way on the bash portion. (The hard coding is needed because the variables passed from SAB to the linix script will have the slashes going in the wrong direction, which Cygwin removes, turning it into one long file name... and it will fail.) Next, create a processing directory and adjust the batch paths - this has to be different than your SAB downloads location and holding directory... you don't want CouchPotato trying to rename and move stuff as it's being processed. Once you have the processing directory made, adjust your CouchPotato settings to watch it instead of your SAB folder. Finally, in the Categories setup in SAB, set your movies to use the new batch file.
Here's what mine looks like for reference...
@ECHO off CD /D %1 IF NOT EXIST *.mkv GOTO NOMKV MOVE *.mkv D:\usenet\dts2ac3\input.mkv CD /D C:\cygwin\bin bash --login -i C:/cygwin/home/Tom/mkvdts2ac3/mkvdts2ac3.sh -d -n --wd D:/usenet/dts2ac3 D:/usenet/dts2ac3/input.mkv CD /D D:\usenet\dts2ac3 MOVE input.mkv %1\%3.mkv :NOMKV MOVE %1 D:\usenet\processing\cp EXIT
So, here's what this script will do...
1) move the mkv to the holding dir renamed as input.mkv
2) run the conversion script on input.mkv
3) move and rename it back to it's original location and name
4) move the entire project folder to the watched processing folder for CouchPotato to rename and sort
The entire process should only take a minute or three.
I'd also recommend going into SAB > Config > Switches and checking the box to Pause Downloading During Post-Processing. Since we're using a holding directory for the processing, having something else finish in the short time it takes to do the conversion will fire off the script and move the new download to the holding directory as input.mkv.
I've got future plans to work in some IF statements so it can also process tv shows and then pass it on to the Sick Beard processing, without having to have seperate batch files for each... but that's for another time as I'm in the process of moving to a new apartment and have a geekling being born in April.
Known issues:
- Can't use with multi-part movies
- Can't use with tv shows that are complete seasons in a single download
(I'll come back and edit my OP as needed as I develop this thing... or if anyone wants to throw in advice or has a better method.)
Edited by tsheeley, 10 February 2012 - 06:22 AM.











