mpegts-demuxer
v0.1.0
Published
Demuxes an MPEG Transport Stream into elementary packets.
Downloads
44
Maintainers
Readme
TV Kitchen Utility: MPEG-TS Demuxer
This package demuxes packets from an MPEG transport stream.
It is a modified fork of the excellent TSDemuxer package created by Logan Kearsley. The overall project was started as a JavaScript / TypeScript implementation of Anton Burdinuk's C++ MPEG-TS demuxer.
How to Use
The MpegTsDemuxer
is a NodeJS Transform
stream which means it supports the Read and Write stream APIs. It consumes raw mpegts data as a stream and emits Packet objects as they are parsed.
import { MpegTsDemuxer } from 'mpegts-demuxer'
import { createReadStream } from 'fs'
const fileStream = fs.createReadStream('myFile.ts')
const mpegTsDemuxer = new MpegTsDemuxer()
fileStream.pipe(mpegTsDemuxer)
mpegTsDemuxer.on('data', (packet) => {
console.log(packet)
})
References
If you want to understand the technical specifications related to demuxing MPEG-TS streams can check out the spec directly.
About the TV Kitchen
TV Kitchen is a project of Bad Idea Factory. Learn more at the TV Kitchen project site.
Participating
TV Kitchen is an open source project, and we welcome contributions of any kind.
Thank you for considering, and before diving in please follow these steps:
- Step 1: read our code of conduct.
- Step 2: review our contribution guide.
- Step 3: make sure your contribution is related to an issue.
- Step 4: review these testing best practices.