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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV Wrapper Bug: Zero Frame Rate and Count with Special Characters in Filename #1633

Open
interiv opened this issue Dec 19, 2023 · 0 comments

Comments

@interiv
Copy link

interiv commented Dec 19, 2023

Summary of your issue

Encountering a bug in OpenCV wrapper where special characters in filenames (like the 馃敟 emoji) result in frame rate and frame count being returned as 0.

Environment

win11, last opencvsharp version

What did you do when you faced the problem?

Attempted to open and process a video file with a filename containing special characters (e.g., emojis).

Example code:

using (var videoCapture = new VideoCapture())
{
    videoCapture.Open(mediaFile); // Replace with your file path

    Mat mat = new Mat();
    videoCapture.Read(mat);

    double frameCount = videoCapture.Get(VideoCaptureProperties.FrameCount);
    double frameRate = videoCapture.Get(VideoCaptureProperties.Fps);
    double duration = frameCount / frameRate;
    if (frameCount == 1)
    {
        duration = 10800; // For images
    }
    return duration;
}

Output:

Frame Rate: 0
Frame Count: 0

What did you intend to be?

Expected the correct frame rate and frame count, irrespective of special characters in the filename. Currently, it seems that special characters cause these values to be incorrectly returned as 0.

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

1 participant