node-matroska
node-matroska copied to clipboard
Error: Invalid ebmlName 'TimecodeScale'
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?
@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?
@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)
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
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
after i change ColourSpace to UncompressedFourCC and TimecodeScale to TimestampScale it seems fine, at least for the video i am testing with
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 https://github.com/oeuillot/node-matroska/pull/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.
@oeuillot what do you think?
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)? 🤔
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.
Hello :) @oeuillot
any news about this ?
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 https://github.com/oeuillot/node-matroska/pull/16.