change published stream Video size, Frame rate and Bit rate

cheinan

Member
Hello
can i change published stream Video size, video Frame rate and video Bit rate while streaming
with out disconnect the session and create new stream?

Thanks
Cheinan
 

Max

Administrator
Staff member
Hello
No, you can't change video resolution and frame rate in real-time.
You can just setup maximum values, for example: 640x480, 30 fps, 500000 bps.
WebRTC may automatically adjust these values targeting low-latency.
For example, it can reduce to: 320x240, 20 fps, 300000 bps dynamically.
See chrome://webrtc-internals charts for more information.

Example:

 

cheinan

Member
Thanks Max

Anther question:
When i try to change the "video.frameRate" to something different from 30
I get error: STREAM_STATUS.FAILED, and i could not connect and create new Stream.
I get success connection only on video.frameRate = 30
Any idea way?

I want to make it lower something like 15 or 10.

Cheinan
 

Max

Administrator
Staff member
Please check our Media Devices sample
https://wcs5-eu.flashphoner.com/cli...dia_devices_manager/media_device_manager.html
Source code:
https://github.com/flashphoner/flas...dia_devices_manager/media_device_manager.html
https://github.com/flashphoner/flas...mo/streaming/media_devices_manager/manager.js
As you can see, you can set publishing FPS:
Code:
constraints.video.frameRate = parseInt($('#fps').val());
https://github.com/flashphoner/flas...reaming/media_devices_manager/manager.js#L291

So you can pass fps to constraints object.
Example:
Code:
session.createStream({name:'stream1', display:myDisplay, constraints:{video:{frameRate:15},audio:true}});
Please check our sample. It works for me. I'm able to set 15 FPS rate and it is publishing.

15-fps.jpg
 

Max

Administrator
Staff member
We have checked Firefox.
The issue is reproduced now. Thanks.
I will inform you through this thread once we have a fix.
 

Max

Administrator
Staff member
Unlike Chrome, which adjusts the frame rate if it is not supported by the selected camera, Firefox checks which of the available devices meet the constraint, and if there are no such devices MediaDevices.getUserMedia() results in OverconstrainedError. So, publishing fails even without device access request if the specified constraints are not met.

This WebRTC demo can be used to check which constraints would work: https://webrtc.github.io/samples/src/content/peerconnection/constraints/
 
Top