I have been unable to write an uncorrupted video file using:
fourcc = cv2.VideoWriter_fourcc(*'DIVX')
writer = cv2.VideoWriter(out.avi, fourcc, 30, (width, height), True)
I get a file but it is corrupted. If I try to use ‘MJPG’ or ‘MPV4’ with a mp4 extension I get unsupported codec error. Is there any workable fourcc setting and output for opencv 4.4.0+
Supra
January 28, 2021, 2:38pm
2
Change this:
writer = cv2.VideoWriter(out.avi, fourcc, 30, (width, height), True)
to:
writer = cv2.VideoWriter(out.avi, fourcc, 30, (width, height))
Link: FOURCC
welcome.
please print(cv2.getBuildInformation())
and report this back to us.
Thanks Christoph,
reporting back, command worked fine…built from git/bin to get what I needed. Best.
Supra
January 31, 2021, 2:01pm
6
You are welcome, Markworth .