How to force a fixed or lower resolution?

wyvasi

Member
Hello!
How can we force a fixed or a lower resolution when publishing from web?
We have this code for browsers but it seems some users still publish with 1920x1080 instead of 1280x720 do I have to add anything else to force it?
Code:
constraints: {
    video: {
    width: 1280,
    height: 720
}
Also where can I get video publish resolution when it comes from rtmp(OBS), it seems I get width:0, height:0 on pubishStream ? can I get it latter on another endpoint?
 

Max

Administrator
Staff member
Good day.
We have this code for browsers but it seems some users still publish with 1920x1080 instead of 1280x720 do I have to add anything else to force it?
Please check your frontend code. If resolution constraints are set, a most browsers will publish WebRTC stream with resolution not higher than constraints define. If no resolution constraints set, WebSDK sets 320x240 as default. So looks like you've set 1920x1080 at client side occasionally.
Also where can I get video publish resolution when it comes from rtmp(OBS), it seems I get width:0, height:0 on pubishStream ? can I get it latter on another endpoint?
You can get stream metrics using REST API.
 
Top