Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not open file by videoio::VideoCapture::from_file when chinese characters in filename on Windows 10 #544

Open
ayang opened this issue Feb 11, 2024 · 2 comments

Comments

@ayang
Copy link

ayang commented Feb 11, 2024

  1. Operating system Windows 10
  2. I installed Opencv by vcpkg
  3. OpenCV version 4.8.0
  4. rustc version rustc 1.75.0 (82e1608df 2023-12-21)
let mut cap = videoio::VideoCapture::from_file("d:\\中文文件名.mp4", videoio::CAP_ANY)?;
let opened = videoio::VideoCapture::is_opened(&cap)?; 

Then the opened == false

The codes can be compiled, but can't open the file, if I change the filename to an english name, it will be ok.
I guess it's an encoding problem.

@twistedfall
Copy link
Owner

This can happen if your filesystem encoding is not utf-8. I'm going to try to investigate this, maybe there is a solution for this. Thanks for reporting!

@hengkx
Copy link

hengkx commented May 1, 2024

imgcodecs::imread win11 same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants