VideoWriter.write() very slow

As far as I am aware cv.VideoWriter should be accelerated for some codecs. That said I have had limited success with hardware acceleration myself.

I ran a quick comparisson between CPU transcoding (I couldn’t get hardware acceleration to work for the codecs I was using) and GPU transcoding with cv.cudacodec. The performance increase was around 9x on my setup (Mobile RTX 3070 Ti vs i7-12700H), it might be worth a try if its supported on your system.

See here for the comparisson.