Bug In PMS Mediainfo/Metadata Parser

Server Version#: 1.25.2.5319

With FFMPEG if you make a MKV with EAC3 audio you get the following metadata which Plex fails to parse the audio bitrate metadata for:

Metadata:
    encoder         : libebml v1.4.0 + libmatroska v1.6.1
  Duration: 01:00:20.00, start: 0.000000, bitrate: 4350 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)

However is you use MkvToolNix you get the following metadata which Plex can indeed parse the audio bitrate correctly:

Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
    creation_time   : 2021-12-10T00:16:23.000000Z
  Duration: 01:02:12.00, start: 0.000000, bitrate: 4351 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 3707419
      DURATION        : 01:02:11.979000000
      NUMBER_OF_FRAMES: 89478
      NUMBER_OF_BYTES : 1729501609
      _STATISTICS_WRITING_APP: mkvmerge v63.0.0 ('Everything') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-10 00:16:23
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      BPS             : 640000
      DURATION        : 01:02:12.000000000
      NUMBER_OF_FRAMES: 116625
      NUMBER_OF_BYTES : 298560000
      _STATISTICS_WRITING_APP: mkvmerge v63.0.0 ('Everything') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-12-10 00:16:23
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

I’m thinking that maybe the mediainfo parser Plex uses was not designed for the combination of FFMPEG, MKV, and EAC3 and instead relies on the extended metadata MkvToolNix provides. Can anyone confirm?

@PlexInTheCloud

Can you carve me off a chunk of the beginning of that file ? ( 2-3 MB worth using dd)

I’d like to see what PMS does with it.

@ChuckPa Here’s a 60s clip of one I have handy: Yuma60sv2.mkv

@ChuckPa Here’s a smaller 15s clip of a different file: Wheel15s.mkv

Plex fails to parse the audio bitrate:



    Codec EAC3
    Channels 6
    Language English
    Language Tag en
    Audio Channel Layout 5.1(side)
    Sampling Rate 48000 Hz
    Display Title English (EAC3 5.1)
    Extended Display Title English (EAC3 5.1)


However Mediainfo is able to parse the bitrate field correctly:

Audio
ID                                       : 2
Format                                   : E-AC-3 JOC
Format/Info                              : Enhanced AC-3 with Joint Object Coding
Commercial name                          : Dolby Digital Plus with Dolby Atmos
Codec ID                                 : A_EAC3
Duration                                 : 15 s 8 ms
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 32 bits
Compression mode                         : Lossy
Stream size                              : 821 KiB (13%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No
Complexity index                         : 16
Number of dynamic objects                : 15
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

And just in case it helps here’s the metadata you get from ffmpeg:

Input #0, matroska,webm, from 'Wheel15s.mkv':
  Metadata:
    ENCODER         : Lavf57.83.100
  Duration: 00:00:18.02, start: 0.000000, bitrate: 2838 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      DURATION        : 00:00:15.181000000
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      DURATION        : 00:00:15.008000000
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : English
      DURATION        : 00:00:18.018000000

The bitrate meta tag in MKV files is optional. Some software tools which create MKV files simply don’t care to write them.
You can only take the file and let mkvtoolnix remux it (as a whole, without making any changes) to get the bitrate metadata into it.

Alternatively, enabling the detailed media analysis in Plex (under Scheduled Tasks) should give you more accurate bitrate info than mkvtoolnix is able to create.

Thanks for the insightful response @OttoKerner. That makes a lot of sense. I’m just wondering if maybe it wouldn’t be a good idea for Plex to fallback to parsing from the Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default) line if Metadata: BPS: 448000 is not present. That seems to be what Mediainfo does and FFMPEG reliably seems to populate the bitrate there for EAC3/TrueHD audio tracks (though I’ve noticed it doesn’t for certain codecs such as AAC)

@PlexInTheCloud

That firm requires I sign up to get the file.

Have you an alternative ?

a ZIP file containing the video clip attached here?

@ChuckPa No prob. Here’s the clip attached in a zip

Wheel15s.zip (5.9 MB)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.