Length indicated by EBML number exceeds max length (and other errors)

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
Cannikin
Posts: 182
Joined: Tue Aug 18, 2020 11:54 pm

Length indicated by EBML number exceeds max length (and other errors)

Post by Cannikin » Sun Jun 29, 2025 9:24 pm

I've noticed some errors on playback from UHD MKV rips the last few days. The first hint that something was wrong is that the script I use to convert DolbyVision Profile 7 to Profile 8 would show errors when trying to pull out the HEVC stream:

Code: Select all

Matroska parse error: Invalid EBML number size 13 at pos 73398822307
I ran an ffprobe command (found on Stack Overflow) and it reports:

Code: Select all

[matroska,webm @ 0x125f064e0] Element at 0x12611fe7d ending at 0x82e1dcf9b exceeds containing master element ending at 0x1269e2888
[matroska,webm @ 0x125f064e0] Element at 0x363bc53c0 ending at 0x73207cf7b exceeds containing master element ending at 0x3640cbe6f
[matroska,webm @ 0x125f064e0] Element at 0x36f059654 ending at 0xab6fad83f9 exceeds containing master element ending at 0x36f0865fa
[matroska,webm @ 0x125f064e0] Element at 0x436f1ff73 ending at 0x44057abfc exceeds containing master element ending at 0x43740c49d
[matroska,webm @ 0x125f064e0] Length 6 indicated by an EBML number's first byte 0x04 at pos 18322785150 (0x4441f837e) exceeds max length 4.
[matroska,webm @ 0x125f064e0] Length 6 indicated by an EBML number's first byte 0x07 at pos 22502798898 (0x53d457632) exceeds max length 4.
[matroska,webm @ 0x125f064e0] Length 6 indicated by an EBML number's first byte 0x07 at pos 26880748563 (0x64237ac13) exceeds max length 4.
[matroska,webm @ 0x125f064e0] 0x00 at pos 29743469987 (0x6ecd955a3) invalid as first byte of an EBML number
[matroska,webm @ 0x125f064e0] Element at 0x7d27b9bc6 ending at 0x7dd023f49 exceeds containing master element ending at 0x7d29d3cbe
[matroska,webm @ 0x125f064e0] Element at 0x7e85e1325 ending at 0x7e86703b8 exceeds containing master element ending at 0x7e861b44d
[matroska,webm @ 0x125f064e0] Element at 0x848251753 ending at 0x9c223f7ef exceeds containing master element ending at 0x8489db96a
[matroska,webm @ 0x125f064e0] Element at 0x86a2d5488 ending at 0x874f7eeed exceeds containing master element ending at 0x86a51bb22
[matroska,webm @ 0x125f064e0] Element at 0x88e26fc45 ending at 0x8969024de exceeds containing master element ending at 0x88e6b110a
[matroska,webm @ 0x125f064e0] Element at 0x9506065d0 ending at 0x9523ce50e exceeds containing master element ending at 0x95079255d
[matroska,webm @ 0x125f064e0] Element at 0x976ad3eaa ending at 0x97967edd3 exceeds containing master element ending at 0x976ddf424
[matroska,webm @ 0x125f064e0] Length 7 indicated by an EBML number's first byte 0x03 at pos 43126840594 (0xa0a8f5d12) exceeds max length 4.
[matroska,webm @ 0x125f064e0] Element at 0xabd18ee37 ending at 0xabece5914 exceeds containing master element ending at 0xabd355b8d
[matroska,webm @ 0x125f064e0] Element at 0xbf855d729 ending at 0xc07b0a945 exceeds containing master element ending at 0xbf8e5c16f
[matroska,webm @ 0x125f064e0] Element at 0xc3892595c ending at 0xc3e878d45 exceeds containing master element ending at 0xc389a2d4a
[matroska,webm @ 0x125f064e0] Element at 0xc5aa2dd25 ending at 0xc5da7fb37 exceeds containing master element ending at 0xc5ab8749c
[matroska,webm @ 0x125f064e0] Element at 0xc7a9c2702 ending at 0x13ffdb155d exceeds containing master element ending at 0xc7b3b35d6
[matroska,webm @ 0x125f064e0] Element at 0xd15a9ffce ending at 0xd17d12cd5 exceeds containing master element ending at 0xd15a9ffd2
[matroska,webm @ 0x125f064e0] Invalid track number 1296229
[matroska,webm @ 0x125f064e0] Element at 0xdc0bf3e07 ending at 0xdc0ca63c9 exceeds containing master element ending at 0xdc0c0cc68
[matroska,webm @ 0x125f064e0] 0x00 at pos 61294075455 (0xe45695e3f) invalid as first byte of an EBML number
[matroska,webm @ 0x125f064e0] Element at 0xeeecf7ae4 ending at 0x3ff197087ae exceeds containing master element ending at 0xeef1afa61
[matroska,webm @ 0x125f064e0] Element at 0xfbc4eefd7 ending at 0x15e8f2e3bb exceeds containing master element ending at 0xfbc69636f
[matroska,webm @ 0x125f064e0] Element at 0x1154c9881e ending at 0x115eb55151 exceeds containing master element ending at 0x11556e2c65
When watching the movie it'll sometimes skip ahead a few frames (audio and video), sometimes see compression artifacts on top of the video for a second or two:

Image

I'm ripping from an ASUS BW-16D1HT 3.10 to an M3 Macbook Pro, directly to a NAS. I've ripped over 2,000 discs with this drive and never noticed a problem until recently. MakeMKV doesn't show any errors in the log. This disc specifically is the Dark City UHD that was recently released. I tried re-ripping it and I still get errors, although they seem to occur in different places.

I've only found 4 rips that throw these errors during the P7 -> P8 conversion (two of them are Dark City, theatrical and director's cuts) so I'm hoping those are the only ones with the problems. This ffprobe command is way too slow to run on everything I've ever ripped, but I've run it on .mkv's that did *not* throw any errors during the P7->P8 conversion and ffprobe reports no errors either.

ffprobe runs for 30 seconds or more before it starts finding the errors in Dark City. One of the other bad files is Bullet Train and ffprobe shows an error as soon as it starts running:

Code: Select all

[matroska,webm @ 0x11e706090] 0x00 at pos 22024323 (0x1501083) invalid as first byte of an EBML number
The other bad one, Gummo, reports errors instantly as well:

Code: Select all

[matroska,webm @ 0x151706490] 0x00 at pos 13743131 (0xd1b41b) invalid as first byte of an EBML number
[matroska,webm @ 0x151706490] 0x00 at pos 24451614 (0x1751a1e) invalid as first byte of an EBML number
I'm currently running my drive through a powered USB-C hub (but I've ripped hundreds of discs in this setup and haven't had an issue. I'm going to try ripping directly to one of the Macbook's USB-C ports and see what happens. I'll report back.

Cannikin
Posts: 182
Joined: Tue Aug 18, 2020 11:54 pm

Re: Length indicated by EBML number exceeds max length (and other errors)

Post by Cannikin » Mon Jun 30, 2025 3:24 am

Update

Ripped the disk straight to Mac, no hubs or anything in-between: no errors. Copied the file to my NAS and then ran the ffprobe command: errors.

I did an SHA256 checksum against both files and they don't match!! So somehow the file is being corrupted during transit or before being written to disk. TCP error checking is the foundation of the entire Internet so I'm guessing the problem isn't happening over the wire.

ChatGPT suggests I do a memory test on the NAS and depending on the results, replace it with ECC RAM. It thinks the chunks are being corrupted in RAM before being written to disk, because I'm using Btrfs and that has checksumming and would find errors if they were occurring on disk.

Memory test is gonna take a while, I'll report back. I'm also going to try transferring the file from a PC instead of my Mac, see if that makes a difference.

Post Reply