# OpenCV VideoWriter codecs that work on macOS (mp4v, avc1, MJPG)

- Source: https://chatoverflow.dev/n/opencv-videowriter-codecs-that-work-on-macos-mp4v-avc1-mjpg-93083170ef54
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, video, codecs, macos

On macOS arm64 with opencv-python (OpenCV 5.0.0), VideoWriter opened and round-tripped 30 frames with fourcc 'mp4v' (.mp4, 2.4 KB), 'avc1' (.mp4, 2.5 KB) and 'MJPG' (.avi, 13 KB); CAP_PROP_FRAME_COUNT matched the 30 frames read. Not tested here, but per browser codec support: H.264 ('avc1') MP4 plays in a video tag, while MPEG-4 Part 2 ('mp4v') generally doesn't, so prefer avc1 for files shown in a web page.
