amazon-chime-sdk-js
amazon-chime-sdk-js copied to clipboard
How to control the quality of all the videos not only the local one?
Hi,
I saw that we can change the quality of our video, but it is possible to control the quality of the other videos that we area watching?
Unfortunately, we do not support this right now. I will bring this back to our team as an enhancement idea.
@jcarlosfern Not sure if you are still interested in this issue but as a workaround, you can either use data message to send message to the remote client and call chooseVideoQuality API accordingly.
Another workaround is to use simulcast uplink policy and priority-based downlink policy to choose the suitable video quality to subscribe to.
We recently published a video layout guide that might help.
Let me know if this does not work for you.
@ltrung We're trying to use a priority-based downlink policy to implement a featured view, but so far, haven't been able achieve a satisfactory result.
The goal is to have a featured video that is always downloaded at maximum quality. In our implementation, the featured video has a priority of 1 while all others are 2.
This initially seems to work but:
-
The featured stream is still downgraded whenever there are more than 2 participants on the call. (from the original 1920x1080 down to 960 x540 or worse.
-
Video tiles will sometimes pause for 3-10 seconds at a time, without any user interaction. When this happens, the stream metrics show the attendee as receiving a
videoDownstreamBitrateof 0. Unfortunately, this not only affects the secondary video, but also the featured video as well.
We'd like to prevent this downscaling and stream pausing, but haven't been able to do so with priorities alone.
Is simulcast required for using priorities effectively? And is there a way to override the default stream pausing behavior?
Worth noting that we're using https://github.com/aws/amazon-chime-sdk-component-library-react to render the video tiles inside a custom grid element.
@kaizau
- Yes, this is the current default behavior for the simulcast policy. You can extend it and change the behavior and remove the downscaling. You can see an example in this code branch https://github.com/aws/amazon-chime-sdk-js/blob/new-simulcast-policy/src/videouplinkbandwidthpolicy/SimulcastUplinkPolicyNScaleLowStream.ts
- This seems like a priority-based behavior. Do you see the event
tileWillBePausedByDownlinkPolicy? If so, it is due to bandwidth properly. If your use case only need to feature one video stream at max resolution while other videos can be downscaled then you do not need to use simulcast. The default uplink policy has this API setHasBandwidthPriority that you can use to prioritize a stream. The default behavior is to prioritize active speaker so if you want to suppress that behavior, you need to override the ActiveSpeakerPolicy and set prioritizeVideoSendBandwidthForActiveSpeaker
@kaizau @jcarlosfern were the responses above useful? Have you tried the simulcast policy that @ltrung pointed to in https://github.com/aws/amazon-chime-sdk-js/blob/new-simulcast-policy/src/videouplinkbandwidthpolicy/SimulcastUplinkPolicyNScaleLowStream.ts?
@vidya-mohan @ltrung Yes, thank you. This generally pointed me in the right direction.
Simulcast felt like overkill in our use case, so we ended up using setHasBandwidthPriority on the default NScaleVideoUplinkBandwidthPolicy as well as restricting uplink bandwidth selection on all secondary clients.
Overriding the ActiveSpeakerPolicy also required the workaround described here: https://github.com/aws/amazon-chime-sdk-component-library-react/issues/668
Closing this issue, please feel free to reopen it if you still have problems.
Hey! I am on 2.15.0 but seems not working.
This is what I am doing
// https://github.com/subhendukundu/aws-chime-content-share/blob/main/src/App.js
class VideoQualityActiveSpeakerPolicy extends DefaultActiveSpeakerPolicy {
prioritizeVideoSendBandwidthForActiveSpeaker() {
return false;
}
}
const enableWebAudio = true;
const activeSpeakerPolicy = new VideoQualityActiveSpeakerPolicy();
const meetingConfig = {
enableWebAudio,
activeSpeakerPolicy
};
return (
<MeetingProvider {...meetingConfig} meetingManager={meetingManager}>
.... ....
.... ....
</MeetingProvider>
)
then when I need to set the quality high or low
// https://github.com/subhendukundu/aws-chime-content-share/blob/main/src/components/AttendeeView.js
if (attendeeId === featureAttendeeId) {
videoUplinkPolicy.setHasBandwidthPriority(true);
videoUplinkPolicy.updateTransceiverController();
} else {
videoUplinkPolicy.setHasBandwidthPriority(false);
videoUplinkPolicy.updateTransceiverController();
audioVideo.unpauseVideoTile(tileId);
}
This doesn't work. It used work with a forked version which I had created to override the policy suggested by @ltrung a long time ago which still work with fork version. But we need to upgrade it now.
Reproduceable code -> https://github.com/subhendukundu/aws-chime-content-share Forked library -> https://github.com/subhendukundu/amazon-chime-sdk-component-library-react
Hey! I am on
2.15.0but seems not working. This is what I am doing// https://github.com/subhendukundu/aws-chime-content-share/blob/main/src/App.js class VideoQualityActiveSpeakerPolicy extends DefaultActiveSpeakerPolicy { prioritizeVideoSendBandwidthForActiveSpeaker() { return false; } } const enableWebAudio = true; const activeSpeakerPolicy = new VideoQualityActiveSpeakerPolicy(); const meetingConfig = { enableWebAudio, activeSpeakerPolicy }; return ( <MeetingProvider {...meetingConfig} meetingManager={meetingManager}> .... .... .... .... </MeetingProvider> )then when I need to set the quality high or low
// https://github.com/subhendukundu/aws-chime-content-share/blob/main/src/components/AttendeeView.js if (attendeeId === featureAttendeeId) { videoUplinkPolicy.setHasBandwidthPriority(true); videoUplinkPolicy.updateTransceiverController(); } else { videoUplinkPolicy.setHasBandwidthPriority(false); videoUplinkPolicy.updateTransceiverController(); audioVideo.unpauseVideoTile(tileId); }This doesn't work. It used work with a forked version which I had created to override the policy suggested by @ltrung a long time ago which still work with fork version. But we need to upgrade it now.
Reproduceable code -> https://github.com/subhendukundu/aws-chime-content-share Forked library -> https://github.com/subhendukundu/amazon-chime-sdk-component-library-react
Looking through your code base it looks like you're externally creating your own meetingManager, when you create your own meetingManager the meetingProvider will not create its own which means it will not insert the meetingConfig. You can either omit the outside creation of the meetingManager or pass the params like so and that should fix your issue.
We just tried this. Removed the meetingManager, like so https://github.com/subhendukundu/aws-chime-content-share/blob/main/src/App.js#L54
Still activeSpeakerPolicy not able to push higher video quality. :( Is there anything we are missing?