What I found was serviio, a free UPnP-AVÂ (DLNA)Â server. It is writtenÂ in java and runs on Windows, Linux and FreeBSD (it is not listed on the website, but we have an not-so-up-to-date version in the ports tree). If necessary it transcodesÂ the inputÂ to an appropriate format for the DLNAÂ renderer (in my case the TV).
I tested it with my slow Netbook, so that I was able to see with which input format it will just remux the input container to a MPEG transport stream, and which input format would be really re-encoded to a format the TV understands.
The bottom lineÂ of the tests is, that I just need to use a supported container (like MKVÂ or MP4 or AVI) with H.264-encoded videoÂ (e.g. encoded by x264)Â and AC3 audio.
The TV is able to choseÂ between several audio streams, but I have not tested if serviioÂ is able to serve files with multipleÂ audio streams (my wife has a differentÂ mother language than me, so it is interesting for us to have multiple audio streams for a movie), and I do not know if DLNA supports something like this.
Now I just have to replace minidlna (which only works good with my TV for MP3s and Pictures)Â with serviio on my FreeBSD file server and we can forget about the disk-juggling.