A few months ago i stumbled upon the fact that i need my mkv movies to be both compatible for my PS3 and xbox360. To play a mkv on xbox360 mediacenter you need to have a AC3 stream in your mkv. Otherwise you don't have any sound output while playing through mediacenter from a xbox360.
So i started looking around and first found the popcorn MKV audio converter. It's a great tool to use but since i am downloading my files through sabnzbd, i really needed a script which is able to do this automatically when it finished downloading a MKV with a DTS stream in it. While searching the nets again to search for some sort of script i've stumbled upon the MKVDTS2AC3 bash script from JakeWharton.
The only thing with this script is the fact that it is a bash script. With 24 hrs of researching and programming i've made a solution that is running on a windows platform using cygwin (so this tutorial is also usable on linux/mac).
You need the following files:
Cygwin
MKVDTS2ACS script from JakeWharton
Libdca
Aften
mkvtoolnix
First part, installing cygwin:
First you need to install cygwin, you can lookup the installation guide on the cygwin homepage for further help.
Note: When you reach the module selection search for rsync, you will need this module for running the script correctly
After installation first start up cygwin, the program will create a home user dir for you in it's installation directory
After creating the home user dir you need to place the script and the executables from libdca, aften and mkvtoolnix into the cygwin user dir.
second part, installing required files for conversion:
Now you have 2 options for the needed binaries.
option 1, download:
download this pre-compiled package
extract the contents in the cygwin home user dir.
option 2, compile it yourself:
download the libdca and aften source files from the above links and compile them yourself through cygwin. When you want to compile the binaries yourself you will need to install a c-compiler in cygwin first, this is available by running the setup again and search for it in the modules page.
for further help compiling read the section "installing libdca" and "installing aften" on this webpage: howto-processing-multichannel-audio-dts
After compiling libdca you will need to move dcadec.exe to the home user dir
After compiling aften you will need to move aften.exe, wavfilter.exe, wavinfo.exe and wavrms.exe to the cygwin home user dir
download mkvtoolnix, extract mkvextract.exe, mkvinfo.exe, mkvmerge.exe and place them in the cygwin home user dir
third part, creating the sabnzbd post processing script:
After installing the requirements you need to make a .bat or .cmd file from the following source and add it to your sabnzbd scripts dir:
(if you didn't installed cygwin to the standard install location you will need to change the path to cygwin in the script)
Code: Select all
@echo off
CD /d %1
IF NOT EXIST *.mkv GOTO NOMKV
REN *.mkv input.mkv
CD /d C:\cygwin\bin
bash --login -i ./mkvdts2ac3.sh -k -i -d -w %1 %1\input.mkv
DEL %1\*.dts
CD /d %1
IF EXIST input.mkv REN input.mkv %3.mkv
:NOMKV
EXIT
Code: Select all
DEL *sample*
DEL *.srr
DEL *.srt
DEL *.nfo
DEL *.nzb
DEL *.srs
Code: Select all
start /d "mediacenter master install dir" MediaCenterMaster.exe
i hope that you all will find this usefull ;D.