videojs / mux.js

Lightweight utilities for inspecting and manipulating video container formats.
Apache License 2.0
1.08k stars 211 forks source link

Support for live, continuous streams #227

Open supersat opened 5 years ago

supersat commented 5 years ago

As is, mux.js doesn't seem to support live, continuous transport streams, such as those received from a networked TV tuner like an HDHomeRun. I've made this work by adding support for recognizing end_of_seq_rbsp NALs and having VideoSegmentStream.push() call flush() on itself when it receives an end_of_seq_rbsp NAL. However, before trying to upstream this, I have a few questions:

  1. Is this a feature that's desired/in scope for mux.js? We certainly want it for our use case (pulling HDHomeRun streams with the new fetch() streaming API), and I suppose it might be desirable for non-HLS or DASH-like Internet TS streams (if those exist?).

  2. Is this the best way to make this work, or is it a hack?

Assuming this is something that can be upstreamed, there's a separate issue of supporting other audio codecs, such as AC-3. We have a working JavaScript decoder, and can otherwise send it as pass-through data on some devices like Chomecasts. But that's a hairier beast, so I'll leave that to another issue.

forbesjo commented 5 years ago

How many changes would this feature make? Do you have a branch for us to look at?

supersat commented 5 years ago

It's not very many changes. You can see the changes at https://github.com/supersat/mux.js/compare/autoflush.