austinleroy / node-ebml Goto Github PK
View Code? Open in Web Editor NEWThis project forked from node-ebml/node-ebml
EBML parser
License: MIT License
This project forked from node-ebml/node-ebml
EBML parser
License: MIT License
I tried using your library to save the initial headers, and then let a user join mid stream to view whatever another browser was sending.
Couldn't make it work.
My theory is that it should be possible to let another user join at the next upcoming chunk.
Is that possible with this library? If not can it be made possible in some way?
running a file tru the decoder then the encoder again doesn't always yield the same results, sometimes it does sometimes it doesnt
reproduction code:
import { createReadStream } from 'fs'
import { EbmlStreamDecoder, EbmlStreamEncoder, EbmlTagId } from 'ebml-stream'
import { pipeline as _p, Readable, Transform } from 'stream'
import { promisify } from 'util'
const pipeline = promisify(_p)
const ebmlDecoder = new EbmlStreamDecoder()
const ebmlEncoder = new EbmlStreamEncoder()
const hasher = createHash('sha1').setEncoding('hex')
await pipeline(createReadStream('media/' + file), ebmlDecoder, ebmlEncoder, hasher)
const hash = hasher.read()
console.log(hash)
// vs
const hasher = createHash('sha1').setEncoding('hex')
await pipeline(createReadStream('media/' + file), hasher)
const hash1 = hasher.read()
console.log(hash1)
yields different outputs, mainly different lengths, I've identified this to be master tags most of the time, specifically Segment
and EBML
notably from the media/
folder, audiosample.webm
yields a different length after reencoding, while video-webm-codecs-avc1-42E01E.webm
yields the same result
is this caused by corrupted blocks?
EbmlStreamDecoder will not output any data if the stream starts in the middle of a file ex:
import { createReadStream } from 'node:fs'
import { EbmlStreamDecoder } from 'ebml-stream'
const decoder = new EbmlStreamDecoder({
bufferTagIds: [
EbmlTagId.TimecodeScale,
EbmlTagId.Tracks,
EbmlTagId.BlockGroup,
EbmlTagId.AttachedFile
]
})
decoder.on('data', console.log) // never ran
const stream = createReadStream('./video.mkv', { start: 2392064, end: 23920640 })
stream.on('data', data => decoder.write(data))
stream.pipe(subtitle).pipe(devnull())
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.