question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`VideoCapture.Open()` is significantly slower on x64 as compared to x86.

See original GitHub issue

Summary of your issue

VideoCapture.Open() is significantly slower on x64 as compared to x86. x64: 5 to 10 seconds x86: 1 to 2 seconds

I noticed this issue was raised but there wasn’t a solution.

Environment

OpenCvSharp-4.5.3-20210821 .NET Framework 4.7.2 Windows 10 64-bit

What did you do when you faced the problem?

I ran the sample project provided (Added a x64 configuration).

  • \Sample-4.5.3-20210821\VideoCaptureForm

Example code:

paste your core code

Output:

paste your output

What did you intend to be?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
bryansiebertcommented, Feb 21, 2022

It seems to be this issue opencv/opencv#17687 Adding Environment.SetEnvironmentVariable("OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS", "0"); will fix it. Using VideoCapturesAPIs.DSHOW also works but it gave me a much choppier stream

1reaction
Timocopcommented, Nov 10, 2021

What Capture API do you use? You haven’t posted any sample code to reproduce. But i also noticed that - when getting webcam streams - camera.Set(OpenCvSharp.VideoCaptureProperties.FourCC, OpenCvSharp.VideoWriter.FourCC("MJPG")) and VideoCaptureAPIs.MSMF takes a very long time to load (10 seconds) compared to VideoCapturesAPIs.DSHOW which loads instantly. Set the Capture API manually, instead of VideoCaptureAPIs.ANY. This will also remove weird webcam artifacts!

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenCV real time streaming video capture is slow. How to ...
A simple solution is decrease the resolution of videos before of reading. Another solution is create an second thread to only video acquisition....
Read more >
Does 32bits Windows run slower on a 64bit CPU?
No, and it will run faster than an Windows x64 bit OS. Mostly all CPUs released in the past few years are 64...
Read more >
Slow frame read from webcam - C++
Hi, As per the title, I'm seeing very slow frame reads from webcam. At a resolution at which it can output 120FPS, I'm...
Read more >
[RELEASED] OpenCV for Unity
Compatible with multiple platforms, allowing for app development on major platforms. iOS & Android & Windows10 UWP support.
Read more >
Is there something wrong with this PC, besides the obvious?
I've contacted cleverbridge about this already. It's an E6400 with some Windows 7 64-bit goofiness for an OS. There's a free version of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found