Transcoding video for web browser

I’m trying to convert ‘FMP4’ videos to a non-proprietary codec/ format that is supported by a web browser so that I can display such videos in a web application. In my code I read video frame by frame with cv.VideoCapture.read() and write each frame with a different codec using cv.VideoWriter’s write() function. I’m using ‘vp09’ (with .webm extension) and it works but it is extremely slow. My question is twofold: is there a way to configure VP9 by, for instance, reducing the compression or quality of the codec using Python openCV so that the algorithm runs faster? Alternatively, is there another fourcc I should be using that is faster than ‘vp08’ and ‘vp09’ and it is still supported by web browsers?

opencv is for computer vision, not for video conversion.

use ffmpeg directly.