This project demonstrates how to use the nodejs module wrtc to covert a WebRTC live capture from a browser to an RTSP stream.
This work is based on node-webrtc/node-webrtc-examples (record-audio-video-stream).
npm install
npm run build
This project does not require any external system-wide dependencies.
node ./build/rtsp/rtsp.js
node ./build/server/server.js
Navigate to http://127.0.0.1:8080 Then click startRecord
. An id will be allocated.
Get a rtsp player and use this URL:
rtsp://127.0.0.1:6554/${id}
For ffplay
, the command should be:
ffplay rtsp://127.0.0.1:6554/${id}
This is a weird bug and I don't know how to solve it ultimately.
frameRate = 29.97 => everything ok
frameRate = 29.97002983093261 => everything ok
frameRate = 29.970029830932614 => everything ok
frameRate = 29.970029830932617 => real fps received at server = ~60
The workaround however is simple: fix frameRate
to 29.97 or whatever else working value on both browser and server.