Video Aspect Ratio isn't 16:9

Description

  • When I startVideo with a virtual background, sometimes the video aspect ratio is not 16:9. I have tried multiple times with the same options when starting the video.
  • When the video aspect ratio is not 16:9, I do not receive any errors when starting the video.
  • This is my sessionId: VEd4yzv8Ste4+FscN5Cl2w==

I would appreciate any help.

Which Web Video SDK version?
VideoSDK: 2.1.0

Video SDK Code Snippets

    let videoOptions = {
      cameraId: cameraId,
      hd: state.mediaStream.isSupportHDVideo(),
      originalRatio: false,
    };

    if (state.mediaStream.isSupportVirtualBackground() && virtualBackground) {
      videoOptions.virtualBackground = { imageUrl: virtualBackground };
    }
    await state.mediaStream.startVideo(videoOptions);

To Reproduce

  1. Join the meeting.
  2. Start the camera.

My customer mentioned that simply toggling the camera on and off also causes this issue.

3. Browser/Client Type and Version

  • Device: macOS
  • Browser: Chrome
  • Browser Version: Chrome version 133

Sorry, I checked again and noticed the message “HD support is currently limited, and comes with a number of restrictions and limitations” .

Can you check this, @vic.yang? We’re also facing this issue—it usually appears on small screens (small width and large height).

Thank you in advance!

Hey @namlv

Thanks for your feedback.

VEd4yzv8Ste4+FscN5Cl2w==

We analyzed the logs and confirmed that the captured aspect ratio was 4:3 instead of 16:9. The logs indicate that we attempted to capture video at a 1280x720 resolution, but it failed, causing a fallback to the default capture. This may be due to the camera not supporting the specified constraints.

Could you test it using the official WebRTC sample?

Thanks
Vic

@vic.yang Thanks for your response.

We’d like to provide more details on this case:

  • When this issue occurs, turning the camera off and then on again → the video ratio is corrected, and the issue no longer appears.
  • The issue occurs when rendering with Canvas. However, switching to video-player inside video-player-container → the video ratio is corrected, and the issue no longer appears
  • If we remove the option hd: state.mediaStream.isSupportHDVideo() → the video ratio is corrected, and the issue no longer appears. Could this be related to the warning: “HD support is currently limited and comes with several restrictions and limitations”?

Can you help us identify the root cause and suggest a solution for this?

Hi @lmtruong1512

The issue occurs when rendering with Canvas. However, switching to video-player inside video-player-container

Yes. We recommend using stream.attachVideo method instead of stream.renderVideo method in the 2.x version, as the latter one may be deprecated in the future release.

“HD support is currently limited and comes with several restrictions and limitations” ?

It is just a notification indicating that HD or Full HD video may not be effective on certain platforms or devices. We will gradually support more platforms. This notification does not affect functionality.

Thanks
Vic

1 Like

@vic.yang Thanks, we’ll temporarily disable the HD option to fix the ratio issue and later switch to stream.attachVideo instead of stream.renderVideo.

@vic.yang Preview also encountered this issue. We can’t set it within a 16:9 view without black edges. I converted canvas to use video-player but the issue still appear

I checked the camera resolution, and it appears that the supported formats are:

  • 180p (320x180)
  • QVGA (320x240)
  • 360p (640x360)
  • VGA (640x480)

However, HD (1280x720) and Full HD (1920x1080) are not supported.

On preview screen, I switched from using a canvas to a video-player, but the issue still persists. How can we resolve this? I tested with the official Zoom web client, and it seems to zoom in to fit a 16:9 view.

Hi @lmtruong1512

This is currently a limitation in the Video SDK Web preview feature.

If you know the camera’s supported aspect ratio (e.g., it only captures 4:3 video), you can adjust the video-player’s aspect-ratio setting to 4:3.

Thanks
Vic

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.