Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.2 KB

streams.md

File metadata and controls

26 lines (16 loc) · 1.2 KB

Streams

mux.js uses a concept of streams to allow a flexible architecture to read and manipulate video bitstreams. The streams are loosely based on Node Streams and are meant to be composible into a series of streams: a pipeline.

Stream API

Take a look at the base Stream to get an idea of the methods and events available. In general, data is pushed into a stream and is flushed out of a stream. Streams can be connected by calling pipe on the source Stream and passing in the destination Stream. data events correspond to pushes and done events correspond to flushes.

MP4 Transmuxer

An example of a pipeline is contained in the MP4 Transmuxer. This is a diagram showing the whole pipeline, including the flow of data from beginning to end:

mux.js diagram

You can gain a better understanding of what is going on by using our debug page and following the bytes through the pipeline:

npm start

and go to http://localhost:9999/debug/