OSMC not correctly identifying audio tracks on BDMV folder structure rips

Hello!

I’m running the OSMC May 2024 update (2024.05-1) on a Vero 4K+, and am having trouble with OSMC not correctly identifying the all the audio tracks on some BDMV folder structure rips of Criterion UHD discs that were made with MakeMKV.

The discs I’m having trouble with are Trainspotting (UPC 715515291613) and La haine (UPC 715515294515). Both discs have a stereo and a multi-channel DTS-MA track along with an AC-3 commentary track.

The problem is that OSMC is failing to identify the two main DTS-MA tracks (both are listed as having 0 channels in the GUI) and only finds the commentary.

The mediainfo output for Trainspotting’s main title is as follows:

❯ mediainfo BDMV/STREAM/00009.m2ts
General
ID                                       : 0 (0x0)
Complete name                            : BDMV/STREAM/00009.m2ts
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 69.7 GiB
Duration                                 : 1 h 34 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 106 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 h 34 min
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 h 34 min
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 1 h 34 min
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless

Audio #2
ID                                       : 4353 (0x1101)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 1 h 34 min
Bit rate mode                            : Variable
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                                : 24 bits
Compression mode                         : Lossless

Audio #3
ID                                       : 4354 (0x1102)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 1 h 34 min
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : M
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 129 MiB (0%)
Service kind                             : Complete Main
Dialog Normalization                     : -31 dB
compr                                    : -0.28 dB
mixlevel                                 : 285 dB
roomtyp                                  : 3
ltrtcmixlev                              : -3.0 dB
ltrtsurmixlev                            : -3.0 dB
lorocmixlev                              : -3.0 dB
lorosurmixlev                            : -3.0 dB
dialnorm_Average                         : -31 dB
dialnorm_Minimum                         : -31 dB
dialnorm_Maximum                         : -31 dB

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

Dumping the first 5 MB of the m2ts file and then analysing it with mediainfo results in none of the three audio streams being identified:

❯ dd if=BDMV/STREAM/00009.m2ts of=trainspotting.bin bs=5000000 count=1
1+0 records in
1+0 records out
5000000 bytes transferred in 0.270860 secs (18459721 bytes/sec)
❯ mediainfo trainspotting.bin
General
ID                                       : 0 (0x0)
Complete name                            : trainspotting.bin
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 4.77 MiB
Duration                                 : 463 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 86.4 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS
Conformance errors                       : 2
 MPEG-TS                                 : Yes
  General compliance                     : File size 5000000 is less than expected size at least 5000064 (offset 0x4C4AC0)
 General compliance                      : Element size 184 is more than maximal permitted size 120 (offset 0x4C4AC8)
FileExtension_Invalid                    : m2ts mts ssif

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 417 ms
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 458 ms
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

If I bump the dump size up to 15 MB, the streams are identified correctly:

❯ dd if=BDMV/STREAM/00009.m2ts of=trainspotting.bin bs=15000000 count=1
1+0 records in
1+0 records out
15000000 bytes transferred in 0.770441 secs (19469369 bytes/sec)
❯ mediainfo trainspotting.bin
General
ID                                       : 0 (0x0)
Complete name                            : trainspotting.bin
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 14.3 MiB
Duration                                 : 1 s 572 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 76.3 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS
FileExtension_Invalid                    : m2ts mts ssif

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 s 584 ms
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 s 584 ms
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
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

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 725 ms
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless

Audio #2
ID                                       : 4353 (0x1101)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 725 ms
Bit rate mode                            : Variable
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                                : 24 bits
Compression mode                         : Lossless

Audio #3
ID                                       : 4354 (0x1102)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 1 s 248 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : M
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 29.2 KiB (0%)
Service kind                             : Complete Main
Dialog Normalization                     : -31 dB
compr                                    : -0.28 dB
mixlevel                                 : 285 dB
roomtyp                                  : 3
ltrtcmixlev                              : -3.0 dB
ltrtsurmixlev                            : -3.0 dB
lorocmixlev                              : -3.0 dB
lorosurmixlev                            : -3.0 dB
dialnorm_Average                         : -31 dB
dialnorm_Minimum                         : -31 dB
dialnorm_Maximum                         : -31 dB

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

The results are identical for La Haine.

Looking at the debug logs, the following output sticks out:

2024-08-03 15:59:31.102 T:3002    debug <general>: Open - probing detected format [mpegts]
2024-08-03 15:59:31.103 T:3002    debug <general>: Open - avformat_find_stream_info starting
2024-08-03 15:59:31.168 T:2840    debug <general>: ------ Window Init (DialogBusy.xml) ------
2024-08-03 15:59:32.237 T:3003    debug <general>: Thread BackgroundLoader 3655364864 terminating
2024-08-03 15:59:32.711 T:3002     info <general>: ffmpeg[0xb28b2120]: [hevc] Skipping NAL unit 62
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Could not find codec parameters for stream 1 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Could not find codec parameters for stream 2 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
2024-08-03 15:59:32.820 T:3002    debug <general>: ffmpeg[0xb28b2120]: [mpegts] Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-08-03 15:59:32.830 T:3002    debug <general>: Open - av_find_stream_info finished
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]: Input #0, mpegts, from 'bluray://%2fmnt%2fMedia%2fVideos%2fMovies%2fUHD%2fLa%20haine%20(1995)%2f/BDMV/PLAYLIST/00005.mpls':
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]:   Duration: N/A, start: 600.000000, bitrate: N/A
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]:   Program 1 
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:1[0x1100]: Audio: dts ([134][0][0][0] / 0x0086), 0 channels
2024-08-03 15:59:32.830 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:2[0x1101]: Audio: dts ([134][0][0][0] / 0x0086), 0 channels
2024-08-03 15:59:32.831 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
2024-08-03 15:59:32.831 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:4[0x12a0]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
2024-08-03 15:59:32.831 T:3002     info <general>: ffmpeg[0xb28b2120]:   Stream #0:5[0x1015]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc

Based on my dd experiments and the debug log entries, it would seem that the default 5 MB FFmpeg probesize is not large enough to allow the streams to be analysed correctly. Is there a tunable for adjusting the probesize or any other mechanism to force OSMC/FFmpeg to analyse a larger chunk of the file in order to allow the tracks to be identified?

As an aside, this older issue also sounds vaguely similar, but I’m not seeing any fake playlists in the title selection menu.

Thanks for your help!

Discourse is limiting the message body to 32000 characters, so here’s the mediainfo output for La haine in its own message. The results are identical to Trainspotting.

❯ mediainfo BDMV/STREAM/00009.m2ts
General
ID                                       : 0 (0x0)
Complete name                            : BDMV/STREAM/00009.m2ts
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 70.6 GiB
Duration                                 : 1 h 38 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 103 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 h 38 min
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 h 38 min
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 1 h 38 min
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless

Audio #2
ID                                       : 4353 (0x1101)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 1 h 38 min
Bit rate mode                            : Variable
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                                : 24 bits
Compression mode                         : Lossless

Audio #3
ID                                       : 4354 (0x1102)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 1 h 38 min
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 135 MiB (0%)
Service kind                             : Complete Main
Dialog Normalization                     : -31 dB
compr                                    : -0.28 dB
mixlevel                                 : 285 dB
roomtyp                                  : 3
ltrtcmixlev                              : -3.0 dB
ltrtsurmixlev                            : -3.0 dB
lorocmixlev                              : -3.0 dB
lorosurmixlev                            : -3.0 dB
dialnorm_Average                         : -31 dB
dialnorm_Minimum                         : -31 dB
dialnorm_Maximum                         : -31 dB

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

❯ dd if=BDMV/STREAM/00009.m2ts of=lahaine.bin bs=5000000 count=1
1+0 records in
1+0 records out
5000000 bytes transferred in 0.572610 secs (8731947 bytes/sec)
❯ mediainfo lahaine.bin
General
ID                                       : 0 (0x0)
Complete name                            : lahaine.bin
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 4.77 MiB
Duration                                 : 481 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 83.1 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS
Conformance errors                       : 2
 MPEG-TS                                 : Yes
  General compliance                     : File size 5000000 is less than expected size at least 5000064 (offset 0x4C4AC0)
 General compliance                      : Element size 184 is more than maximal permitted size 120 (offset 0x4C4AC8)
FileExtension_Invalid                    : m2ts mts ssif

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 458 ms
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 458 ms
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

❯ dd if=BDMV/STREAM/00009.m2ts of=lahaine.bin bs=15000000 count=1
1+0 records in
1+0 records out
15000000 bytes transferred in 1.358930 secs (11038096 bytes/sec)
❯ mediainfo lahaine.bin
General
ID                                       : 0 (0x0)
Complete name                            : lahaine.bin
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 14.3 MiB
Duration                                 : 1 s 478 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 81.2 Mb/s
Maximum Overall bit rate                 : 109 Mb/s
Frame rate                               : 23.976 FPS
FileExtension_Invalid                    : m2ts mts ssif

Video #1
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 s 459 ms
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Video #2
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 1 s 459 ms
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2

Audio #1
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 619 ms
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless

Audio #2
ID                                       : 4353 (0x1101)
Menu ID                                  : 1 (0x1)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Muxing mode                              : Stream extension
Codec ID                                 : 134
Duration                                 : 619 ms
Bit rate mode                            : Variable
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                                : 24 bits
Compression mode                         : Lossless

Audio #3
ID                                       : 4354 (0x1102)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : 129
Duration                                 : 1 s 120 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 26.2 KiB (0%)
Service kind                             : Complete Main
Dialog Normalization                     : -31 dB
compr                                    : -0.28 dB
mixlevel                                 : 285 dB
roomtyp                                  : 3
ltrtcmixlev                              : -3.0 dB
ltrtsurmixlev                            : -3.0 dB
lorocmixlev                              : -3.0 dB
lorosurmixlev                            : -3.0 dB
dialnorm_Average                         : -31 dB
dialnorm_Minimum                         : -31 dB
dialnorm_Maximum                         : -31 dB

Text
ID                                       : 4768 (0x12A0)
Menu ID                                  : 1 (0x1)
Format                                   : PGS
Codec ID                                 : 144

Would you happen to have any insight into this, @sam_nazarko? Thanks!

It’s being discussed internally. Do you have another Kodi instance (say, on PC) that does better with this? We think it may be a Kodi issue.

Thanks for looking into this for me.

It seems that you’re right. I tried playing the rip on both Kodi 20.5 and 21.0, and sadly, both of them seem to exhibit the same issue.

Is this something that you could potentially work around in OSMC (e.g. by adding the aforementioned tunable) or take up with the Kodi developers? Or should I try reporting the problem upstream myself?

I’m also happy to provide you with any further information you might need to further debug the issue.

I’ll look at this tomorrow

1 Like

As an additional data point, when analysing the file with ffmpeg and setting both analyzeduration and probesize to appropriately large values (10 seconds and 10 Mb respectively), all the tracks are identified correctly.

❯ ffmpeg -analyzeduration 10000000 -probesize 10M -i BDMV/STREAM/00009.m2ts
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 14.0.0 (clang-1400.0.29.202)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[mpegts @ 0x7fb1fb805340] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0x7fb1fb805340] stream 0 : no PTS found at end of file, duration not set
[mpegts @ 0x7fb1fb805340] stream 5 : no PTS found at end of file, duration not set
[mpegts @ 0x7fb1fb805340] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (10000000) options
Input #0, mpegts, from 'BDMV/STREAM/00009.m2ts':
  Duration: 01:34:09.21, start: 600.000000, bitrate: 105959 kb/s
  Program 1
  Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
  Stream #0:1[0x1100]: Audio: dts (dca) (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, stereo, s32p (24 bit)
  Stream #0:2[0x1101]: Audio: dts (dca) (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), s32p (24 bit)
  Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, mono, fltp, 192 kb/s
  Stream #0:4[0x12a0]: Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)
  Stream #0:5[0x1015]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
At least one output file must be specified
1 Like

We wonder if increasing these sizes will have a negative impact on scraping a video library, because more data needs to be read per video.

Personally, I’d leave the defaults as they are (0 seconds and 5 Mb), but make the values configurable so people could tweak them if they run into problems, as I did.

For comparison’s sake, Jellyfin defaults to an analyzeduration of 200 seconds and a probesize of 1 Gb.

That’s exactly what we’re currently discussing :slight_smile:

Can you please check, will it also work if you just change the analyzeduration and keep the probesize at the default?

I’m afraid not.

❯ ffmpeg -analyzeduration 10000000 -i BDMV/STREAM/00009.m2ts
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 14.0.0 (clang-1400.0.29.202)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[mpegts @ 0x7fbf39f05940] start time for stream 1 is not set in estimate_timings_from_pts
[mpegts @ 0x7fbf39f05940] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 0x7fbf39f05940] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x7fbf39f05940] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0x7fbf39f05940] stream 1 : no TS found at start of file, duration not set
[mpegts @ 0x7fbf39f05940] stream 2 : no TS found at start of file, duration not set
[mpegts @ 0x7fbf39f05940] stream 3 : no TS found at start of file, duration not set
[mpegts @ 0x7fbf39f05940] Could not find codec parameters for stream 1 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options
[mpegts @ 0x7fbf39f05940] Could not find codec parameters for stream 2 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options
[mpegts @ 0x7fbf39f05940] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options
[mpegts @ 0x7fbf39f05940] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options
Input #0, mpegts, from 'BDMV/STREAM/00009.m2ts':
  Duration: 01:34:09.19, start: 600.000000, bitrate: 105959 kb/s
  Program 1
  Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
  Stream #0:1[0x1100]: Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels
  Stream #0:2[0x1101]: Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels
  Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
  Stream #0:4[0x12a0]: Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)
  Stream #0:5[0x1015]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
At least one output file must be specified

and if you use a duration of eg. 30 seconds?

The computer says “no”.

❯ ffmpeg -analyzeduration 30000000 -i BDMV/STREAM/00009.m2ts
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 14.0.0 (clang-1400.0.29.202)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[mpegts @ 0x7fdda1f05940] start time for stream 1 is not set in estimate_timings_from_pts
[mpegts @ 0x7fdda1f05940] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 0x7fdda1f05940] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x7fdda1f05940] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0x7fdda1f05940] stream 1 : no TS found at start of file, duration not set
[mpegts @ 0x7fdda1f05940] stream 2 : no TS found at start of file, duration not set
[mpegts @ 0x7fdda1f05940] stream 3 : no TS found at start of file, duration not set
[mpegts @ 0x7fdda1f05940] Could not find codec parameters for stream 1 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' (30000000) and 'probesize' (5000000) options
[mpegts @ 0x7fdda1f05940] Could not find codec parameters for stream 2 (Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' (30000000) and 'probesize' (5000000) options
[mpegts @ 0x7fdda1f05940] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (30000000) and 'probesize' (5000000) options
[mpegts @ 0x7fdda1f05940] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (30000000) and 'probesize' (5000000) options
Input #0, mpegts, from 'BDMV/STREAM/00009.m2ts':
  Duration: 01:34:09.19, start: 600.000000, bitrate: 105959 kb/s
  Program 1
  Stream #0:0[0x1011]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
  Stream #0:1[0x1100]: Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels
  Stream #0:2[0x1101]: Audio: dts (dca) ([134][0][0][0] / 0x0086), 0 channels
  Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
  Stream #0:4[0x12a0]: Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)
  Stream #0:5[0x1015]: Video: hevc (Main 10) (HDMV / 0x564D4448), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
At least one output file must be specified

ok, thanks, I’ll add that probesize then for a test

1 Like

We’ve made the change available in the Kodi v21 test builds now.
Please try updating and let us know how it goes.

I updated to the latest v21 test build, and it seems that the problem is now fixed. :tada:

Just out of curiosity, what was changed?

I just added a 10 MB probesize as you suggested, the analyzeduration was already set to 20 seconds.

1 Like