0
votes

Hi I am using opentok cordova plugin for video calling in my cordova app.

The video calling when made using desktop version (using opentok) works perfectly fine. Both the video and audio clarity is awesome. However when the video call is made using cordova app, I notice considerable lag, the video gets stuck sometimes and the audio is also not that clear.

I want to know is there any special optimizations to be made or any special code to write while using cordova opentok plugin, so that the quality and overall experience matches with the desktop version ?

Or is it dependent only on the speed of the internet?

Please Help..

4

4 Answers

1
votes

Mobile devices generally are recommended to have any 2 videos "on stage" at any given time. You can try lowering the frame rate and resolution of other publishers to account for a mobile device, if the problem is CPU limitation.

1
votes

To my experience with OpenTok for Cordova you should use routed sessions instead of relayed sessions, see: https://tokbox.com/opentok/concepts/relayed_vs_routed.html

Also the video / audio is downsized automatically depending on the internet connection when using routed session: https://support.tokbox.com/hc/en-us/articles/200959390-What-is-the-minimum-bandwidth-requirement-to-use-OpenTok-

Video quality dynamically adjusts based on the strength of a user's network connectivity. This is done by the Subscriber sending feedback packets to the publisher that say "My network quality is at 'x' level. Please adjust your published video bit-rate to accommodate my current bandwidth". The faster and more stable a Subscriber's broadband connection is, the better the video quality it will request.

This mechanism works well until a certain point. If a Subscriber's bandwidth drops below a certain threshold, or if a Publisher has very little bandwidth to upload video, behavior can be unpredictable. Video may be choppy, audio may have artifacts, and the connection could be dropped.

We recommend a minimum dedicated 350kb/s down per downloaded stream, as well as 350kb/s up per uploaded stream to maintain a stable video connection.

1
votes

Here are my recommendations.

  1. Use a dynamic video height and width by setting them respectively to window.height and window.width. This way you are sure that you are using the optimum amount of width and height for your video. ex. OT.initPublisher('myPublisherDiv', {width: window.width, height: window.height});

  2. You can also explicitly set the frame rate of the video. According to this thread, It's safe to set it up to 30.

https://forums.tokbox.com/quality-issues/how-low-can-i-make-the-video-quality-if-i-want-to-t45463?sid=4ef57c99cb16302e598d197b0ac298d4

0
votes

After researching and sending my sessions to opentok forum, I found out that it was purely a network issue. The wifi bandwidth used to sometime fluctuate and that is why the video was getting stuck.

The minimum bandwidth required is 350kbps download and upload.

Thank you.