VideoWriter fails silently for multiple codecs on macOS Intel
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- audio-video-rtc
Direzione di ricerca
Inizia eseguendo la riproduzione Python fornita con opencv-python-headless 4.13.0.90 e confrontala con 4.12.0.88 su macOS Intel. Analizza il percorso cv2.VideoWriter e i problemi specifici del codec segnalati; il lavoro è completato quando HFYU, XVID e mp4v si aprono correttamente e creano file video senza introdurre regressioni per MJPG.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
cv2.VideoWriter fails silently for multiple codecs (HFYU, XVID, mp4v) on macOS Intel (x86_64) in opencv-python-headless 4.13.0.90. No exception is raised, but isOpened() returns False and no video file is created.
This is a regression from 4.12.0.88, where all codecs work correctly.
Environment
- OpenCV version: opencv-python-headless 4.13.0.90
- Python version: 3.10.18
- OS: macOS 15.7.2 (x86_64 / Intel)
Note: This bug only affects macOS Intel (x86_64), not macOS ARM (Apple Silicon).
Steps to reproduce
import os
import tempfile
import cv2
import numpy as np
print(f"OpenCV version: {cv2.__version__}")
test_dir = tempfile.mkdtemp()
codecs = ["MJPG", "HFYU", "XVID", "mp4v"]
print("\nTesting VideoWriter codecs:")
print("-" * 40)
for codec in codecs:
video_path = os.path.join(test_dir, f"test_{codec}.avi")
writer = cv2.VideoWriter(
filename=video_path,
fourcc=cv2.VideoWriter_fourcc(*codec),
fps=25,
frameSize=(200, 100),
)
opened = writer.isOpened()
status = "OK" if opened else "FAILED"
if opened:
frame = np.random.randint(0, 255, size=(100, 200, 3), dtype="uint8")
writer.write(frame)
writer.release()
os.remove(video_path)
else:
writer.release()
print(f"{codec:6} : {status}")
os.rmdir(test_dir)
Expected behavior
All standard codecs should work:
OpenCV version: 4.12.0
Testing VideoWriter codecs:
----------------------------------------
MJPG : OK
HFYU : OK
XVID : OK
mp4v : OK
Actual behavior
Only MJPG works; other codecs fail silently:
OpenCV version: 4.13.0
Testing VideoWriter codecs:
----------------------------------------
[ WARN:0@0.056] global cap.cpp:781 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.13.0) /Users/macmini_16g/GHA-Actions-Opencv-Python/_work/opencv-python/opencv-python/opencv/modules/videoio/src/cap_images.cpp:411: error: (-215:Assertion failed) !filename_pattern.empty() in function 'CvVideoWriter_Images'
MJPG : OK
[ WARN:0@0.104] global cap.cpp:781 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.13.0) /Users/macmini_16g/GHA-Actions-Opencv-Python/_work/opencv-python/opencv-python/opencv/modules/videoio/src/cap_images.cpp:411: error: (-215:Assertion failed) !filename_pattern.empty() in function 'CvVideoWriter_Images'
HFYU : FAILED
[ WARN:0@0.104] global cap.cpp:781 open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.13.0) /Users/macmini_16g/GHA-Actions-Opencv-Python/_work/opencv-python/opencv-python/opencv/modules/videoio/src/cap_images.cpp:411: error: (-215:Assertion failed) !filename_pattern.empty() in function 'CvVideoWriter_Images'
XVID : FAILED
mp4v : FAILED
- Lingua principale
- Python
- Stelle
- 5.4k
- Fork
- 1k
- Merge medio
- 22h 17m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opencv/opencv-python
-
[DOC] README file Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
opencv/opencv-python#1217 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opencv/opencv-python#1165 · 2 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
opencv/opencv-python#1273 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
opencv/opencv-python#1272 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
opencv/opencv-python#1268 · 1 commento ·
Tutte le issue di opencv/opencv-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
please add to porn list Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
StevenBlack/hosts#3255 ·