From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set frame rates of DirectShow video devices?

Hi Stefan,

 

I think it is because this is a webcam and always wants to run at the fastest rate. In IMAQdx we do iterate over the listed framerates and so I expect that this particular camera was only listing one per each resolution/format.


Eric

0 Kudos
Message 11 of 16
(2,169 Views)
Eric This is fine for webcams. However, for industrial USB cameras, if this is not a conflict, this is not sufficient. I tested with a camera that provides 640x480 Y800 @ 60 fps and MAX gave me 640x480 unknown @ 30fps. However, we provide an ActiveX control for our customers, so the can use the cameras with all of their capabilities. It can be used in LabVIEW, but not in Vision Builder.
0 Kudos
Message 12 of 16
(2,164 Views)

Hi Stefan,

 

I just came across the same problems as yours. So I tried to use LabVIEW to control a Philips webcam NPC900NC. I could configure it in MAX and vi, but only for some "basic" modes. I cannot change the frame rate of it above 30 FPS, which I can achieve in the camera's driver and in VC code. The VC code did this by calling functions in DirectShow. So I wondered if there is any way I can call the hidden functions of DirectShow in LabVIEW?

You mentioned that you solved this by creating an AcitveX control. Could you give more details on it? Thank you very much.

 

Regards,

Bo

 

(Windows XP 32-bit, LabVIEW 2009, IMAQdx)

------------------------
My blog Let's LabVIEW.
0 Kudos
Message 13 of 16
(2,132 Views)
Hi Bo, The frame rate is set by setting up the AM_MEDIA_TYPE or similar. It is documented in the MSDN DirectX / DirectShow documentation. I think, you can not access this using the IMAQdx driver in LabVIEW, because the frame rate can be set only, if the filter graph is not running. The ActiveX I have mentioned will run with our cameras (we are camera manufacturer) only, not with web cams. Thus, I am very sorry, but I can not help you for this issue. In case you can write an own DLL in VC than will do the image acquisition, then you can also write a function, that converts the image buffer you receive into a LabVIEW picture. This will solve your problem. But you can not use this in the Vision Assistant, as far as I know. Last alternative is using a GigE or a FireWire DCam camera. Both are very well supported in LabVIEW. Stefan
0 Kudos
Message 14 of 16
(2,124 Views)

Hi Stefan,

 

Thank you for your reply. It is really helpful. I will look up calling AM_MEDIA_TYPE function in LabVIEW then.

 

Thanks again for your help.

 

Regards,

Bo

------------------------
My blog Let's LabVIEW.
0 Kudos
Message 15 of 16
(2,121 Views)

AM_MEDIA_TYPE is a structure type:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd373477%28v=vs.85%29.aspx

The member pbFormat contains a pointer to a VIDEOINFOHEADER structure:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd407325%28v=vs.85%29.aspx

Its AvgTimePerFrame member contains the frame rate.

The AM_MEDIA_TYPE is used in SetMediaType and when filter pins are connected.

 

Stefan

0 Kudos
Message 16 of 16
(2,117 Views)