fix(cv): restore FFmpeg-enabled OpenCV so RTSP camera capture works#41
Merged
Conversation
pump-cv could not open any RTSP camera — every cv2.VideoCapture failed instantly (sub-millisecond, before touching the network) with "cannot open source". Root cause: the nvcr.io/nvidia/pytorch base ships its own OpenCV (pip package `opencv` 4.10, built FFMPEG: NO) which shadows the opencv-python wheel from pyproject deps; the imported cv2 had no FFmpeg or GStreamer backend, so it cannot speak RTSP at all. Confirmed in-pod: cv2.getBuildInformation() showed FFMPEG: NO / avcodec: NO, while TCP :554 to both cameras was open (1-3ms) — i.e. network, creds, and routing were all fine; only the codec backend was missing. A temp install of the opencv-python wheel reported FFMPEG: YES. Fix: after the dependency install, uninstall the base's OpenCV and force-reinstall the opencv-python wheel (FFMPEG: YES), then assert the FFmpeg backend is present at build time so a future base bump can't silently reintroduce the regression. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
pump-cv never connected to the gym cameras — every
cv2.VideoCapturefailed in sub-millisecond time (before any network I/O) withcannot open source. The image's OpenCV has no RTSP backend:The
nvcr.io/nvidia/pytorch:25.04-py3base ships its own OpenCV (pip packageopencv4.10.0, built without FFmpeg) that shadows theopencv-pythonwheel from our deps.import cv2loads the headless 4.10.0, so RTSP can't be opened at all.Everything else was fine (verified in-pod and from a LAN host):
:554to both cameras open from inside the pod (1–3ms)opencv-pythonreportsFFMPEG: YESFix
In
cv/Dockerfile.base, after installing deps: uninstall the base'sopencvand force-reinstall theopencv-pythonwheel (FFmpeg-enabled), then assert the FFmpeg backend is present at build time so a future base bump can't silently regress.Deploy
This changes
cv/Dockerfile.base, so merging triggerscv-base-publish.ymlto rebuild the base image. After that, apump-cv-v0.5.1tag builds the runtime image, then bump the digest in home-ops.🤖 Generated with Claude Code