-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Live streaming support #12
Comments
There already is a streaming target, documented in README, which is a callback that regularly gets called as new muxed chunks become available. Only gotcha is that the offsets it gets called with are not monotonically increasing (since it goes back to rewrite old parts), which is not what you'd want for streaming. But, if you ignored those, have you tried using that for streaming? If it doesn't work, I could add an option that ensures that all data is written sequentially. |
Sorry I did not realized that. I'll take a look and test. But I don't know if I understand about the offsets. I control the offsets written to the media chunks block in the code, right? |
The offset is the byte offset at which the data passed is written. It works like this, remember: let muxer = new WebMMuxer({
target: (data: Uint8Array, offset: number, done: boolean) => {
// Do something with the data
},
...
}); Every time the function is called, you'll get some bytes in form of a Again, you can see if this works. WebM actually was designed with live-streaming in mind, it just required me to mux it slightly differently (never jump back, set "size" fields to unknown, etc.). If it doesn't work for you as-is, I can try adding a mode for it! |
Got it, thanks for the explanation. I think I can connect to an icecast2 server directly using PUT (I'm using this [1] as reference). Lemme see if I manage to write something fast to test live streaming. [1] https://github.com/social-dist0rtion-protocol/wasm-stream/blob/master/src/icecast.js |
How's it going? Do you still need something, or can I close this issue for now? |
Would it be possible to get chunks of muxed data for live streaming? I use webm streaming created from ffmpeg (to an icecast2 server) and it works fine (I can play in a html5 video ou audio tag without problem), even thou the webm standard was not really conceived for live streaming...
The text was updated successfully, but these errors were encountered: