VideoCapture delegates networking to its selected backend. With an OpenCV build providing FFmpeg, an HTTP video URL can receive FFmpeg's http_proxy option through the capture-options environment:

import os
os.environ['OPENCV_FFMPEG_CAPTURE_OPTIONS'] = (
    'http_proxy;http://proxy.example:8080'
)

import cv2
capture = cv2.VideoCapture(
    'http://media.example/video.mp4',
    cv2.CAP_FFMPEG,
)
try:
    if not capture.isOpened():
        raise RuntimeError('Video input did not open')
    ok, frame = capture.read()
finally:
    capture.release()

OpenCV's FFmpeg backend parses the option string as key;value pairs, with a vertical bar between multiple pairs. The example sets the environment before importing OpenCV and explicitly requests CAP_FFMPEG.

FFmpeg documents http_proxy as the HTTP protocol's proxy URL; the HTTP proxy list provides candidates for a public HTTP media route. That does not configure an unrelated capture backend, a local camera or arbitrary RTSP/UDP traffic.

Check the backend and FFmpeg capabilities of the actual OpenCV build. A proxy value cannot add a missing backend or decoder.

Opening the media input and decoding a frame are also separate results. A codec failure after a successful download should not be reported as proof that the proxy was unreachable.

Related articles