Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Programming Environment
jdk1.8 IDEA opencv4.1.0
Problem Description
Open the video failed isOpen () returns false
problem causes
opencv reads the video file and need ffmpeg associated, not directly into opencv
problem solved
- Copy all files opencv / build / bin directory to opencv / build / java / x64 folder (x64-bit system is provided, it is copied to the 32-bit x32)
- Open IDEA project has been built in, then click on File >> Project Structure >> Modules >> Dependencies and click the + next, click Jars or Directories, select opencv / build / java jar file folder, click ok
- The most critical step, configure the operating environment, we want to opencv jar package and ffmpeg link
Click run >> Edit Configurations, add the following sentence in the VM opentions (corresponding to your own path)
-Djava.library. path = F: \ opencv \ opencv \ build \ java \ x64
- Click ok, we're done, then you can read the opencv avi video format of the