New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a simple example? #231

AlgusDark opened this Issue Nov 14, 2018 · 1 comment


None yet
2 participants

AlgusDark commented Nov 14, 2018

Is there a working example on how to use mux?

I'm trying to transmux to mp4 on the fly (I'll take care of getting all the segments in order and provide them) but I'm not able to do it in a minimal way

  const fetch = require("node-fetch");
  const muxjs = require("mux.js");

  const buffer = await fetch(
  ).then(response => response.arrayBuffer());

  const uArray = new Uint8Array(buffer);

  var transmuxer = new muxjs.mp4.Transmuxer();

  transmuxer.on("data", function(segment) {; // --->

I want to Response trough res object from Express.

I've tried to Buffer.from( with something like:

function bufferToStream(buffer) {
    let stream = new Readable();
    return stream;

  transmuxer.on("data", function(segment) {

I was able to download the mp4 file... but I can't play it. TS file can be played with VLC



This comment has been minimized.


forbesjo commented Nov 16, 2018

We have a debug page ( that shows a simple use case but we should document how to use this more clearly. Marking this as a documentation chore, we'll add more docs to make this easier. If you want to take a shot at writing the documentation we would be happy to review and appreciate the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment