Low latency video/media recording

Alt Text

The video in the top is the stream from navigator.mediaDevices.getUserMedia() which is set as the source of a the first video element. The bottom video is the video from MediaRecorder API. The video is played from a Virtual Web Camera (OBS VirtualCam specifically)

The problem I’m having with this

  • When the video starts to stream for the web camera (once allowed) the media seems to be pushed to the MediaSource but the playback took a while to actually play (about 2-3 seconds). What kind of behaviour is this?
  • Another problem is the playback in the bottom video is delayed, I have been testing and I am finding that the problem is because of the mediaRecorder.ondataavailable is not triggered fast enough, thus the chucks are delayed. In what way possible that the MediaRecorder API or similar API can be used to record in much lower latency than this?