RenderStream Return E_FAIL when using opencv to open a usb camere in win10

凯辉 穆 6 Reputation points
2022-05-19T03:50:29.473+00:00

We use opencv to capture camera. In most computer it can open the usb camera correctly. But for a few of computer it can not open the camera. We debug the code and find the error is at :
hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter);

Then, we thought that could be the problem of OS, so we repair the system using DISM and SFC to repair the os. We also use several tools to check and repair the directshow and codec in the systems. But it still does not work.

Then we use GraphEdt to simulate the RenderStream, BUT we can not list the directshow filters list when Inserting filters. And the GraphEdt will close instantly.

In some other computer We can list directshow filters using GraphEdt, but we can not run the RenderStream correctly.

So,now we encounter two questions:

  1. Why do we open camere using opencv correctly, which is failed at RenderStream? how could we to debug this question? Does it relate to directshow error or codec error?
  2. Why does the GraphEdt close instantly when listing the directshow filters list?
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,420 questions
{count} vote