Choose resolution on player

neogeo

Member
I screen share at 1920x1080. Is there any way to select on the player a lower resolution in the case I do not want to spend so much bandwidth?
 

Max

Administrator
Staff member
You can force video resolution on player. Example:
Code:
session.createStream({name:'stream1',constraints:{video:{width:640,height:480}}}).play();
However in such case WCS will perform video transcoding from 1920x1080 to 640x480.
The transcoding operation is very CPU intensive and may take 1 physical core of CPU. So if you have 10 of such screen-sharing streams, you will need 10 cores CPU for transcoding.

Another way - automatically decrease / suppress publisher's bitrate upon viewers' requests.
We plan to release such algorithm next week.
 

Max

Administrator
Staff member
in the case I do not want to spend so much bandwidth?
If you want to save bandwidth, you have to consider less resolution for screen-sharing stream.
Or perhaps you can find a hosting which does not limit outgoing bandwidth.
 

neogeo

Member
Ok, all clear with the bandwidth and the transcoding.
On another note: As you can see the preview is tiny whereas the publishing resolution is very big. Any ideas why is that happening?

upload_2017-3-16_17-58-14.png
 

Max

Administrator
Staff member
It is happening because Chrome, most likely, does not support resolution you want to publish.
You can see actual resolution in chrome://webrtc-internals
You can also try to disable CPU overuse detector in Chrome.
On some systems Chrome does limit resolution if high CPU utilization is detected.
Code:
googCpuOveruseDetection: false
Example:
Code:
function publishStream() {
var session = Flashphoner.getSessions()[0];
var streamName = $('#publishStream').val();
session.createStream({
name: streamName,
display: localVideo,
cacheLocalResources: true,
receiveVideo: false,
receiveAudio: false,
constraints: {audio: true, video: {width:1280,height:720}},
mediaConnectionConstraints: {"mandatory": {googCpuOveruseDetection: false}}
}).on(STREAM_STATUS.PUBLISHING, function(stream){
setStatus("#publishStatus", STREAM_STATUS.PUBLISHING);
onPublishing(stream);
}).on(STREAM_STATUS.UNPUBLISHED, function(){
setStatus("#publishStatus", STREAM_STATUS.UNPUBLISHED);
onUnpublished();
}).on(STREAM_STATUS.FAILED, function(){
setStatus("#publishStatus", STREAM_STATUS.FAILED);
onUnpublished();
}).publish();
}
 

Max

Administrator
Staff member
This is webrtc-internals graphs.
You can see resolution in
googFrameWidthSent
googFrameHeightSent


internals.jpg
 
Top