Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Opencv cvCaptureFromFile reads video question summary

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Unable to read the file

Error report:

OpenCV error:

Warning: Error opening file (.. /.. / modules/highgui/src/cap_ffmpeg_impl.hpp:529)

Capture device failed to open!

Solution: change the path of the input video file and make sure it is correct and then run successfully.

II.

Previously, desktop win7 x64-bit systems have been used for graphics processing, and it has always been normal to call opencv library functions; however, recently, when using notebook processing, it is always impossible to read cvCaptureFromFile video files.

1. The cause of the problem

(1) there may be a problem with the read file directory, and the corresponding video file cannot be found, resulting in the return of NULL

(2) there is a problem with the read video file, which is not a real video file.

(3) missing decoding

Because I came from the desktop copy project, the first two situations are basically not valid; due to system differences, I still tested the use of'/'or'\'in the path, indirect path to direct path and so on, but still did not solve.

2. Solution

Through a series of tests, I finally locked in question 3 and retrieved the relevant problem solution.

(1) partial solution: download xvid and install it, https://www.xvid.com/download/.

(2) another way is to download the K-Lite_Codec_Pack software installation, which contains the required decoding interface.

However, neither of these two methods solved my existing problems. At first, I thought that apart from the problem of setting, whether the environment variables were not set correctly, and installing the above software did not need to be configured, but I always felt very troublesome, so I calmed down and thought about it from the beginning. I always felt that opencv design should not have such a strong dependency flaw, so I wondered if there was a lack of components. Because the compilation passed and the program could run, I thought there would be no problem with the configuration, but I still looked at the relevant dll.

(3) lack of opencv_ffmpeg2410.dll, add opencv_ffmpeg2410.dll to the project root folder or debug.

III. Dll file configuration

We often encounter a problem when using vs for development and debugging, that is, when our main project refers to the updated dll of other projects (we often use the method of copy to the project directory), or when our multiple projects refer to the same dll file, how do we configure:

1. Configure dll to the environment variable:

Of course, this method is feasible, but when the location of our project changes, the environmental variables need to be reconfigured, and changing the environmental variables for a single small project seems to make a mountain out of a molehill, but it is also a way.

2. Localization configuration of the project:

The goal of localizing the configuration of a single project can be achieved by setting the environment variable of the vs project. The environment variable can be migrated with the entire project. The setting method is: vs project properties-> configuration properties-- > debugging-- > environment. For example, if we want to reference the dll in the.. /.. / bin/ directory, we can set it to: path=%path%;..\..\ bin, as shown in the figure:

4. Unable to find or open PDB file problem description "Win32Project3.exe" (Win32): "D:\ software\ VS2013\ VS2013 document\ Win32Project3\ Debug\ Win32Project3.exe" has been loaded. Symbols loaded. "Win32Project3.exe" (Win32): "C:\ Windows\ SysWOW64\ ntdll.dll" has been loaded. Unable to find or open the PDB file. "Win32Project3.exe" (Win32): "C:\ Windows\ SysWOW64\ kernel32.dll" is loaded. Symbols loaded. "Win32Project3.exe" (Win32): "C:\ Windows\ SysWOW64\ KernelBase.dll" has been loaded. Unable to find or open the PDB file. "Win32Project3.exe" (Win32): "C:\ Windows\ SysWOW64\ msvcr120d.dll" is loaded. The symbol is loaded. The program "[4308] Win32Project3.exe" exited with a return value of 0 (0x0). 123456 123456 solution

1. Point debugging, and then options and settings

2. Enable source server support on the right tick

3. The left dot symbol, check the Microsoft symbol server.

4. Wait a minute at run time, and it will be all right after loading.

5. It's only the first time to load it, so don't worry. Or, you can wait until the load is finished, and then uncheck the previous box, there is no problem.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report