Skip to content

cv::VideoCapture::open() cannot open any video files #18500

@stephanecharette

Description

@stephanecharette

64-bit Ubuntu 20.04. Installed OpenCV like this:

`./vcpkg install --triplet x64-linux opencv[core,dnn,ffmpeg,jpeg,opengl,openmp,png,tiff,webp]`

This gives me OpenCV4 4.3.0#1 (4.3.0-0c6047baf6).

Most of OpenCV is working fine. I'm using it to read/write images, cv::Mat, etc. But when I attempt to use cv::VideoCapture, it fails to open any video file and throws an exception.

I recompiled the app using debug mode so I could see the messages in the console. This code:

cv::VideoCapture input_video;
input_video.setExceptionMode(true);
input_video.open("set_07/2020-10-02-082129.m4v");

Results in the following errors:

[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/videoio_registry.cpp (187) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (342) getPluginCandidates VideoIO pluigin (FFMPEG): glob is 'libopencv_videoio_ffmpeg*.so', 1 location(s)
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (349) getPluginCandidates     - /home/stephane/src/DarkHelp/build/src-tool: 0
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (353) getPluginCandidates Found 0 plugin(s) for FFMPEG
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (342) getPluginCandidates VideoIO pluigin (GSTREAMER): glob is 'libopencv_videoio_gstreamer*.so', 1 location(s)
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (349) getPluginCandidates     - /home/stephane/src/DarkHelp/build/src-tool: 0
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (353) getPluginCandidates Found 0 plugin(s) for GSTREAMER
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (342) getPluginCandidates VideoIO pluigin (INTEL_MFX): glob is 'libopencv_videoio_intel_mfx*.so', 1 location(s)
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (349) getPluginCandidates     - /home/stephane/src/DarkHelp/build/src-tool: 0
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/backend_plugin.cpp (353) getPluginCandidates Found 0 plugin(s) for INTEL_MFX
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/cap_images.cpp (282) icvExtractPattern Pattern: set_07/%04d-10-02-082129.m4v @ 2020
[ INFO:0] global /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/cap_images.cpp (313) open CAP_IMAGES: Stop scanning. Can't read image file: set_07/2020-10-02-082129.m4v
OpenCV(4.3.0) Error: Unspecified error (could not open 'set_07/2020-10-02-082129.m4v') in open, file /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/cap.cpp, line 177
Caught exception: OpenCV(4.3.0) /home/stephane/src/vcpkg/buildtrees/opencv4/src/4.3.0-0c6047baf6.clean/modules/videoio/src/cap.cpp:177: error: (-2:Unspecified error) could not open 'set_07/2020-10-02-082129.m4v' in function 'open'

How can I get more information on why this is failing, or what I need to do so OpenCV can find whatever plugins it is expecting to find?

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidquestion (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions