Low-latency Video Recording

北城以北 提交于 2020-04-16 03:12:13

问题


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.

UPDATE:

What is happening here? 1. Video from camera is play directly in the video element, that element video stream is recorded through MediaRecorder API, recorded video is sent to server (websocket). The video (bottom) is playing the video from websocket. My tests shows that the latency is not from the Websocket but from the either the MediaRecorder or the playback is delayed.

来源:https://stackoverflow.com/questions/61051566/low-latency-video-recording

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!