VideoWriter not working on MacOS

asked 2020-10-04 08:25:15 -0500

ilouzl gravatar image

updated 2020-10-04 08:27:29 -0500

Installed opencv from PIP (python 3.8) and just cant write any video properly. Using this general constructor pattern: writer = cv.VideoWriter('myvideo.avi',cv.VideoWriter_fourcc('m','j','p','g'),25,(h,w)) And trying many different codecs (divx, mp4v, avc1...) - none of them works. Just getting an unreadable file 'myvideo.avi' that weights just a few KB.

The irony is that if I write the video using opencv c++ code (been using this example), it works perfect.

edit retag flag offensive close merge delete


Here is link fourcc for MacOS.

supra56 gravatar imagesupra56 ( 2020-10-04 20:44:14 -0500 )edit

Thanks, already tried that, but none of them works...

ilouzl gravatar imageilouzl ( 2020-10-07 08:25:04 -0500 )edit