You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.2 KiB

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/