aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
699 stars 473 forks source link

Issues with streaming Canvas Element #2900

Closed euro-bYte closed 4 weeks ago

euro-bYte commented 4 weeks ago

What happened and what did you expect to happen?

When using a canvas img to use as a videoinput stream I get this warning:

[3:35:58 PM] warning 2024-06-05T19:35:58.643Z [WARN] AwsChimeClient - Video track (content = false) will be constrained to: {"width":{"ideal":1280},"height":{"ideal":720},"frameRate":{"ideal":30}} to remain below configured video quality settings, trackSettings: {"aspectRatio":1.7777777777777777,"deviceId":"sQ8+1B+c9DAU+BCCyQPuzXpd9UAe6XbetaarwJ6eF6UOTBeUvxHhaD705XEVmsXO0R84N+zNNG7V9k/dIui08g==","frameRate":60,"height":1080,"resizeMode":"none","width":1920}
debug [2024-06-05T19:35:58.644Z] DEBUG ChimeSession#eventControllerObserver: event received {"name":"meetingStartSucceeded"} 

After some time the stream drops and AWS returns an error:

error 2024-06-05T19:36:27.184Z [ERROR] AwsChimeClient - Received error from server: Disabled video/content send capability, reason: Video resolution is above limit of current meeting feature selection

I tried many different things to try to resolve this and I haven't found any other issue with this use case.

Have you reviewed our existing documentation?

Reproduction steps

1 . create a canvas element and use a high quality image

  1. Capture the stream
    canvas.captureStream() // this will return a MediaStream
  2. after setting the inputQuality and bandwidth
    
    audioVideo.chooseVideoInputQuality(
    1280,
    720,
    15
    )

audioVideo.setVideoMaxBandwidthKbps(1400)

4. start streaming

...

await audioVideo.startVideoInput(options.videoSource) // when this runs the warning pops up

// start streaming audioVideo.start() audioVideo.startLocalVideoTile()



### Amazon Chime SDK for JavaScript version

3.21.1

### What browsers are you seeing the problem on?

chrome

### Browser version

Version 125.0.6422.113

### Meeting and Attendee ID Information.

_No response_

### Browser console logs

![Screen Shot 2024-06-05 at 3 45 45 PM](https://github.com/aws/amazon-chime-sdk-js/assets/138539944/92d3385d-1d99-40e0-a77b-cb96ab6c14cd)
euro-bYte commented 4 weeks ago

This was solved with explicitly setting the width to 1280 and height to 720 of the image being drawn in the canvas