codex - 💡(How to fix) Fix macOS camera access fails in Codex app terminal but works in Terminal.app [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17361Fetched 2026-04-11 06:16:57
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Error Message

[ WARN:[email protected]] global cap.cpp:480 open VIDEOIO(AVFOUNDATION): backend is generally available but can't be used to capture by index

Code Example

ffplay -f avfoundation -framerate 30 -video_size 1280x720 -i "0"

---

OpenCV version: 4.12.0
OpenCV: not authorized to capture video (status 0), requesting...
OpenCV: camera failed to properly initialize!
[ WARN:0@0.146] global cap.cpp:480 open VIDEOIO(AVFOUNDATION): backend is generally available but can't be used to capture by index
isOpened: False
Failed to open camera

---

python3 - <<'PY'
import cv2
import sys

print("OpenCV version:", cv2.__version__)
cap = cv2.VideoCapture(0, cv2.CAP_AVFOUNDATION)
print("isOpened:", cap.isOpened())

if not cap.isOpened():
    print("Failed to open camera")
    sys.exit(1)

ret, frame = cap.read()
print("first read ret:", ret)
if ret:
    print("frame shape:", frame.shape)

while True:
    ret, frame = cap.read()
    if not ret:
        print("read failed")
        break
    cv2.imshow("codex-opencv-camera-test", frame)
    key = cv2.waitKey(1) & 0xFF
    if key in (27, ord('q')):
        break

cap.release()
cv2.destroyAllWindows()
PY

---

APP="/Applications/Codex.app"
defaults read "$APP/Contents/Info" NSCameraUsageDescription

---

sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
"select service,client,auth_value,last_modified from access where client='com.openai.codex' and service='kTCCServiceCamera';"
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.406.31014 (1395)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

On macOS Sequoia 15.6.1, camera access works in a normal Terminal session, but fails inside the Codex app's built-in terminal.

In a normal macOS terminal (zsh), this works and shows live video correctly:

ffplay -f avfoundation -framerate 30 -video_size 1280x720 -i "0"

but inside the Codex app terminal, OpenCV fails to open the same camera device. The output is:

OpenCV version: 4.12.0
OpenCV: not authorized to capture video (status 0), requesting...
OpenCV: camera failed to properly initialize!
[ WARN:[email protected]] global cap.cpp:480 open VIDEOIO(AVFOUNDATION): backend is generally available but can't be used to capture by index
isOpened: False
Failed to open camera

The app can appear to invoke the camera path, and macOS may show the green camera indicator in the menu bar, but the preview is black and camera access from the built-in terminal is not actually authorized.

<img width="592" height="602" alt="Image" src="https://github.com/user-attachments/assets/f8026045-38d0-44fc-b95b-b4fd03298158" />

What steps can reproduce the bug?

  1. Use Codex app on macOS Sequoia 15.6.1.
  2. Open the built-in terminal in the Codex app.
  3. Run Python + OpenCV with AVFoundation, for example:
python3 - <<'PY'
import cv2
import sys

print("OpenCV version:", cv2.__version__)
cap = cv2.VideoCapture(0, cv2.CAP_AVFOUNDATION)
print("isOpened:", cap.isOpened())

if not cap.isOpened():
    print("Failed to open camera")
    sys.exit(1)

ret, frame = cap.read()
print("first read ret:", ret)
if ret:
    print("frame shape:", frame.shape)

while True:
    ret, frame = cap.read()
    if not ret:
        print("read failed")
        break
    cv2.imshow("codex-opencv-camera-test", frame)
    key = cv2.waitKey(1) & 0xFF
    if key in (27, ord('q')):
        break

cap.release()
cv2.destroyAllWindows()
PY
  1. Observe that camera access fails with not authorized to capture video.
  2. Compare with the same machine in normal Terminal, where ffplay -f avfoundation ... works correctly.

What is the expected behavior?

Camera access initiated from the Codex app terminal should follow the normal macOS camera authorization flow and work the same way as it does in a regular Terminal session.

If the app declares camera usage and the terminal inside the app can run local processes, then AVFoundation / OpenCV / ffmpeg-based camera access should either: • prompt for camera permission correctly, or • already work if permission has been granted.

Additional information

Environment: • macOS Sequoia 15.6.1 • Codex App: Version 26.406.31014 (1395)

What I verified: 1. The app bundle has NSCameraUsageDescription:

APP="/Applications/Codex.app"
defaults read "$APP/Contents/Info" NSCameraUsageDescription

output is "This app needs access to the camera"

  1. Codex does not appear under:

• System Settings > Privacy & Security > Camera

  1. TCC database has no camera authorization entry for com.openai.codex:
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
"select service,client,auth_value,last_modified from access where client='com.openai.codex' and service='kTCCServiceCamera';"

This returns no rows.

  1. TCC does contain other entries for com.openai.codex, so the bundle is recognized by TCC. Example services present included:

    • kTCCServiceMediaLibrary • kTCCServiceAppleEvents • kTCCServiceFileProviderDomain • kTCCServiceSystemPolicyDocumentsFolder

extent analysis

TL;DR

The issue is likely due to the Codex app's built-in terminal not properly handling camera authorization, and a workaround may involve modifying the app's configuration or using an external terminal.

Guidance

  • The error message "not authorized to capture video" suggests a permissions issue, and the fact that the camera works in a normal Terminal session but not in the Codex app's terminal implies a problem with how the app handles camera authorization.
  • Verify that the Codex app has the correct permissions and configuration to access the camera by checking the app's Info.plist file for the NSCameraUsageDescription key.
  • Try running the OpenCV script in an external terminal instead of the Codex app's built-in terminal to see if the issue is specific to the app's terminal.
  • Check the System Settings > Privacy & Security > Camera settings to ensure that the Codex app is listed and has the correct permissions.

Example

No code example is provided as the issue seems to be related to the app's configuration and permissions rather than a code-specific problem.

Notes

The issue may be related to the fact that the Codex app is not recognized by the TCC database as having camera authorization, despite having the correct NSCameraUsageDescription key in its Info.plist file. Further investigation into the app's configuration and permissions may be necessary to resolve the issue.

Recommendation

Apply a workaround by using an external terminal to run the OpenCV script, as this has been shown to work correctly in the normal Terminal session. This will allow the user to access the camera while the issue with the Codex app's built-in terminal is investigated and resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING