Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Now I tried Hauppauge USB-Live 2 which unfortunately didnt work with cv::VideoCapture out of the box (it is found as a device but doesnt give images).

Successfully accessed it with VLC (DSHOW - use configuration dialog given by the driver) and with DirectShow GraphstudioNext, but one thing has to be taken care of: 1. Create the Crossbar object and route the pins correcly. 2. CONNECT the Crossbar Video Decoder Out to the Analog Video In of the Video Capture Filter.

Since it worked with Graphstudio, I hoped it to work with VideoInput Library, too (later seen that OpenCV uses VideoInput itself), but same as OpenCVs VideoCapture, the device is found but doesnt provide any images. Finally I found out, that VideoInput Library creates the crossbar and routes the PINs, but it doesn't insert the crossbar in the filter graph! I guess that's because in many/most/some drivers/devices, the crossbar isn't connect to the filter at all. But some Filters really need the Crossbar to be connected (like my Hauppauge USB capture dongle)!

My next steps will be to change code in OpenCVs cap_dshow.cpp file to connect the crossbar if possible/necessary.

Now I tried Hauppauge USB-Live 2 which unfortunately didnt work with cv::VideoCapture out of the box (it is found as a device but doesnt give images).

Successfully accessed it with VLC (DSHOW - use configuration dialog given by the driver) and with DirectShow GraphstudioNext, but one thing has to be taken care of: 1. Create the Crossbar object and route the pins correcly. 2. CONNECT the Crossbar Video Decoder Out to the Analog Video In of the Video Capture Filter.

Since it worked with Graphstudio, I hoped it to work with VideoInput Library, too (later seen that OpenCV uses VideoInput itself), but same as OpenCVs VideoCapture, the device is found but doesnt provide any images. Finally I found out, that VideoInput Library creates the crossbar and routes the PINs, but it doesn't insert the crossbar in the filter graph! I guess that's because in many/most/some drivers/devices, the crossbar isn't connect to the filter at all. But some Filters really need the Crossbar to be connected (like my Hauppauge USB capture dongle)!

My next steps will be to change code in OpenCVs cap_dshow.cpp file to connect the crossbar if possible/necessary.

EDIT: I found that it wasnt related to connecting the crossbar but that there is a line in VideoInput: hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter); which doesnt work for that device. hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter); works instead!!

Now I tried Hauppauge USB-Live 2 which unfortunately didnt work with cv::VideoCapture out of the box (it is found as a device but doesnt give images).

Successfully accessed it with VLC (DSHOW - use configuration dialog given by the driver) and with DirectShow GraphstudioNext, but one thing has to be taken care of: 1. Create the Crossbar object and route the pins correcly. 2. CONNECT the Crossbar Video Decoder Out to the Analog Video In of the Video Capture Filter.

Since it worked with Graphstudio, I hoped it to work with VideoInput Library, too (later seen that OpenCV uses VideoInput itself), but same as OpenCVs VideoCapture, the device is found but doesnt provide any images. Finally I found out, that VideoInput Library creates the crossbar and routes the PINs, but it doesn't insert the crossbar in the filter graph! I guess that's because in many/most/some drivers/devices, the crossbar isn't connect to the filter at all. But some Filters really need the Crossbar to be connected (like my Hauppauge USB capture dongle)!

My next steps will be to change code in OpenCVs cap_dshow.cpp file to connect the crossbar if possible/necessary.


EDIT: I found that it wasnt related to connecting the crossbar but that there is a line in VideoInput: hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter); which doesnt work for that device. hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter); works instead!!

or use CAPTURE_MODE instead, which is PIN_CATEGORY_PREVIEW if possible or PIN_CATEGORY_CAPTURE otherwise: pCaptureGraph->RenderStream(&CAPTURE_MODE, ...);