This is an error when trying to export an mp4 format video with python's opencv-python.
Could not find encoder for codec id 27: Encoder not found
video_FourCC = int(vid.get(cv2.CAP_PROP_FOURCC))
output_path = "test.mp4"
out = cv2.VideoWriter(output_path, video_FourCC, video_fps, video_size
The cause was that the format of video_FourCC was not good. It seems that there is an error when output_path is in mp4 format.
video_FourCC = cv2.VideoWriter_fourcc(*"mp4v")
output_path = "test.mp4"
out = cv2.VideoWriter(output_path, video_FourCC, video_fps, video_size
Rewriting video_FourCC as above will work correctly.
Recommended Posts