Skip to content
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

Error: Invalid ebmlName 'TimecodeScale' #10

Open
nklhtv opened this issue Apr 7, 2022 · 11 comments
Open

Error: Invalid ebmlName 'TimecodeScale' #10

nklhtv opened this issue Apr 7, 2022 · 11 comments

Comments

@nklhtv
Copy link
Contributor

nklhtv commented Apr 7, 2022

For me 2.2.4 fails with Error: Invalid ebmlName 'TimecodeScale' when i require it.
Tried to change TimecodeScale > TimestampScale but then it fails with another Error: Invalid ebmlName

TimecodeScale existed but was removed in 2.2.4 https://github.com/oeuillot/node-matroska/pull/9/files#diff-ffadab0ba7a844f70b864530afe444d3684ca96212ca5b3e3bcd72291e535123L1822

@chrmcg Perhaps you can help me. Am i missing something?

@chrmcg
Copy link
Contributor

chrmcg commented Apr 7, 2022

@nklhtv The corresponding hex code 0x2ad7b1 wasn't removed, just moved (from line 1821 to line 2142).

It looks like Matroska V4 renamed "timecodes" to "timestamps" across the board.

When I require 2.2.4 in my app, things seem ok -- could you post reproduction steps for the error you're seeing?

@nklhtv
Copy link
Contributor Author

nklhtv commented Apr 7, 2022

@chrmcg thank you for the fast response
https://github.com/nklhtv/matroska-test
for me it fails with:

/home/matroska/node_modules/matroska/lib/dom/_proto.js:10
                throw new Error("Invalid ebmlName '" + ebmlName + "'");
                ^

Error: Invalid ebmlName 'TimecodeScale'
    at Object.addAttribute (/home/matroska/node_modules/matroska/lib/dom/_proto.js:10:9)
    at Object.<anonymous> (/home/matroska/node_modules/matroska/lib/dom/info.js:32:8)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/matroska/node_modules/matroska/lib/document.js:25:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)

@nklhtv
Copy link
Contributor Author

nklhtv commented Apr 7, 2022

0x2ad7b1 has cppname of TimecodeScale while its name is TimestampScale
but if i change TimecodeScale to TimestampScale in lib/dom/info.js another similar error pops up. this time about ColourSpace

@chrmcg
Copy link
Contributor

chrmcg commented Apr 7, 2022

I'm trying to figure out what _proto.addAttribute is for in lib/dom/info.js... seems like we're looking at the same thing right now

@nklhtv
Copy link
Contributor Author

nklhtv commented Apr 7, 2022

after i change ColourSpace to UncompressedFourCC and TimecodeScale to TimestampScale it seems fine, at least for the video i am testing with

@chrmcg
Copy link
Contributor

chrmcg commented Apr 7, 2022

I think the right way to upgrade this library to Matroska V4 would be to also go through /lib/dom and add all the new attributes to the Document prototype.

For some context -- When I made #9, I was only concerned about the schema file because that's the only piece that's used by ts-ebml, the library I use to set EBML metadata on webm files generated in the browser.

@chrmcg
Copy link
Contributor

chrmcg commented Apr 7, 2022

@oeuillot what do you think?

@theipster
Copy link

P.S. silly question, but rather than manually translating the already machine-readable Matroska specification ebml_matroska.xml, why not create a mechanism that parses it direct from the source of truth (or a local verbatim snapshot of it)? 🤔

@oeuillot
Copy link
Owner

I'm sorry, I'm in the middle of delivering a big project in React JS (an 18 months work). Everything must be ready by the end of the week, so I really don't have time to dedicate to node-mkv.
However, at the beginning of June, I'll be able to work more actively on the project.

@cyril-colin
Copy link

Hello :) @oeuillot

any news about this ?

@theipster
Copy link

P.S. silly question, but rather than manually translating the already machine-readable Matroska specification ebml_matroska.xml, why not create a mechanism that parses it direct from the source of truth (or a local verbatim snapshot of it)? 🤔

Further to this, I spent this evening quickly hacking together some code (it's ugly, sorry not sorry) to show how it could quite easily be done.

As a sense check, you can compare my autogenerated schema against the currently hardcoded lib/schema.js and it's actually not too far off - especially considering that my version uses the cutting-edge upstream spec ebml_matroska.xml, which contains changes that aren't in lib/schema.js yet.

If anyone is interested, I've pushed some code to #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants