Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug, macOS, Apple Silicon

オープン
#1,156 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
macos, python

調査の方向性

まず CI/CD の wheel ビルド設定と関連する issue #429、#550、#576 を確認し、次に提供された Python の例で VideoWriter.write() の失敗を再現して、cv2.getBuildInformation() を調べます。Apple Silicon で再現が成功するよう、互換性のある FFmpeg を含む macOS arm64 wheel を公開できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Bug Report: VideoWriter.write() Fails Silently on macOS Apple Silicon

Target: https://github.com/opencv/opencv-python/issues


Environment

  • Hardware: Apple M4 (reproducible on M1/M2/M3)
  • OS: macOS 14.x Sonoma / 15.x Sequoia
  • Architecture: arm64
  • Python: 3.11.x
  • opencv-python: 4.12.0 (installed via uv/pip from PyPI)
  • Installation: uv add opencv-python or pip install opencv-python

Description

cv2.VideoWriter.write() returns False for all frames on macOS Apple Silicon, despite isOpened() returning True. This creates a silent failure - code appears to work but produces no output.

Minimal Reproducible Example

import cv2
import numpy as np

# Create VideoWriter
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
writer = cv2.VideoWriter('test.mp4', fourcc, 30.0, (1920, 1080))

print(f"isOpened: {writer.isOpened()}")  # True ✓

# Write single frame
frame = np.zeros((1080, 1920, 3), dtype=np.uint8)
success = writer.write(frame)

print(f"write() success: {success}")  # False ✗

writer.release()

Output:

isOpened: True
write() success: False

Result: No video file created (or 0 bytes).

Codecs Tested (All Failed)

for codec in ['mp4v', 'avc1', 'XVID']:
    fourcc = cv2.VideoWriter_fourcc(*codec)
    writer = cv2.VideoWriter('test.mp4', fourcc, 30.0, (1920, 1080))
    frame = np.zeros((1080, 1920, 3), dtype=np.uint8)

    result = writer.write(frame) if writer.isOpened() else False
    print(f"{codec}: isOpened={writer.isOpened()}, write={result}")
    writer.release()

Output:

mp4v: isOpened=True, write=False
avc1: isOpened=True, write=False
XVID: isOpened=True, write=False

Root Cause

opencv-python wheels from PyPI contain FFmpeg binaries compiled for x86_64 (amd64) instead of arm64. On Apple Silicon:

  1. FFmpeg runs via Rosetta 2 translation
  2. Encoding operations fail silently
  3. isOpened() succeeds but write() fails

Evidence:

Expected Behavior

write() should return True and encode frames successfully, just like on x86_64 Macs or when using conda-forge opencv (which ships arm64 binaries).

Actual Behavior

write() returns False for every frame, producing no output.

Current Workaround

Using conda-forge instead of PyPI:

conda install -c conda-forge opencv

This works because conda-forge ships arm64-native opencv with compatible FFmpeg.

However:

  • Breaks PyPI-based workflows (pip, uv, poetry)
  • Adds conda dependency (conflicts with uv/pip lock files)
  • Not viable for projects using uv or other modern Python package managers

Proposed Solution

Build and distribute arm64-native wheels for macOS Apple Silicon:

  1. Add macOS arm64 builder to CI/CD (GitHub Actions supports M1 runners)
  2. Compile FFmpeg with --arch=arm64
  3. Publish platform-specific wheel: opencv_python-X.X.X-cp311-cp311-macosx_12_0_arm64.whl

Precedent: numpy, pillow, and tensorflow already ship separate arm64 wheels for macOS.

Impact

Severity: High

Affected users:

  • All macOS Apple Silicon users (M1/M2/M3/M4) installing from PyPI (pip, uv, poetry, etc.)
  • Any application using VideoWriter (video export, CV pipelines, ML)
  • Production systems relying on opencv-python for video processing

Why high severity:

  • Silent failure (no error messages, difficult to debug)
  • Blocks video processing on modern Macs (>50% of new Mac sales)
  • Wastes compute (processing with no output)
  • Affects all PyPI-based package managers (pip, uv, poetry, pipenv)

Related Issues

  • #429 - General arm64 wheel support
  • #550 - M1 native installation
  • #576 - Architecture compatibility errors

This issue is VideoWriter-specific and warrants separate tracking.

System Information

# Verify architecture
$ uname -m
arm64

$ python -c "import platform; print(platform.machine())"
arm64

# OpenCV build info
$ python -c "import cv2; print(cv2.getBuildInformation())" | grep -A 10 "Video I/O"

Willingness to Contribute

I can:

  • Test arm64 wheels when available
  • Provide M4 hardware access for testing
  • Document migration guide for users

Happy to help if maintainers need arm64 CI setup assistance.


Thank you for maintaining opencv-python! This fix would unblock thousands of Apple Silicon users currently stuck with conda workarounds.

主要言語
Python
スター
5.4k
フォーク
1k
平均マージ
22時間 17分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opencv/opencv-python のほかの issue

opencv/opencv-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。