Git Product home page Git Product logo

node-ebml's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

node-ebml's Issues

Join mid stream

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?

library doesn't reencode files in the same way as they were originally encoded

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 fails when not aligned to a cluster

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())

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.