/webrtc-mediasoup-ffmpeg-recorder-poc

Proof of concept of sending a video from a browser to a server using WebRTC and recording the video to disk. Technologies used include Mediasoup, FFmpeg, and socket.io.

Primary LanguageJavaScriptBSD Zero Clause License0BSD

WebRTC Mediasoup FFmpeg Recorder Proof of Concept

Proof of concept streaming video and audio over WebRTC and capturing a recording server side. Uses socket.io, mediasoup and FFmpeg.

Quick start

Backend

cd backend
pnpm install
pnpm start

Frontend

cd frontend
pnpm install
pnpm dev

Web browser

Open http://localhost:1234

If everything works, then after a few seconds there should be a video created in backend/files

If it doesn't work, try reloading the page. There is some sort of race condition where the video is usually, but not always, recorded. Not production grade, but good enough for a basic PoC.

Call sequence

WebRTC is flexible which leads to it being complex to setup and get working. The call sequence tries to strike a balance to have enough detail without being overwhelming.

Call sequence