EBML encoder and decoder
ebml encoder and decoder written in TypeScript.
It is a fork of https://github.com/themasch/node-ebml
npm install ts-ebml --save
$ ts-ebml foo.webm
0 m 0 EBML
5 u 1 EBMLVersion 1
9 u 1 EBMLReadVersion 1
13 u 1 EBMLMaxIDLength 4
17 u 1 EBMLMaxSizeLength 8
21 s 1 DocType webm
28 u 1 DocTypeVersion 2
32 u 1 DocTypeReadVersion 2
36 m 0 Segment
48 m 1 Info
53 u 2 TimecodeScale 1000000
...
$ ts-ebml -s input.webm | cat > seekable.webm
import * as ebml from 'ts-ebml';
const fs = require('fs');
const decoder = new ebml.Decoder();
fs.createReadStream('media/test.webm').on('data', (buf)=>{
const ebmlElms = decoder.decode(buf);
console.log(ebmlElms);
});
bundle
import * as ebml from 'ts-ebml';
const decoder = new ebml.Decoder();
fetch('media/test.webm')
.then((res)=> res.arrayBuffer() )
.then((buf)=>{
const ebmlElms = decoder.decode(buf);
console.log(ebmlElms);
});
see src/test.ts and src/example_seekable.ts
…
npm install
npm run build # build js code
npm run lint # tslint
npm run doc # typedoc
npm run lint # type check (watch)
npm test # build and run tests
MOZ_LOG_FILE="log.txt" MOZ_LOG="MediaDemuxer:5" /Applications/FirefoxNightly.app/Contents/MacOS/firefox-binMOZ_LOG_FILE="log.txt" MOZ_LOG="MediaDemuxer:5" /Applications/Firefox.app/Contents/MacOS/firefox-binffmpeg -i not_seekable.webm -c copy seekable.webmmkclean --doctype 4 --keep-cues --optimize not_seekable.webm seekable.webmwebm_info -a foo.webm - https://chromium.googlesource.com/webm/libwebmMIT
No open issues yet, or sync has not completed.