They are many Media Servers enabling streaming video for DNLA devices; much are for Windows, and much does not support transcoding, a useful feature that enabled you to convert on the fly a video type into another video type. This blog entry shows many DLNA softwares, and i've tried Nero, Fuppes, Media Tomb, Mezzmo, MiniDLNA, PS3 Media Server, Twonkey and one that is not listed but looks very promising: Wild Media Server.
Since i needed transcoding features to stream some xvid videos into my TV, i eliminated a few of them plus those really complicated to setup like Media Tomb. After having tried them all, the only software capable of streaming divx files on my TV was Mezzmo and Wild Media Server. It is great, but since i run Linux and not Windows, I wanted a Linux solution.
MiniDLNA is very simple and easy to configure and works great with Sony TVs, and it works on LInux and Windows... As long as you only stream DVD files (since my Sony TV only accepts MPEG-2 videos)... MiniDLNA does not support transcoding, so I applied the same idea as Wild Media Server: before launching the Media Server, start the transcoding and stream the transcoded file. With FFMPEG, available on both Windows and Linux, you can transcode a video file. So the trick is to find good parameters so that the transcoding process is faster than the streaming, considering that the DLNA communication between my computer and my TV is wireless.
I finally made a Groovy Script working on Linux (and also can work on Windows too) which uses both FFMPEG and MiniDLNA.
The script requires that you have ffmpeg, minidla and Groovy installed and on your PATH.
You can launch the script like this:
dlna.sh /path/to/your/divx.avi
The script will compute the parameters for a 16:9 aspect ratio, adding padding on top and bottom if necessary. Then it will start the transcoding process to convert the movie to an MPEG-2 video with AC3 sound. Then the script will starts 5 seconds after the MiniDLNA server, pointing to the resulting video. You'll see something like this on the console after the startup:
kha@box:~/workspace/perso/mycila-ujd$ dlna.sh /media/lacie/My\ movie.avi
/media/lacie/My\ movie.avi:
- video bitrate: 1050 kb/s
- video size: 640x272 (40:17 => 2.3529413)
- audio freq: 48000 Hz
- audio bitrate: 163 kb/s
- padding top: 44 px
- padding bottom: 44 px
- dest size: 640x360 (16:9 => 1.7777777)
- threads: 2
Starting...
[minidlna, -d, -f, /unsafe/tmp/minidlna/minidlna.conf, -P, /unsafe/tmp/minidlna/minidlna.pid]
[ffmpeg, -i, /media/lacie/My\ movie.avi, -y, -threads, 2, -target, ntsc-dvd, -b, 4000k, -maxrate, 5000k, -bufsize, 2000k, -sameq, -qscale, 1, -s, 640x272, -aspect, 16:9, -padtop, 44, -padbottom, 44, -ac, 2, -ab, 192000, /unsafe/tmp/minidlna//media/lacie/My\ movie.avi.mpg]
DNLA started !
Press a key to exit...
You then just have to open your TV menu and open the movie !

23 comments: