I am currently using opencv in python to write a video with compression. Here are some parts of the code that are giving errors.
fourcc=cv2.VideoWriter_fourcc(*'X264')
video = cv2.VideoWriter(outfiles[c],fourcc, fps, (width,height))
The error is
OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and form at 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x00000021/'!???' Working on file test_videos/solidYellowLeft.mp4 OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and form at 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x00000021/'!???'
I have downloaded the openh264-1.6.0-win64msvc.dll file for the newer versions of H264 encoding. I've tried different types, H264, X264, XVID, VIDX, not using MJPG because it produces a large file. Setting the 5th option in VideoWriter to False (making it single channel) didn't work either. If you have a suggestion on how to fix this or to try an alternative method, that would help greatly.. If you need any more information, let me know.
cv2.VideoWriter
uses the FFMPEG API for video encoding, so your copy of FFMPEG must be built with libx264 support. – zindarod