Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG G4 transcoding (DoVi, DTS, TrueHD) #6484

Open
yorah opened this issue Jan 27, 2025 · 5 comments
Open

LG G4 transcoding (DoVi, DTS, TrueHD) #6484

yorah opened this issue Jan 27, 2025 · 5 comments
Labels
playback This PR or issue mainly concerns playback

Comments

@yorah
Copy link

yorah commented Jan 27, 2025

Describe The Bug
Using the webos jellyfin player which is a thin wrapper around jellyfin-web.

Bug 1: DoVi 8.1 file triggers transcoding on LG G4.
Bug 2: Disabling transcoding for this user allows playing this file DV content just fine with direct stream, but the two audio tracks which are DTS HDMA and Dolby TrueHD with Atmos get transcoded to AAC (DTS and TrueHD passthrough options are checked in the settings)

Media Information
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : Dolby Vision, Version 1.0, Profile 8.1, dvhe.08.06, BL+RPU, no metadata compression, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 1 h 55 min
Bit rate : 75.5 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.380
Stream size : 60.7 GiB (79%)
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 877 cd/m2
Maximum Frame-Average Light Level : 180 cd/m2

Audio #1
ID : 2
Format : MLP FBA 16-ch
Format/Info : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name : Dolby TrueHD with Dolby Atmos
Codec ID : A_TRUEHD
Duration : 1 h 55 min
Bit rate mode : Variable
Bit rate : 4 406 kb/s
Maximum bit rate : 7 623 kb/s
Channel(s) : 8 channels
Channel layout : L R C LFE Ls Rs Lb Rb
Sampling rate : 48.0 kHz
Frame rate : 1 200.000 FPS (40 SPF)
Compression mode : Lossless
Stream size : 3.54 GiB (5%)
Title : English [Dolby TrueHD Atmos 7.1]
Language : English
Default : Yes
Forced : No
Number of dynamic objects : 11
Bed channel count : 1 channel
Bed channel configuration : LFE

Audio #2
ID : 5
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 1 h 55 min
Bit rate mode : Variable
Bit rate : 2 224 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 16 bits
Compression mode : Lossless
Stream size : 1.79 GiB (2%)
Title : French (France) [DTS-HD MA 5.1]
Language : French (FR)
Default : No
Forced : No

Screenshots

System (please complete the following information):

  • Platform: LG G4, latest webos
  • Jellyfin Version: latest version on the server, latest jellyfin webos version

Additional Context
I have the fMP4 checkbox unchecked. The passthrough for DTS and TrueHD is set to true in the jellyfin webos app options. My setup is capable of both TrueHD and DTS. LG is plugged to my AVR with eARC.
In the log file, I can see the transcoding happening to aac (-codec:a:0 libfdk_aac):

User policy for "xxx". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: True
[2025-01-27 00:22:34.592 +01:00] [INF] [24] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -fflags +genpts -f matroska -i file:"/data/media/movies/xxx.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:4 -map -0:s -codec:v:0 copy -tag:v:0 dvh1 -strict -2 -bsf:v hevc_mp4toannexb -start_at_zero -codec:a:0 libfdk_aac -ac 6 -ab 640000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/cache/transcodes/a5f2f1e0be1aa7fa930b492158e5938e%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/cache/transcodes/a5f2f1e0be1aa7fa930b492158e5938e.m3u8""

@yorah yorah added the playback This PR or issue mainly concerns playback label Jan 27, 2025
@dmitrylyzo
Copy link
Contributor

It transcodes DTS, since DTS is not allowed in HLS.

let supportsDts = appSettings.enableDts() || options.supportsDts;
if (supportsDts == null) {
supportsDts = canPlayDts(videoTestElement);
}
if (supportsDts) {
videoAudioCodecs.push('dca');
videoAudioCodecs.push('dts');
}

To allow DTS in HLS, we need to add it to hlsInTsVideoAudioCodecs. But the question is, is it supported in TS?

@yorah
Copy link
Author

yorah commented Jan 28, 2025

Hello, I have trouble understanding the code: in which case would DTS or TrueHD passthrough actually work? Seems not to be in hlsInTsVideoAudioCodecs or hlsInFmp4VideoAudioCodecs either.

If you need someone to test, I would be happy to help.

@yorah
Copy link
Author

yorah commented Jan 29, 2025

Related question maybe: why isn't the media being direct played? I force the video to not be transcoded (by disabling it in the playback options), and it seems I would just like the audio to be sent as-is (passthrough), which should warrant a direct play scenario?

@dmitrylyzo
Copy link
Contributor

Hello, I have trouble understanding the code: in which case would DTS or TrueHD passthrough actually work?

DirectPlay.

If you need someone to test, I would be happy to help.

Something like that:

if (supportsDts) {
    videoAudioCodecs.push('dca');
    videoAudioCodecs.push('dts');

    if (browser.web0s) {
        hlsInTsVideoAudioCodecs.push('dca');
        hlsInTsVideoAudioCodecs.push('dts');

        hlsInFmp4VideoAudioCodecs.push('dca');
        hlsInFmp4VideoAudioCodecs.push('dts');
    }
}

If it will work, we probably also need to check the webOS version because DTS in TS is not listed for some versions.

Related question maybe: why isn't the media being direct played? I force the video to not be transcoded (by disabling it in the playback options), and it seems I would just like the audio to be sent as-is (passthrough), which should warrant a direct play scenario?

Do you mean remuxing?
jellyfin/jellyfin-webos#159
#4916

Otherwise, what does Reason for transcoding (Player settings / Playback Info) say?

@yorah
Copy link
Author

yorah commented Jan 29, 2025

Oh, of course you're right, as DV is not supported in mkv on LG (what a shame), it triggers remuxing... And the fact that DTS is marked as not supported in TS at the moment explains why it gets transcoded to AAC.

There is still the "Bug 1" from my initial description that I don't understand: if I don't force the no-transcoding thing (on the server, going to the user details, and disallowing video transcode), I get a "full" transcode (transcode of both the video and audio). Whereas with the option to allow video transcode unchecked, I get a direct stream (with just the DTS stream being transcoded)

Thanks a lot for your time and patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playback This PR or issue mainly concerns playback
Projects
None yet
Development

No branches or pull requests

2 participants