Rotate the video created by createCapture


I am doing a posenet implementation of ml5 and p5.js

Typical setup for the ML5 Posenet is as following:
function setup() {
const canvas = createCanvas(640, 480);
video = createCapture(VIDEO);

poseNet = ml5.poseNet(video, modelReady);

poseNet.on(‘pose’, function(results) {
poses = results;

I want to feed a 90 degree rotated video to the poseNet.

I looked at rotate function but it seems to be only applicable to draw() function and it does not affect the actual image getting passed into the neural network.

How can I pass a 90 degree rotated image from a webcam to the NN model?

You pass posenet a video object – rotating or flipping Processing’s drawing output won’t change that object.

I don’t think that posenet supports built-in rotation.

I’m also not sure if createCapture, or getUserMedia which it is based on, support rotation.

Can you rotate the physical webcam? Or can you record video and rotate the video? Another option is to use 3rd-party software on the cam end to rotate the video feed – vlog or video chat software with “rotate” as a feature.