Videowriter not working properly when deployed on Heroku

you forgot to call out.release() at the end

always follow official documentation, not some questionable video tutorials on youtube made by someone who doesn’t know OpenCV.