VideoWriter and available codecs

asked 2019-08-26 10:46:41 -0500

TomerP gravatar image

Hi, I'm trying to use VideoWriter on Windows to create a video from images, but I'm not sure how to find out which codecs can be used on my machine. The documentation says that on Windows you can use DIVX and that other codecs will be tested and added sometime in the future.

I've tried using cv2.VideoWriter_fourcc(*'H264'), but it only creates empty files and doesn't encode anything.

My question is, if I want to achieve a better compression, how can I know which codecs are available for use (or at least, which codecs could I use to achieve higher compression than the outdated DIVX codec)?

edit retag flag offensive close merge delete

Comments

I'm trying to use VideoWriter on Windows to create a video from images

opencv might not be a good fit for this, please rather use ffmpeg or gstreamer directly, not a mainly computer-vision orientated library.

berak gravatar imageberak ( 2019-08-26 12:54:55 -0500 )edit