Videocapture Always Returns False In Python Opencv [linux]
Solution 1:
For future reference: installing opencv with pip does not work with ffmpeg.
From the opencv-python FAQ:
Q: Why I can’t open video files on GNU/Linux distribution X or on macOS?
A: OpenCV video I/O depends heavily on FFmpeg. Manylinux and macOS OpenCV binaries are not compiled against it. The purpose of these packages is to provide as easy as possible installation experience for OpenCV Python bindings and they should work directly out-of-the-box. Adding FFmpeg as an additional dependency without a “universal” FFmpeg build (e.g. LGPL licensed build like in the Windows wheels) the goal is considerably harder to achieve. This might change in the future.
Solutions:
- Build from source (docs). This worked for me.
- Use scikit-video as a workaround (Github).
Solution 2:
The problem was at my IDE (Visual Studio Code) and the association with bin files when installing OpenCV... my bad. This guide worked flawlessly.
Post a Comment for "Videocapture Always Returns False In Python Opencv [linux]"