jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.83k stars 483 forks source link

Movies with DTS audio: playback error #3896

Open nicostrebel opened 2 months ago

nicostrebel commented 2 months ago

Describe the bug

Every movie which comes with DTS audio fails to play. As soon as i want to play the movie, the player will exit and a notification informing me of a player error and re-trying is popping up. The notification will pop up twice and then another notification informing me of too many errors. I only have movies with surround (at least 5.1) so i could not test it with stereo.

When i go to my admin dashboard there is no error log uploaded. This bug is only on the android tv version. The android app for phones works without any issue. Opening the browser on the same tv device and using the jellyfin web version also works without any issues. That indicates there must be an error with the android tv version for jellyfin itself.

I also tried on other tv devices on different andorid boxes with some friends and all encounter the same bug. If i use external player (mx player pro) there is no error and playback is working perfectly. If i disable audio direct stream and change to downmix to stereo this bug does not appear anymore and plackback is working perfectly.

In prior version of this app i just changed player to libvlc to not have this problem. This is no longer possible as libvlc got removed.

Logs

No response

FFmpeg logs

{"Protocol":0,"Id":"16283db5c1dc6c52c86d47661cd097d0","Path":"/data/movies2/x-collection/x/x.DTS.DL.1080p.BluRay.x264.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv","Size":10873014338,"Name":"x.DTS.DL.1080p.BluRay.x264","IsRemote":false,"ETag":"87e53f80ff56f15146920fd6fa3facba","RunTimeTicks":57336540000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"h264","CodecTag":null,"Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"1080p H264 SDR","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"ChannelLayout":null,"BitRate":15170799,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Height":1040,"Width":1920,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"High","Type":1,"AspectRatio":"1.85:1","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false},{"Codec":"dts","CodecTag":null,"Language":"ger","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"DTS-ES 6.1","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Standard","LocalizedForced":null,"LocalizedExternal":"Extern","LocalizedHearingImpaired":null,"DisplayTitle":"DTS-ES 6.1 - Ger - Standard","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"6.1","BitRate":1536000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":7,"SampleRate":48000,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"DTS-ES","Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"dts","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"DTS-ES 6.1","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Standard","LocalizedForced":null,"LocalizedExternal":"Extern","LocalizedHearingImpaired":null,"DisplayTitle":"DTS-ES 6.1 - English","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"6.1","BitRate":1536000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":7,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"DTS-ES","Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"PGSSUB","CodecTag":null,"Language":"ger","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"Full (PGS)","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":"Undefiniert","LocalizedDefault":"Standard","LocalizedForced":"Erzwungen","LocalizedExternal":"Extern","LocalizedHearingImpaired":"H\u00F6rgesch\u00E4digt","DisplayTitle":"Full (PGS) - Ger - PGSSUB","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":18242799,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -ss 01:18:00.000 -noaccurate_seek -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/data/movies2/x-collection/x/x.DTS.DL.1080p.BluRay.x264.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -low_power 1 -preset veryfast -look_ahead 0 -b:v 11534055 -maxrate 11534055 -bufsize 23068110 -profile:v:0 high -level 41 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -codec:a:0 libfdk_aac -ac 2 -vbr:a 5 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "e3d2ddec8f62476aa278ad4cce374cc9-1.mp4" -start_number 1560 -hls_segment_filename "/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc9%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc9.m3u8"

ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
Input #0, matroska,webm, from 'file:/data/movies2/x-collection/x/x.DTS.DL.1080p.BluRay.x264.mkv':
  Metadata:
    title           : x
    encoder         : libebml v1.4.0 + libmatroska v1.6.2
    creation_time   : 2020-10-28T22:47:08.000000Z
  Duration: 01:35:33.65, start: 0.000000, bitrate: 15170 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 371.871000
      Metadata:
        title           : Kapitel 01
    Chapter #0:1: start 371.871000, end 912.078000
      Metadata:
        title           : Kapitel 02
    Chapter #0:2: start 912.078000, end 1348.180000
      Metadata:
        title           : Kapitel 03
    Chapter #0:3: start 1348.180000, end 1825.490000
      Metadata:
        title           : Kapitel 04
    Chapter #0:4: start 1825.490000, end 2447.820000
      Metadata:
        title           : Kapitel 05
    Chapter #0:5: start 2447.820000, end 3052.883000
      Metadata:
        title           : Kapitel 06
    Chapter #0:6: start 3052.883000, end 3312.643000
      Metadata:
        title           : Kapitel 07
    Chapter #0:7: start 3312.643000, end 3680.802000
      Metadata:
        title           : Kapitel 08
    Chapter #0:8: start 3680.802000, end 4332.495000
      Metadata:
        title           : Kapitel 09
    Chapter #0:9: start 4332.495000, end 4832.619000
      Metadata:
        title           : Kapitel 10
    Chapter #0:10: start 4832.619000, end 5384.588000
      Metadata:
        title           : Kapitel 11
    Chapter #0:11: start 5384.588000, end 5733.654000
      Metadata:
        title           : Kapitel 12
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1040, SAR 1:1 DAR 24:13, 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      BPS-eng         : 12140830
      DURATION-eng    : 01:35:33.603000000
      NUMBER_OF_FRAMES-eng: 137469
      NUMBER_OF_BYTES-eng: 8701337782
      _STATISTICS_WRITING_APP-eng: mkvmerge v51.0.0 ('I Wish') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-10-28 22:47:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(ger): Audio: dts (DTS-ES), 48000 Hz, 6.1, fltp, 1536 kb/s (default)
    Metadata:
      title           : DTS-ES 6.1
      BPS-eng         : 1508999
      DURATION-eng    : 01:35:33.654000000
      NUMBER_OF_FRAMES-eng: 537530
      NUMBER_OF_BYTES-eng: 1081510360
      _STATISTICS_WRITING_APP-eng: mkvmerge v51.0.0 ('I Wish') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-10-28 22:47:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Audio: dts (DTS-ES), 48000 Hz, 6.1, fltp, 1536 kb/s
    Metadata:
      title           : DTS-ES 6.1
      BPS-eng         : 1508999
      DURATION-eng    : 01:35:33.654000000
      NUMBER_OF_FRAMES-eng: 537530
      NUMBER_OF_BYTES-eng: 1081510360
      _STATISTICS_WRITING_APP-eng: mkvmerge v51.0.0 ('I Wish') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-10-28 22:47:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:3(ger): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      title           : Full (PGS)
      BPS-eng         : 36370
      DURATION-eng    : 01:27:35.876000000
      NUMBER_OF_FRAMES-eng: 1926
      NUMBER_OF_BYTES-eng: 23895072
      _STATISTICS_WRITING_APP-eng: mkvmerge v51.0.0 ('I Wish') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-10-28 22:47:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[libfdk_aac @ 0x5cee76c879c0] Note, the VBR setting is unsupported and only works with some parameter combinations
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc9-1.mp4' for writing
Output #0, hls, to '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc9.m3u8':
  Metadata:
    encoder         : Lavf60.3.100
  Stream #0:0: Video: h264, qsv(bt709, progressive), 1920x1040 [SAR 1:1 DAR 24:13], q=2-31, 11534 kb/s, 23.98 fps, 24k tbn (default)
    Metadata:
      encoder         : Lavc60.3.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 11534055/0/11534055 buffer size: 23068110 vbv_delay: N/A
  Stream #0:1: Audio: aac, 48000 Hz, stereo, s16 (default)
    Metadata:
      encoder         : Lavc60.3.100 libfdk_aac
frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91560.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91561.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 224493024 is out of range
frame=  171 fps=0.0 q=20.0 size=N/A time=00:00:07.25 bitrate=N/A speed=14.2x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91562.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91563.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 224780784 is out of range
frame=  352 fps=348 q=20.0 size=N/A time=00:00:14.67 bitrate=N/A speed=14.5x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91564.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91565.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 225069528 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91566.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 225213936 is out of range
frame=  526 fps=348 q=22.0 size=N/A time=00:00:21.88 bitrate=N/A speed=14.5x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91567.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91568.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 225501648 is out of range
frame=  711 fps=353 q=17.0 size=N/A time=00:00:29.67 bitrate=N/A speed=14.7x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91569.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 225646056 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91570.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 225790416 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91571.mp4' for writing
frame=  892 fps=355 q=17.0 size=N/A time=00:00:37.24 bitrate=N/A speed=14.8x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91572.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 226078176 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91573.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 226222584 is out of range
frame= 1071 fps=355 q=21.0 size=N/A time=00:00:44.71 bitrate=N/A speed=14.8x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91574.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91575.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 226510296 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91576.mp4' for writing
frame= 1258 fps=358 q=18.0 size=N/A time=00:00:52.43 bitrate=N/A speed=14.9x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91577.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 226799064 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91578.mp4' for writing
frame= 1438 fps=358 q=23.0 size=N/A time=00:01:00.05 bitrate=N/A speed=14.9x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91579.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91580.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 227231208 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91581.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 227375568 is out of range
frame= 1618 fps=358 q=22.0 size=N/A time=00:01:07.47 bitrate=N/A speed=14.9x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91582.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 227519952 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91583.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91584.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 227807712 is out of range
frame= 1802 fps=359 q=17.0 size=N/A time=00:01:15.24 bitrate=N/A speed=  15x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91585.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 227952096 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91586.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 228096480 is out of range
frame= 1986 fps=360 q=17.0 size=N/A time=00:01:22.88 bitrate=N/A speed=  15x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91587.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 228240864 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91588.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 228384216 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91589.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 228528624 is out of range
frame= 2165 fps=359 q=18.0 size=N/A time=00:01:30.30 bitrate=N/A speed=  15x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91590.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 228672984 is out of range
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91591.mp4' for writing
frame= 2347 fps=360 q=22.0 size=N/A time=00:01:37.87 bitrate=N/A speed=  15x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91592.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91593.mp4' for writing
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91594.mp4' for writing
frame= 2529 fps=360 q=22.0 size=N/A time=00:01:45.51 bitrate=N/A speed=  15x    
[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91595.mp4' for writing
[mp4 @ 0x5cee7873a2c0] Packet duration: -16 / dts: 229393872 is out of range

[q] command received. Exiting.

[hls @ 0x5cee76da8480] Opening '/config/data/transcodes/e3d2ddec8f62476aa278ad4cce374cc91596.mp4' for writing
frame= 2624 fps=360 q=19.0 Lsize=N/A time=00:01:49.35 bitrate=N/A speed=  15x    
video:155006kB audio:2871kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Media info of the file

General
Complete name                            : F:\x.DTS.DL.1080p.BluRay.x264.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 10.1 GiB
Duration                                 : 1 h 35 min
Overall bit rate                         : 15.2 Mb/s
Frame rate                               : 23.976 FPS
Movie name                               : x
Encoded date                             : 2020-10-28 22:47:08 UTC
Writing application                      : mkvmerge v51.0.0 ('I Wish') 64-bit
Writing library                          : libebml v1.4.0 + libmatroska v1.6.2

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 h 35 min
Bit rate                                 : 12.1 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 040 pixels
Display aspect ratio                     : 1.85:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.254
Stream size                              : 8.10 GiB (80%)
Writing library                          : x264 core 160 r3000 33f9e14
Encoding settings                        : cabac=1 / ref=4 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=36 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=12144 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No

Audio #1
ID                                       : 2
Format                                   : DTS ES XCh
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-ES Discrete
Codec ID                                 : A_DTS
Duration                                 : 1 h 35 min
Bit rate mode                            : Constant
Bit rate                                 : 1 509 kb/s
Channel(s)                               : 7 channels
Channel layout                           : C L R Ls Rs Cb LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 1.01 GiB (10%)
Title                                    : DTS-ES 6.1
Language                                 : German
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : DTS ES XCh
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-ES Discrete
Codec ID                                 : A_DTS
Duration                                 : 1 h 35 min
Bit rate mode                            : Constant
Bit rate                                 : 1 509 kb/s
Channel(s)                               : 7 channels
Channel layout                           : C L R Ls Rs Cb LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 1.01 GiB (10%)
Title                                    : DTS-ES 6.1
Language                                 : English
Default                                  : No
Forced                                   : No

Text
ID                                       : 4
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 27 min
Bit rate                                 : 36.4 kb/s
Frame rate                               : 0.366 FPS
Count of elements                        : 1926
Stream size                              : 22.8 MiB (0%)
Title                                    : Full (PGS)
Language                                 : German
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : Kapitel 01
00:06:11.871                             : Kapitel 02
00:15:12.078                             : Kapitel 03
00:22:28.180                             : Kapitel 04
00:30:25.490                             : Kapitel 05
00:40:47.820                             : Kapitel 06
00:50:52.883                             : Kapitel 07
00:55:12.643                             : Kapitel 08
01:01:20.802                             : Kapitel 09
01:12:12.495                             : Kapitel 10
01:20:32.619                             : Kapitel 11
01:29:44.588                             : Kapitel 12

Application version

0.17.3

Device information

Strong LEAP-S1

Android version

Android 12

Jellyfin server version

10.9.9

VampiricAlien commented 2 months ago
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[libfdk_aac @ 0x5cee76c879c0] Note, the VBR setting is unsupported and only works with some parameter combinations
libva info: VA-API version 1.22.0
Device Audio decoding
Dolby® Digital/ Dolby® Digital Plus*, MPEG-1 layer1/2

All this information is saying that your device doesn't support DTS and has to transcode to AAC but there is an issue with libfdk_aac encoder. I could be wrong to think that this isn't an app error.

nicostrebel commented 2 months ago

Im not sure if this is really the error as this seems to be just an info and not an error. This would also not explain why playback is possible in the browser version with the same device vor with any external player. There is only a issue with the internal player.

I have tested a bit more and saw that the workaround to use the 'downmix to stereo' setting is not working a 100%. It plays well initialy but as soon as i try to play Form the middle and not from the beginning of the movie the playback will stop. There is no error but it will stay with a black screen and paused. Changing audio channel does also not work then. The only thing to make it work again is to select subtitle, which will get burned in and then the playback works again and i can also freely choose audio channel again. Something is really weird.

VampiricAlien commented 2 months ago

After I posted that command, I forgot to take that part out. Burning the subtitles in with make the server transcode the video and in this case audio as well.

Doesn't downmix to stereo transcode? The issue is ether transcoding or playback. It's also hard to tell without logs from android via logcat.

It's always best to have an audio track with 2 channels as not all devices support 5.1.

ffmpeg -vaapi_device /dev/dri/renderD128 -i x.DTS.DL.1080p.BluRay.x264.mkv \
  -map 0 \
  -c:v h264_vaapi -vf 'format=nv12,hwupload' \
  -c:a:0 aac -b:a:0 192k \
  -c:a:1 copy \
  -metadata:s:a:0 language=eng \
  x.DTS.DL.1080p.BluRay.x264_1.mkv

This adds 2 channel AAC audio.

nicostrebel commented 2 months ago

Will try to add stereo track with your example in future, thank you. However, for the large library of movies i dont really have the time to do it for every movie already uploaded to jellyfin. I somehow need a workaround/fix for the existing movies. Is there another way to get the logs from android as it doesnt get uploaded? Or is there a guide which helps finding a solution to make uploading logs to work? - Right now it seems like the internal player or the app has problems to communicate that it needs a transcode.

VampiricAlien commented 2 months ago

There is handbrake or you can use for f in command to do that in bulk in on linux.

This guide may help with the logging part https://gist.github.com/nielsvanvelzen/96fd588194729d6845f2d5e414cffb8d

Also this could be part of https://github.com/jellyfin/jellyfin-androidtv/issues/3868

rickysixx commented 2 months ago

@VampiricAlien What's the point of using Jellyfin if one has to manually re-encode their whole media library?

Since this problem affects only the Android TV client, the solution should be to improve codec support detection in the app. Instead, to me it seems that what the Jellyfin app does now is adding DTS in the direct play profile without checking if that codec is supported by the device.

VampiricAlien commented 2 months ago

@rickysixx you have misunderstood this. No one has said to re-encode the media library, I added more information to my other answer. The suggestion to encode a 2 channel audio track since the device does not support DTS and will always transcode.

the solution should be to improve codec support detection in the app.

The app is undergoing a playback rewrite and this will end up happen unless you would like to add better codec detection to the app?

rickysixx commented 2 months ago

Your suggestion is indeed a good one. My point was that the Jellyfin app should not expect the user to have done this by themselves. It should automatically ask the server to transcode the audio if it finds that DTS is not supported by the device, like it did in 0.16.11.

The app is undergoing a playback rewrite and this will end up happen

Nice to hear that's being worked on. I assumed this was the expected behaviour, since in 0.17.x the preference to enable/disable DTS output was removed (I'm aware this was because that preference did nothing, but I expected it to be fixed to actually do something instead of being removed altogether).

borkedporcupine commented 2 months ago

Reading through this, I'm not sure I understand. I have the same issue and opened my own (incorrectly apparently) issue. Simply put I have DTS content, DTS shows as enabled format in my google TV settings, my amp supports DTS, and it all worked prior to the 17 update. Reading this makes it sounds like it doesn't work because it's not supported by the hardware. However I firmly believe a bug or regression was introduced in the 17 update somewhere. I don't have enough knowledge here to prove it, but would be glad to provide anything that might help bring back DTS support.

supersebbo commented 2 months ago

+1 on this. Playing DTS:X DTS-MA encoded file results in playback error rather than a transcode to a supported format.

HenryDParker commented 2 months ago

Exactly the same issue for me here on Fire stick 4k's (1st & 2nd Gen). Originally worked on 0.16.x, but now crashes on 0.17.3 unless I set "Downmix to Stereo"

borkedporcupine commented 1 month ago

I found a workaround. It's not pretty but does restore the ability to utilize DTS if your equipment supports it. I won't go into details here, but using Kodi as an external player with pass-through enabled in Kodi I am now able to play DTS content without error and DTS is properly passed through to my AV receiver. Not idea but it works ok, I don't care for the Kodi player much.

This is more proof that DTS in the Jellyfin client is broken somehow as other apps are able to pass the audio through without issue. I still strongly believe that down mixing/transcoding is not the solution here.

amasover commented 4 days ago

Correct me if I'm wrong, but isn't it possible to decode to lossless PCM instead of transcoding to lossy AAC? I have nvidia shield -> LG TV -> eARC -> receiver, but the LG TV doesn't support DTS. So usually I try to get the shield to pass through PCM if I'm playing DTS content. (In shield settings I manually uncheck DTS formats, and also disable dolby audio processing.)