Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Providing Openh264 file on Windows and MacOS works but linux doesn't

Open
#650 3 comments 0 reactions 1 assignee View on GitHub

@asenyaev is already working on this.

Since Apr 7, 2022.

Assessment

This issue has not been assessed yet.

Description

Expected behaviour

Writing to VideoWriter with fourcc avc1 while providing a openh264 file should be able to use the file on Linux and output via h264

Providing openh264-1.8.0-win64.dll on Windows allows this without issue
Providing libopenh264-1.8.0-osx64.4.dylib on MacOS allows this without issue
Providing libopenh264-1.8.0-linux64.4.so on Linux provides the error below

Related: #100

Actual behaviour

[ERROR:0@11.944] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2767) open Could not find encoder for codec_id=27, error: Encoder not found
[ERROR:0@11.944] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter

Steps to reproduce
import cv2
video_out = cv2.VideoWriter('test.mp4', cv2.VideoWriter_fourcc(*'avc1'), 25.0, (640, 480))

5.16.0-kali1-amd64
OpenCV 4.5.5 installed via Pip

Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opencv/opencv-python

All issues in opencv/opencv-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.