ts-ebml
ts-ebml copied to clipboard
Error with Chrome Version 92.0.4515.107 (Official Build) (x86_64) on macos
Hi,
Since I installed the last version of chrome on my mac (macos 11.4) decoding and reading file generate with MediaRecorder throw an exception: "No schema entry found for unknown"
An EBMLElement has unknown in schema.
I have made an exemple here. just start and stop recording. https://stackblitz.com/edit/typescript-5rfmcf?file=index.ts
Perhaps it is a bug in Chrome but so far I don't find it in tracker.
Thanks
Does anyone know if this is on Chromium's bug tracker, or if it's a deprecation (planned or unplanned) or bug?
Having the same issue. My code is
const readAsArrayBuffer = (blob: Blob) => {
return new Promise(resolve => {
const reader = new FileReader()
reader.readAsArrayBuffer(blob)
reader.onloadend = () => {
resolve(reader.result)
}
})
}
const injectMetaData = async (blob: Blob) => {
try {
const decoder = new Decoder()
const reader = new Reader()
reader.logging = false
reader.drop_default_duration = false
const buffer = (await readAsArrayBuffer(blob)) as ArrayBuffer
const elms = decoder.decode(buffer)
console.log("elms", elms)
elms.forEach(elm => {
reader.read(elm)
})
reader.stop()
const refinedMetadataBuf = tools.makeMetadataSeekable(reader.metadatas, reader.duration, reader.cues)
const body = buffer.slice(reader.metadataSize)
return new Blob([refinedMetadataBuf, body], { type: blob.type })
} catch (error) {
console.error(error)
}
}
I got this from the log
0: {EBML_ID: "1a45dfa3", schema: {…}, type: "m", name: "EBML", level: "0", …}
1: {EBML_ID: "4286", schema: {…}, type: "u", name: "EBMLVersion", level: 1, …}
2: {EBML_ID: "42f7", schema: {…}, type: "u", name: "EBMLReadVersion", level: 1, …}
3: {EBML_ID: "42f2", schema: {…}, type: "u", name: "EBMLMaxIDLength", level: 1, …}
4: {EBML_ID: "42f3", schema: {…}, type: "u", name: "EBMLMaxSizeLength", level: 1, …}
5: {EBML_ID: "4282", schema: {…}, type: "s", name: "DocType", level: 1, …}
6: {EBML_ID: "4287", schema: {…}, type: "u", name: "DocTypeVersion", level: 1, …}
7: {EBML_ID: "4285", schema: {…}, type: "u", name: "DocTypeReadVersion", level: 1, …}
8: {EBML_ID: "1a45dfa3", schema: {…}, type: "m", name: "EBML", level: "0", …}
9: {EBML_ID: "18538067", schema: {…}, type: "m", name: "Segment", level: "0", …}
10: {EBML_ID: "1549a966", schema: {…}, type: "m", name: "Info", level: 1, …}
11: {EBML_ID: "2ad7b1", schema: {…}, type: "u", name: "TimecodeScale", level: 2, …}
12: {EBML_ID: "4d80", schema: {…}, type: "8", name: "MuxingApp", level: 2, …}
13: {EBML_ID: "5741", schema: {…}, type: "8", name: "WritingApp", level: 2, …}
14: {EBML_ID: "1549a966", schema: {…}, type: "m", name: "Info", level: 1, …}
15: {EBML_ID: "1654ae6b", schema: {…}, type: "m", name: "Tracks", level: 1, …}
16: {EBML_ID: "ae", schema: {…}, type: "m", name: "TrackEntry", level: 2, …}
17: {EBML_ID: "d7", schema: {…}, type: "u", name: "TrackNumber", level: 3, …}
18: {EBML_ID: "73c5", schema: {…}, type: "u", name: "TrackUID", level: 3, …}
19: {EBML_ID: "83", schema: {…}, type: "u", name: "TrackType", level: 3, …}
20: {EBML_ID: "86", schema: {…}, type: "s", name: "CodecID", level: 3, …}
21: {EBML_ID: "63a2", schema: {…}, type: "b", name: "CodecPrivate", level: 3, …}
22: {EBML_ID: "e1", schema: {…}, type: "m", name: "Audio", level: 3, …}
23: {EBML_ID: "b5", schema: {…}, type: "f", name: "SamplingFrequency", level: 4, …}
24: {EBML_ID: "9f", schema: {…}, type: "u", name: "Channels", level: 4, …}
25: {EBML_ID: "6264", schema: {…}, type: "u", name: "BitDepth", level: 4, …}
26: {EBML_ID: "e1", schema: {…}, type: "m", name: "Audio", level: 3, …}
27: {EBML_ID: "ae", schema: {…}, type: "m", name: "TrackEntry", level: 2, …}
28: {EBML_ID: "ae", schema: {…}, type: "m", name: "TrackEntry", level: 2, …}
29: {EBML_ID: "d7", schema: {…}, type: "u", name: "TrackNumber", level: 3, …}
30: {EBML_ID: "73c5", schema: {…}, type: "u", name: "TrackUID", level: 3, …}
31: {EBML_ID: "83", schema: {…}, type: "u", name: "TrackType", level: 3, …}
32: {EBML_ID: "86", schema: {…}, type: "s", name: "CodecID", level: 3, …}
33: {EBML_ID: "e0", schema: {…}, type: "m", name: "Video", level: 3, …}
34: {EBML_ID: "b0", schema: {…}, type: "u", name: "PixelWidth", level: 4, …}
35: {EBML_ID: "ba", schema: {…}, type: "u", name: "PixelHeight", level: 4, …}
36: {EBML_ID: "55b0", schema: {…}, type: "unknown", name: "unknown", level: -1, …} // This cause the error
37: {EBML_ID: "e0", schema: {…}, type: "m", name: "Video", level: 3, …}
38: {EBML_ID: "ae", schema: {…}, type: "m", name: "TrackEntry", level: 2, …}
39: {EBML_ID: "1654ae6b", schema: {…}, type: "m", name: "Tracks", level: 1, …}
40: {EBML_ID: "1f43b675", schema: {…}, type: "m", name: "Cluster", level: 1, …}
41: {EBML_ID: "e7", schema: {…}, type: "u", name: "Timecode", level: 2, …}
42: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
43: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
44: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
45: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
46: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
47: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
48: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
49: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
50: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
51: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
52: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
53: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
54: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
55: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
56: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
57: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
58: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
59: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
60: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
61: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
62: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
63: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
64: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
65: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
66: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
67: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
68: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
69: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
70: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
71: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
72: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
73: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
74: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
75: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
76: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
77: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
78: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
79: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
80: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
81: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
82: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
83: {EBML_ID: "a3", schema: {…}, type: "b", name: "SimpleBlock", level: 2, …}
Number 36 which has type and name is unknown
I don't know what is the correct way to solve this.
I am filter the unknown and invalid type one out to bypass this issue for now.
...
let elms = decoder.decode(buffer)
const validEmlType = ["m", "u", "i", "f", "s", "8", "b", "d"] // This is from elm type of the lib
elms = elms?.filter(elm => validEmlType.includes(elm.type))
elms.forEach(elm => {
reader.read(elm)
})
reader.stop()
....
After further investigation, I suppose chrome change how is webm generated and start using Matroska Element 0x55b*.
These elements are neither in schema.js in dependency package "matroska" nor in "node-ebml". I don't why there were ignored. I post an issue here https://github.com/oeuillot/node-matroska/issues/8
In my case I use ts-ebml for the duration so, for now, I will do like @tonynguyenit18
Any progress here? are we just going to remove the data with unknown type?
I've just created https://github.com/oeuillot/node-matroska/pull/9 to update schema.js
to Matroska v4, which might help with this.
+1
I've just created oeuillot/node-matroska#9 to update
schema.js
to Matroska v4, which might help with this.
Matroska v2.2.4 breaks ts-ebml and now gives wrong duration
https://github.com/oeuillot/node-matroska/issues/12