element-call icon indicating copy to clipboard operation
element-call copied to clipboard

Aspect ratio captured from a fancy HDMI + DSLR camera is broken

Open ara4n opened this issue 3 years ago • 1 comments

Had a call with @ouchadam and it looked like his DSLR connected via HDMI was spitting out 1.85:1 aspect video or similar, which was then being squidged to 1.78:1 by something. Sounds like it only happens in Element Call, so perhaps a constraints bug.

@ouchadam what browser was this, and what camera?

ara4n avatar Jun 27 '22 15:06 ara4n

for context around my setup - I'm using a Sony a5100 outputting a "clear" preview at 1920x1080 over hdmi to a generic hdmi to usb converter

v4l2-ctl -d /dev/video0 --list-formats-ext reports that the converter supports the following resolutions

1920x1080
1600x1200
1360x768
1280x1024
1280x720
1024x768
800x600
720x576
720x480
640x480

Element call logs the media handler output as

{
    "audio": {
        "deviceId": {
            "ideal": "default"
        }
    },
    "video": {
        "deviceId": {
            "ideal": "5968d1423a2f7233480a347e037a38ee94e16b8e01d77d20f431ad1befff50c3"
        },
        "width": {
            "exact": 640
        },
        "height": {
            "exact": 360
        }
    }
}

https://github.com/matrix-org/matrix-js-sdk/blob/53aa34fba57c9cb490076f1cd20e2fe539bfa1e8/src/webrtc/mediaHandler.ts#L266

My finger in the air guess to what's happening is element call is requesting 640x360 which isn't natively supported by the usb converter causing the closest supported resolution of 640x480 to be picked up which skews the original 1080p feed instead of scaling it down

Google meet for example defaults to 1280x720, I'm not sure what resolution jitsi is using

ouchadam avatar Jun 27 '22 20:06 ouchadam