Code from this tutorial https://pyimagesearch.com/2019/09/02/opencv-stream-video-to-web-browser-html-page/.