Reputation: 1
I want to maintain a minimum frame rate of 20 FPS. If the network is slow, it should degrade the image quality to always maintain 20fps. I don't want a tradeoff between resolution and FPS, I only want FPS constant or higher than 20. I'm trying to use adaptive bitrate streaming for this but I cant find any documentation or examples. I
I've tried modifying the SDP on both sides with a=quality:1 and changing the codecs, but it didn't work. The video quality is always constant, and when the network is slow, the frame rate suffers. I want to change it to the opposite but I'm not sure how.
Do I need to use a special encoding/codec or a different setting in the SDP?
Upvotes: 0
Views: 1262
Reputation: 5651
You cannot ensure a minimum frame rate. For example, if the network connection is interrupted, then the frame rate will naturally drop to zero.
What you can do is encourage the sender to reduce the image quality rather than dropping the frame rate when network conditions get difficult. In the JavaScript API, you do that by setting the track's contentHint property:
stream.getVideoTracks().forEach(t => {
t.contentHint = 'motion';
});
Note that this will not do anything useful on Firefox, but it does work reliably on Chromium-based browsers and on Safari.
Upvotes: 0