Videodimensions changes its values during the video call

Hello everyone,

I have a doubt about the video size during a video call.

In our app developed using Ionic, Angular and openvidu-browser, we have noticed that in the iOS version when the user changes the orientation of the device, sometimes the videoDimensions property of the Stream has changes in its values. With the same device in the same video call, the values are not always the same.

Does anyone know if these changes are made directly by WebRTC? Can they be caused by changes in the internet connection or other aspects? I have read in this forum something about an adaptive bitrate mechanism, which can automatically change video properties like this.

If this is the reason for the changes, can we do something to keep the dimensions or override this behavior?

Thanks in advance

Hi, this behavior that you describe is normal and expected for devices that can be rotated in the middle of a call.

It’s not only caused by iPhones; an Android phone with Chrome web browser will behave the same. Given a resolution of AxB in landscape mode, when the phone is rotated to portrait, the video must be rotated and so the resolution becomes BxA.

For example a device that joins a call in portrait mode would capture video at 480x640 (vertical). If the user then physically rotates the phone to landscape mode, it is Chrome that will rotate the encoding of the video too, and it becomes 640x480 (horizontal). Otherwise, the rest of the people would see this participant rotated 90 degrees.

From the point of view of a receiver, this is what you would see in chrome://webrtc-internals/:

which makes sense given the physical movements that the user is doing with their camera.

I think it would be possible to disable this behavior in the device itself, at least on Android it’s possible to drop-down the Quick Settings panel and disable “Auto-rotate”. This way, Chrome will never notice that the device has been rotated (orientation sensors are disabled) so it won’t ever change the encoding resolution (but other people will see the person sideways)

Hi j1elo,

I probably didn’t explain the problem well.

I understand your answer, it is an expected behavior, but my doubt was that when I rotate the device and put it in landscape orientation, sometimes the dimensions are 640x480, but at another time in the same video call, the dimensions are 320x180. I don’t remember the exact values, but it is an example.

I don’t know if it’s something that maybe we don’t have right in the application or it’s the expected behavior, caused by something we don’t know about. But it is true that we have detected it only using iPhone and not on Android.