First of all:

There are a bunch of DLNA servers out there, some for Windows only, many of those are multi platform. Java might be a prefered solution, but I prefer an out-of-the-box solution a bit more. So I just dropped serviio and got my hands on miniDLNA which is being developed by a Netgear employee for their NAS.

miniDLNA is quite easy – download it, extract to temporary folder and then do the following:

mv /tmp/usr/sbin/* /usr/sbin/
mv /tmp/etc/* /etc

Executable flags are already set as the binary is a static precompiled one (running fine on x86).

Now for the config part:

# vim /etc/minidlna.conf

Set the root directory for sharing media, or only set different dirs to supported formats by given examples.


Change the identified name to a friendly one


Set media caching db for miniDLNA


Change serial and model number to something unique.


Afterwards, start miniDLNA using sudo.

$ sudo /usr/sbin/minidlna

It will automatically index and cache your share files – then turn on the TV and get into your DLNA client application.

There’s only one problem with DLNA, UPnP AV and DTS – streaming is not licensed so therefore embedded DTS sound in e.g. mkv does not work. For that reason you’ll need to transcode existing DTS streams into AC3 5.1 or similar getting played on Samsung TV series.

We’ll take over the part dropping the gui part of mkvtoolnix and just using a shell script named mkvdts2ac3. This has several dependencies of course:

# apt-get install mkvtoolnix mkvtoolnix-gui libdca0 libdca-tools cmake

For the wav2ac3 part, we need aften.

$ tar xvjf aften-0.0.8.tar.bz2
$ mkdir default; cd default
$ make && sudo make install

Now download mkvdts2ac3 and place it into /usr/local/bin/ and then check on the README file.

By default, mkvdts2ac3 just transcodes the first dts track, and appends the new ac3 afterwards. To drop the dts track, use -n as flag.

$ mkvdts2ac3 -n testmovie_with_1_dts_track.mkv

It’s also wise to create a new file, not making changes to the original file.

$ mkvdts2ac3 --new testmovie_with_1_dts_track.mkv

Also regarding dual language mkv containers, you can supply the track number you want to transcode. Best thing will be to check with mkvmerge which track number needs to be worked on.

$ mkvmerge -i testmovie_with_2_dts_tracks.mkv
File 'testmovie_with_2_dts_tracks.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
Track ID 3: audio (A_DTS)
Track ID 4: subtitles (S_TEXT/UTF8)
Track ID 5: subtitles (S_TEXT/UTF8)
$ mkvdts2ac3 --new -n -t 2 testmovie_with_2_dts_tracks.mkv

or being independent of the script, manual steps are below (which is much easier for future coding 🙂 )

Extract DTS – also possible to extract more tracks in a single step.

$ mkvextract tracks /path/to/matroska.file.mkv 2:/tmp/dts1.file.dts
$ mkvextract tracks /path/to/matroska.file.mkv 3:/tmp/dts2.file.dts

Transcode DTS to AC3

$ dcadec -o wavall /tmp/dts1.file.dts | aften - /tmp/ac31.file.ac3
$ dcadec -o wavall /tmp/dts2.file.dts | aften - /tmp/ac32.file.ac3

Add AC3 back to mkv replacing DTS

$ mkvmerge -A -o /tmp/matroska.file.mkv /path/to/matroska.file.mkv -a 2 /tmp/ac31.file.ac3 -a 3 /tmpz/ac32.file.ac3
%d bloggers like this: