Post Mon Jun 21, 2021 1:04 pm

TrueHD mkv container to TS container - need to embed AC3

I have some .mkv files with TrueHD tracks which I would like to serve to a client which does support TrueHD, but only within MPEG-TS container. Seems simple, just remux mkv to TS right? Sadly, no.

Here's the problem: The mkv container format only supports a single stream within a given audio track, which implies TrueHD track must not have embedded AC3. In contrast, the MPEG-TS container actually requires TrueHD tracks to contain the embedded AC3. This means that a simple remux of the video and audio streams is not possible; the audio stream in the mkv is not compatible with the TS container. Serviio would need to add an AC3 stream to the TrueHD and mux that. The AC3 stream does *not* need to actually contain the real audio data (it can be silent) as it is not used when decoding the TrueHD (this is different than DTS-HD which does use the embedded DTS core stream when decoding DTS-HD).

So, can we configure Serviio and its ffmpeg backend to convert a pure TrueHD track into a TrueHD+AC3 track?