-1

I use video.srcObject = mediaStream; // MediaStream object to feed a <video> tag. (Same as this demo: https://webrtc.github.io/samples/src/content/capture/video-video/)

The video is 60 FPS however from chrome://webrtc-internals graph, it shows the video FPS sent/receive is constantly at 30FPS. Is this set anywhere that i can change?

FYI - I'm not using getUserMedia(), I'm doing exactly the same as the demo -- streaming from a <video> to another <video> using peer-to-peer connection with WebRTC.

Zip
  • 809
  • 2
  • 14
  • 30
  • Can you show your code? The example you linked to has nothing to do with WebRTC directly (other than that these media components are wrapped up in WebRTC libs), and also does not use MediaSource. The example uses `captureStream()`, which I've never seen run higher than 30 FPS. – Brad Apr 30 '19 at 17:19
  • The code the exactly the same as the WebRTC sample, i forked from it. You're right i'm not using WebRTC directly. So the left video is just using – Zip Apr 30 '19 at 18:22
  • In addition to my answer, I might suggest joining video-dev on Slack. http://video-dev.herokuapp.com/ There are a few folks there who work on the browser implementations of this API. Perhaps they can provide insight as to why this is locked at 30 FPS max. – Brad Apr 30 '19 at 18:26

1 Answers1

0

Unfortunately, it isn't possible to specify the frame rate with HTML5MediaElement.captureStream().

If you were streaming from a Canvas, you can specify the frame rate with the first parameter:

canvas.captureStream(30);

However, I've never seen any capture stream run higher than 30 FPS. This is a relatively new API, with a lot of implementation quirks and hardcoded items.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • Thanks for the explanation, I'm still very new to video, just started reading about WebRTC since 2 weeks ago. I want to measure the WebRTC decoding performance (like using chrome://webrtc-internal), don't care about P2P connection at all, should I just feed a video stream as MediaStream to – Zip Apr 30 '19 at 18:44
  • I found this https://stackoverflow.com/questions/21225187/how-to-create-mediastream-from-videofile but it's suggesting using captureStream() which still doesn't go above 30fps. – Zip Apr 30 '19 at 18:46
  • I've read a few of your questions... I don't really follow what you're getting at. `getUserMedia()` is for webcams, capture interfaces, microphones, audio interfaces, etc. It has nothing to do with regular video *decoding*. Perhaps you should post a new question that explains the entirety of what you're trying to do from a higher level so we can suggest a better answer. Alternatively, if you're interested in consulting, please e-mail me at brad@audiopump.co. – Brad Apr 30 '19 at 18:53