# OpenCV: FFMPEG: tag 0x3234504d/'MP42' is not supported with codec id 12

- **ID:** `opencv/videowriter-codec-not-supported-linux`
- **Domain:** opencv
- **Category:** encoding_error
- **Verification:** ai_generated
- **Fix Rate:** 70%

## Root Cause

The specified video codec (MP42) is not supported by the FFMPEG backend on the current system, often due to missing codec libraries or incompatible FFMPEG build.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.5.0 | active | — | — |
| 4.6.0 | active | — | — |
| 4.7.0 | active | — | — |
| 4.8.0 | active | — | — |
| 4.9.0 | active | — | — |

## Workarounds

1. **Use a widely supported codec like 'avc1' or 'H264' with FFMPEG: `fourcc = cv2.VideoWriter_fourcc(*'avc1')` and verify with `cv2.VideoWriter.isOpened()`.** (75% success)
   ```
   Use a widely supported codec like 'avc1' or 'H264' with FFMPEG: `fourcc = cv2.VideoWriter_fourcc(*'avc1')` and verify with `cv2.VideoWriter.isOpened()`.
   ```
2. **Install the necessary codec libraries: `sudo apt-get install libavcodec-extra` on Ubuntu/Debian or `brew install ffmpeg` on macOS.** (80% success)
   ```
   Install the necessary codec libraries: `sudo apt-get install libavcodec-extra` on Ubuntu/Debian or `brew install ffmpeg` on macOS.
   ```
3. **Fall back to a raw video codec like 'I420' (uncompressed) for debugging: `fourcc = cv2.VideoWriter_fourcc(*'I420')`.** (70% success)
   ```
   Fall back to a raw video codec like 'I420' (uncompressed) for debugging: `fourcc = cv2.VideoWriter_fourcc(*'I420')`.
   ```

## Dead Ends

- **** — The codec is still MP42, which may not be supported regardless of container format. (75% fail)
- **** — Without FFMPEG, OpenCV uses a different backend (e.g., VFW on Windows) which may have its own limitations. (85% fail)
- **** — XVID might also be unsupported if the codec is not installed; the fix is to use a codec known to work on the system. (65% fail)
