Rotate webcam 90 degrees

Soldato
Joined
27 Oct 2005
Posts
13,751
Location
Netherlands
Hello,

Does anyone know of a way to rotate any generic webcam by 90 degrees?

Eg. Camera is 1920x1080 landscape, We want to use it 90 degrees rotated physically, so that we get a 1080x1920 (9:16) stream rather than 16:9.

I'd imagine you'd have to manipulate the driver, anyone know where I'd have to start?
 
OBS Studo will do this in software. Install, connect webcam then once you have the image up, right click it and select transform. Rotate 90 degrees is there
 
Thanks, I'll try that/see how it's done there, but we need the image rotated on driver level, or in a WPF application (we want to use it with WebRTC/EasyRTC in a Cefsharp/Chromium component for communication in portrait mode). It is possible to rotate a video stream in WebRTC (all JS)? Or do I need to look at driver level?
 
Apparantly you can mirror the video stream with css:


Code:
.easyrtcMirror {
    -webkit-transform: scaleX(-1);
    -moz-transform: scaleX(-1);
    -ms-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    transform: scaleX(-1);
}

Code:
<video class="easyrtcMirror"></video>
Unfortunately I'm not great in Computer Graphics, I've forgotten how to transform an image to turn it clockwise or counter clockwise 90 deg.
That might be the solution browser side, curious if it's possible on driver level though!
 
Back
Top Bottom