I'm having major issues with setting up h/w accelerated video capture on Windows 10. Would appreciate any and all help and advice.

asked 2020-10-03 08:13:01 -0600

Normally I would switch to Linux, but due to the nature of the application I have no choice but to work with Win10.

Currently, the only backend that I managed to make work was DirectShow. While it does work, it's not something I can actually use, because it's entirely CPU-driven and due to me using 4 cameras running at 48FPS it grinds the application to a halt.

So far I've tried using:

  • ffmpeg
  • MSMF
  • Intel MFX
  • OpenCV MJPEG (I'm not entirely sure if it's hw accelerated but I tried it anyway)

None of the above actually manage to open the camera, and end up resulting in an empty (0 cols, 0 rows) frame being retrieved.

I've yet to try CUDA because I cannot install it on my system without wiping my OS - I tried multiple versions and different installers and every single time the CUDA SDK fails to install without giving me an actual reason.

I'm including the specifications of the camera:

Model ELP-USBFHD08S
Sensor OV4689
Lens Size 1/3 inch
Pixel Size 2.0µm X 2.0µm
image area 5440 µm x 3072 µm
Max. Resolution 1280(H)X720(V)
Compression format MJPEG / YUV2(YUYV)
Resolution & frame 1920X1080 MJPEG@ 60fps
1280X720 MJPEG@ 120fps
640X360MJPEG@ 260fps
Mini illumination 0. 1lux

And my OpenCV build info:

General configuration for OpenCV 4.1.1 =====================================
  Version control:               4.1.1

  Platform:
    Timestamp:                   2019-07-26T03:48:44Z
    Host:                        Windows 10.0.18362 AMD64
    CMake:                       3.14.4
    CMake generator:             Visual Studio 15 2017
    CMake build tool:            C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe
    MSVC:                        1916

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (13 files):         + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (27 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (2 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe  (ver 19.16.27030.1)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP8   /MD /O2 /Ob2 /DNDEBUG 
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP8   /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:precise       /MP8    /MD /O2 /Ob2 /DNDEBUG 
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3 ...
(more)
edit retag flag offensive close merge delete

Comments

If ffmpeg doesn't work then neither will cudacodec as this uses ffmpeg behind the scenes.

I take it these are not network camera's and they are attached directly to the machine by usb, firewire etc.?

cudawarped gravatar imagecudawarped ( 2020-10-04 07:00:44 -0600 )edit

Yeah! It's a USB camera.

candleboy_ gravatar imagecandleboy_ ( 2020-10-04 12:15:09 -0600 )edit