# Real-time video capture from CMOS High Speed camera

**URL:** <https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231>\
**Category:** Python\
**Created:** [January 22, 2022, 6:30am UTC](https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231 "2022-01-22T06:30:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![school15](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@school15](https://forum.opencv.org/u/school15)\
**Post date:** [January 22, 2022, 6:30am UTC](https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231/1 "2022-01-22T06:30:46Z")

</div>

Hello, I want to get real-time video from high-speed camera or microscope camera connected to my PC. When I type 0 1 2 into videoCapture(), it doesn’t see the camera. How can I process the video viewed from this camera in real-time?

My camera is [ORCA-Flash4.0 LT+ Digital CMOS camera C11440-42U30 | Hamamatsu Photonics](https://www.hamamatsu.com/jp/en/product/type/C11440-42U30/index.html)

---

<div class="post-metadata">

**Author:** ![kbarni](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/kbarni/32/26_2.png) [@kbarni](https://forum.opencv.org/u/kbarni)\
**Post date:** [January 22, 2022, 10:37am UTC](https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231/2 "2022-01-22T10:37:16Z")

</div>

As a general rule, especially for industrial cameras, try to use the provided [API/SDK](https://dcam-api.com/). They offer full control over the camera, to be able to use them with full potential. The VideoCapture class is really basic, and it doesn’t support specialized cameras.  
The API allows to capture to a memory buffer, that you can transform to OpenCV Mat. Something like (pseudocode):

```auto
int w,h;
uchar *buffer;
Camera cam;
cam.getResolution(w,h);
cam.start();
while(true){
    cam.capture(buffer);
    cv::Mat frame(h,w,CV_8U,buffer);
    //...processing part...
}

```

Note: it seems that the DCAM-API is only available for Windows/Mac and C++ language.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 22, 2022, 11:46am UTC](https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231/3 "2022-01-22T11:46:25Z")

</div>

> [@kbarni](#):
>
> The VideoCapture class is really basic, and it doesn’t support specialized cameras.

well yes and no.

the VideoCapture class _is_ basic but only in the lack of flexibility. OpenCV has a ton of backends for common and uncommon APIs. [_all of those_](https://docs.opencv.org/4.x/d4/d15/group __videoio__ flags__base.html#ga023786be1ee68a9105bf2e48c700294d) are supported (ok, some were removed, some unmaintained/obsolete, some may not be built by default).

if the manufacturer doesn’t bother to give their device a standard interface like USB UVC, which is supported by all operating systems, that’s their fault and you’re stuck with their SDK, that is _maybe_ supported by OpenCV already, or else you’d have to write some code to adapt.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 23, 2022, 10:38am UTC](https://forum.opencv.org/t/real-time-video-capture-from-cmos-high-speed-camera/7231/4 "2022-01-23T10:38:56Z")

</div>

related:

> <https://stackoverflow.com/questions/70820711/videocapture-with-high-speed-camera>
