In several previous posts I wrote about my quest for the right source format to stream video to my Sony BRAVIA TV (build in 2009). The last week-end I finally found something which satisfies me.
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.
I made some more tests which video resolutions my TV accepts via DLNA. While I was looking before a SD resolutions, this time I took care about some HD resolutions.
As the Sintel video in the 1024×436 resolution did not play, I tried to reencode it to 1024×720 (for the enabled x264 options see below). This did not work either. After that I went to the official resolution of 1280×720, and this works. Initially this video was encoded as High@L3.1, but with this the TV produced some artifacts on playback. After changing this to High@L4.0 (simply by remuxing instead of reencoding), the playback was fine (warning: increasing the H.264 level is OK, decreasing it if the video does not comply to the lowered level, may cause problems). I miss a setting in avidemux for the level, it would be nice if there would be the possibility to set it.
I also tested if the 1280×544 version of the Sintel video plays fine on the TV or not. It does not play fine, so there is probably a hard requirement on the complete resolution for HD video.
While doing this I noticed that tsMuxeR is truncating the audio, instead of the 6 channel audio it was before, the remuxed file has only two channels.
As I did not want to always go through all the settings to enter what I want, I made a little avidemux-script to setup (ECMA script + xml) everything for me. This was easy, I just took an existing one (the Sony PSP one) as a base and changed the encoding options and the target container (unluckily avidemux 2.5.4 does not support H.264 in MPEG-TS yet, so I have to use a MP4 container and remux it into the MPEG-TS stream afterwards).
The options I used for the x264-reencoding are –8x8dct –analyse all –mixed-refs –bime –weightb –subme 9 –b‑rdo –ref 4 –b‑adapt 2 –bframes 4 –direct auto –me umh (this includes b‑pyramid, for which there are reports that it does not work).