Skip to content

Bug: AV1/HEVC/VP9 videos cannot be opened — OpenCV's bundled ffmpeg doesn't support these codecs #459

Description

@minh-vt

Severity: High (app is unusable for these formats)

Description

Opening a video encoded with AV1, HEVC/H.265, or VP9 fails immediately:

[ERROR:0] global cap_ffmpeg_impl.hpp:1309 open
Could not open codec av1, error: -1163346256

The app shows "Failed to open video: {}, incompatible format or file is corrupted" and cannot proceed.

Root cause

opencv-python is compiled with a minimal FFmpeg that omits AV1, HEVC, and VP9 decoders to keep binary size small. The Python code uses cv2.VideoCapture(path) in three places, none of which have a fallback.

The existing "Video Decoder" setting in Settings only controls the VideoSubFinder CLI's --open_video_opencv vs --open_video_ffmpeg flag — it has no effect on OpenCV's Python VideoCapture.

Workaround

Re-encode the video to H.264 before opening:

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac output_h264.mp4

Fix

PR feat/ffmpeg-fallback-reader adds FFmpegReader — a drop-in replacement for cv2.VideoCapture that reads frames via system ffmpeg pipe. It supports all codecs the system ffmpeg supports (including AV1, HEVC, VP9). All three cv2.VideoCapture call sites auto-fallback when OpenCV fails.
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions