-
-
Notifications
You must be signed in to change notification settings - Fork 908
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
RTMP live transcoding is available? #100
Comments
Currently the answer is no. I am stilling researching for how to integrate RTMP/RTSP library with ffmpeg.wasm, will announce once I have found the way. 😄 |
@jeromewu thank you for working on such a great project. If you find a way to do rtmp in the browser that would be a huge breakthrough for live streaming. |
This could be extremely impactful to the live streaming community with developing browse based tools. Could direct stream to Twitch/Youtube/Facebook straight from the browser without downloading OBS/Streamlab. |
I did a bit of digging and found that Emscripten internally uses WebSocket to simulate POSIX TCP messages. This breaks RTMP for obvious reasons because RTMP servers don't understand WebSocket right out of the box. There is a way to do this with a proxy server, but that requires a separate process being run locally. We might be able to run our own proxy server (transforms websocket -> tcp) and stream to our proxy server. This won't make it entirely "server-less" but it does take the heavy-lifting transcoding away from servers. |
@tjwudi is not possible to take WebRTC webcam media or screen share by getUserMedia() WebRTC API into ffmpeg.wasm then directly stream to youtube to any RTMP server? |
news? |
mediarecorder api is also there? But how can we stream those recording to youtube or any rtmp server |
It's unlikely this will ever be possible, as WASM isn't allowed to post any requests that aren't going through normal browser security rules and protocols, and browsers just don't support RTMP network protocol at all. |
This might be a job for a separate sister framework, but it'd be cool to implement a similar system within something like Electron. Since you can securely stream WebRTC from the Renderer process (Web) to a Preload/Main process (Node), I'd guess there is an existing library to create an RMTP stream over NodeJS (If not, possibly a Node Binary could fit in there?) Just speculation, but would be awesome to see. EDIT: Obviously this wouldn't be the "all-in-browser" approach people want, but the web is still the web, it takes a lot of time and extreme patience for anything like an entirely new protocol to be added |
Maybe with electron, as @hcatlin said I don't think wasm will open any new possibility to support RTMP from a browser |
This would be very cool as currently there isn't any simple way to go live from the web to a rtmp streaming servers without an intermediary service. |
How about live webcam streaming to an icecast2 server? ffmpeg does support indeed icecast2 output. And of course, from an icecast2 server, one can send the stream to any other destination. |
Live streaming via HLS here: Kagami/ffmpeg.js#166 |
Great! Could you share a sample HLS streaming html / js pipeline? |
One question: DASH is also enabled, right? |
@rafael2k yes I've got a sample app but it's not quite ready yet. |
Hi @davedoesdev ! I'm really willing to test DASH, and can help. I'm still in my infancy with WebAssembly, but indeed I'm a long time C developer. I did not even manage to compile ffmpeg.wasm in my Debian Bullseye (11) with Emscripten installed via apt-get. It seems to me an ad-hoc build script is made for an external installed toolchain, and not native installed one. But I can already make Makefiles for my projects and compile them to .wasm (so for now - if you can provide binaries, I can start playing sooner). Also, please point me which repo to (try to) build from. Is a plan to merge back ffmpeg.wasm to main ffmpeg repo? |
@rafael2k let's take it to davedoesdev/ffmpeg.js#1 I compile using emsdk: https://emscripten.org/docs/getting_started/downloads.html |
Demo here: https://rawgit-now.netlify.app/davedoesdev/streamana/publish/site/streamana.html Demo streams to YouTube Live using camera and microphone captured using getUserMedia (all in browser). |
@jeromewu Is this still pending? |
I would like to ask if this possible to transcoding for example a live webcam to RTMP stream, like in CLI ffmpeg version. For example the incoming data from camera directly transcoded by FFMpeg.wasm to an RTMP server?
Main question is, is it possible to do something like that:
mediaRecorder.ondataavailable = async (data) => { ffmpeg.transcode_to_RTMP_server(new Uint8Array(await (new Blob([data])).arrayBuffer())) }
Thank you very much!
The text was updated successfully, but these errors were encountered: