All Projects → legokichi → ts-ebml

legokichi / ts-ebml

Licence: other
EBML encoder and decoder

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to ts-ebml

ebml-go
A pure Go implementation of bi-directional EBML encoder/decoder
Stars: ✭ 60 (-53.85%)
Mutual labels:  webm, ebml
mp4analyser
mp4 file analyser written in Python
Stars: ✭ 50 (-61.54%)
Mutual labels:  webm, ebml
Webmgenerator
UI and Automation to cut, filter and join high quality webms, mp4s or gifs.
Stars: ✭ 103 (-20.77%)
Mutual labels:  webm
go-matroska
Golang: Matroska and WebM Format
Stars: ✭ 33 (-74.62%)
Mutual labels:  webm
Swiftffmpeg
A Swift wrapper for the FFmpeg API
Stars: ✭ 243 (+86.92%)
Mutual labels:  webm
Opus Media Recorder
MediaRecorder polyfill for Opus recording using WebAssembly
Stars: ✭ 159 (+22.31%)
Mutual labels:  webm
BAT FFMPEG
Batch script files for FFMPEG (Microsoft Windows and DOS, OS/2 🦄)
Stars: ✭ 104 (-20%)
Mutual labels:  mkv
Vp8 Webm Javascript Decoder
hand ported version of vp8 webm javascript decoder
Stars: ✭ 101 (-22.31%)
Mutual labels:  webm
matroska-subtitles
💬 Streaming parser for embedded .mkv subtitles.
Stars: ✭ 40 (-69.23%)
Mutual labels:  mkv
Webmcam
Capture frames in real-time and save them as WebM.
Stars: ✭ 238 (+83.08%)
Mutual labels:  webm
Mpv Webm
Simple WebM maker for mpv, with no external dependencies.
Stars: ✭ 234 (+80%)
Mutual labels:  webm
Ffmpeg.js
Port of FFmpeg with Emscripten
Stars: ✭ 2,447 (+1782.31%)
Mutual labels:  webm
nipper
🌶 💽 Nipper - Youtube playlist (& video) ripper
Stars: ✭ 23 (-82.31%)
Mutual labels:  webm
Youtubedownloader
Downloads videos and playlists from YouTube
Stars: ✭ 2,202 (+1593.85%)
Mutual labels:  webm
JB2A DnD5e
Templates of spells from the DnD5e ruleset (SRD and PHB), to use on FoundryVTT
Stars: ✭ 28 (-78.46%)
Mutual labels:  webm
Vue Howler
[UNMAINTAINED] A Howler.js mixin for Vue 2 that makes it easy to create custom audio player components
Stars: ✭ 103 (-20.77%)
Mutual labels:  webm
jsvpx
Full Javascript implementation of libvpx vp8 decoder.
Stars: ✭ 21 (-83.85%)
Mutual labels:  webm
wybm
✂️ Extract and cut youtube webms
Stars: ✭ 55 (-57.69%)
Mutual labels:  webm
ExpertVideoToolbox
A lightweight, versatile GUI of x264, x265. Nearly full input formats support, .mkv and .mp4 output support. Avs support will be added soon. Language: Chinese
Stars: ✭ 12 (-90.77%)
Mutual labels:  mkv
Ccapture.js
A library to capture canvas-based animations at a fixed framerate
Stars: ✭ 2,836 (+2081.54%)
Mutual labels:  webm

ts-ebml

ebml encoder and decoder written in TypeScript.

Fork of node-ebml

It is a fork of https://github.com/themasch/node-ebml

install

npm install ts-ebml --save

usage

show EBML structure on console

$ 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
...

try to convert a MediaRecorder WebM to seekable WebM

$ ts-ebml -s input.webm | cat > seekable.webm

node

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);
});

browser

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);
  });

features

  • get WebP frame from MediaRecorder WebM VP8 Stream
  • create seekable webm from media-recoder
  • create playable webm to media-stream-api from media-recorder

see src/test.ts and src/example_seekable.ts

stable API

class Decoder {
  constructor();
  decode(chunk: ArrayBuffer): EBMLElementDetail[];
}

class Encoder {
  constructor();
  encode(elms: EBMLElementBuffer[]): ArrayBuffer;
}

type EBMLElementBuffer = MasterElement | ChildElementBuffer;
type EBMLElementDetail = (MasterElement | ChildElementValue) & ElementDetail;

type MasterElement = {
  name: string;
  type: "m";
  isEnd: boolean;
  unknownSize?: boolean;
};
type ChildElementBuffer = {
  name: string;
  type: "u" | "i" | "f" | "s" | "8" | "b" | "d";
  data: Buffer;
};
type ChildElementValue = ChildElementBuffer & {
  value: number|string|Buffer|Date;
};
type ElementDetail = {
  tagStart: number;
  tagEnd: number;
  sizeStart: number;
  sizeEnd: number;
  dataStart: number;
  dataEnd: number;
};
namespace tools {
  export function readVint(buffer: Buffer, start: number): null | ({length: number; value: number; });
  export function writeVint(val: number): Buffer;
  export function readBlock(buf: ArrayBuffer): EBML.SimpleBlock;
}

develop

npm run setup # install cli tools
npm run init  # install libraries
npm run build # build js code
npm run lint  # tslint
npm run doc   # typedoc
npm run check # type check
npm run test  # build test
npm run example # build example

debugging tools

license

MIT

related info

related issues

media recorder seekable webm

chrome

firefox

others

media recorder media source gap

chrome

others

chrome

firefox

related works

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].