Skip to content

EbmlStreamDecoder fails when not aligned to a cluster #3

@ThaUnknown

Description

@ThaUnknown

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions