#841·ImageAI

__init__.py error

Author: asapbgCreated Jul 14, 2024Updated Jul 14, 2024

Hello,

There is a bug on line 678 of __init__py.

output_video = cv2.VideoWriter(output_video_filepath, cv2.VideoWriter_fourcc(*"MP4V"), frames_per_second, (frame_width, frame_height))

Should be

output_video = cv2.VideoWriter(output_video_filepath, cv2.VideoWriter_fourcc(*"mp4v"), frames_per_second, (frame_width, frame_height))

Note the case of mp4v. Without the fix, it produces a warning:

OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'

I hope it will be patched in the next version.