Closed yarekc closed 7 years ago
You would need to use media-stream-recorder and create a sequence of small webm files. These would need to be sent through an FFMPEG command with the "concat" option.
The webms will be in VP8/VP9 and Opus codecs, so you'll need to transcode those to H.264 and AAC (which is what most streaming services use).
Still trying to get this working myself, but I'm sure it's possible.
The ideal solution would be to write a performant MediaStream-to-RTMP transcoder in WebAssembly that would do all this.
Closing because managing the output is out of scope for this project, but feel free to continue discussion here.
As for the actual sending of the RTMP packets, client-side Javascript can't access the rtmp:// protocol, so you would need a proxy server for that (which is what I referred to in the README). A modified rtmp-server-nodejs could work.
Overall, it's no easy feat and probably deserving of it's own project altogether.
MediaRecorder supports the h264 codec, so that will save you a transcode.
Actually it might be better to just use DTLS-SRTP -> Server -> RTMP
The Red5 open media server plans to add this: https://github.com/Red5/red5-server (They moved it into the "pro" version. Unfortunate.)
Another paid service is Wowza, so it is feasible. https://www.wowza.com/blog/using-webrtc-as-a-replacement-for-rtmp
Hello, You say: "You could send it over a WebRTC connection, record it as a file, send to to a proxy RTMP server, pipe it through FFMPEG... anything."
Any idea on how to send that to a RTMP server : I don't think ffmpeg is able to convert webrtc to RTMP
regards