-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect endianness of TimeCode property in (Simple)Block object #12
Comments
Hello @maurice-camp, I think this is an issue related to NEbml, can you post your question there? |
Hi @StefH I looked into it a bit further and I dont think the issue is related to NEbml.
The spanreader uses the MemoryMarshal.Read method for converting the byte array to a short:
I think this method is architecture dependent when it comes to endianness causing the incorrect value. |
This will be fixed in new version which will be released shortly. |
I'm trying to readout the timestamps for each datablock/frame in a matroska file. It seems however that the TimeCode property in the SimpleBlock object returns a value with little endianness while (according to https://matroska-org.github.io/libebml/specs.html) EBML integer datatypes are big-endian.
This leads to incorrect timestamps (when comparing to another tool like MKVToolNix):
![image](https://user-images.githubusercontent.com/24876513/137088113-52939eca-c9f3-464f-b296-4456db82972f.png)
MKVToolNix output:
![image](https://user-images.githubusercontent.com/24876513/137087975-366f8a5a-576b-4b68-893b-4fbbf3b1568b.png)
If I manually revert endianness of the timecode file the values seem to match:
8448 -> 33
16896 -> 66
etc.
The text was updated successfully, but these errors were encountered: