Remuxing Dolby Vision for LG 2023+ TV

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
llyama
Posts: 4
Joined: Thu Jan 18, 2024 7:22 am

Remuxing Dolby Vision for LG 2023+ TV

Post by llyama »

A modern LG 2023+ TV supports Dolby Vision, but only from MP4 and MPEGTS containers.

I want to remux a Dolby Vision video stored in an MKV, to an MP4 or MPEGTS container without any transcoding.

The renderer profile seems to have this accurately configured.

Code: Select all

TranscodeVideo = MPEGTS-H265-AC3

Supported = f:mkv       v:av1|h264|h265|mp4|mpeg2|vp8|vp9   a:aac-lc|ac3|dts|dtshd|he-aac|eac3|lpcm|mp3|mpa|opus           si:ASS|SUBRIP   hdr:hdr10|hlg               m:video/x-matroska
Supported = f:mov       v:av1|h264|h265|mp4                 a:aac-lc|ac3|ac4|eac3|he-aac|mp3                                                                           m:video/quicktime
Supported = f:mp4|m4v   v:av1|h264|h265|mp4                 a:aac-lc|ac3|ac4|dts|dtshd|eac3|he-aac|mp3                     si:TX3G         hdr:dolbyvision|hdr10|hlg   m:video/mp4
The problem seems to be that if a video cannot be directly streamed, such as an MKV containing Dolby Vision video, it will only ever transcode into the singular transcode target specified by TranscodeVideo. Which for this renderer is set to MPEGTS-H265-AC3. This nearly always causes the audio to be transcoded, from DTS/EAC3 into AC3. Even if I used a different TranscodeVideo option, there is no singular transcode target that would avoid transcoding.

Is there a way to configure UMS to prefer remux, over transcode if possible? From browsing the code this doesn't seem to be case.

To be clear, for MKV-DolbyVision-DTS and MKV-DolbyVision-EAC3 media, the best choice would be to remux to MP4 or MPEGTS, but instead it always transcodes the audio too, which is not needed as those formats are supported per the renderer profile.

Also, in the logs I see "the file is a strict Dolby Vision profile and ffmpeg seems to not preserve Dolby Vision data (worth re-checking periodically)". I wonder if this is fixed as I can do "ffmpeg -i input.mkv -c copy -strict unofficial out.mp4" to manually remux a video and Dolby Vision is preserved with the latest ffmpeg.
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by SubJunk »

Hi, thanks for your post. I think with your help testing I can get that working. What operating system are you on? I will upload a version to test
llyama
Posts: 4
Joined: Thu Jan 18, 2024 7:22 am

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by llyama »

Great, I'm on Windows. Happy to help.
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by SubJunk »

Here's a build to try, please let me know when you have downloaded it https://www.universalmediaserver.com/up ... llyama.exe
If it doesn't work, it would be good to get TRACE logs so I can see why
llyama
Posts: 4
Joined: Thu Jan 18, 2024 7:22 am

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by llyama »

I've downloaded it. I'll give it a test.
llyama
Posts: 4
Joined: Thu Jan 18, 2024 7:22 am

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by llyama »

It didn't work, but it's because FFmpeg is removing the Dolby Vision data.

I tested using FFmpeg directly to convert from MKV to TS and the Dolby Vision data was removed. From what I can tell, FFmpeg only keeps the Dolby Vision data when the target format is MP4 and with the "-strict unofficial" flag.

I tested having only the tsMuxer engine enabled in UMS and that worked successfully. It didn't transcode the audio and Dolby Vision was retained. Enabling the FFmpeg engine with the "Remux videos with tsMuxuR when possible" setting still stripped the Dolby Vision data. So it doesn't look like muxing to TS will work via FFmpeg at all. I tried with the "-strict unofficial" flag and it made no difference.

Your change is still an improvement though, as it no longer transcodes the audio for no reason. The video files I'm testing with still play on the TV, falling back to HDR10. Only the Dolby Vision layer is stripped out by FFmpeg.
Last edited by llyama on Sun Jan 21, 2024 1:57 am, edited 1 time in total.
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: Remuxing Dolby Vision for LG 2023+ TV

Post by SubJunk »

That’s interesting and a shame! I had a branch I was working on a while back that output mp4 for transcoding, I should resurrect that to try.
Thanks for your feedback. I will post another test build when I have it
Post Reply