PDA

View Full Version : External trigger in DirectShow



samotholt
March 18, 2009, 12:20:30
We have a DirectShow program that collects from multiple cameras. As we need synchronized images we've bought DMK21BUC03 cameras. The problem now is to set the cameras in external trigger mode. Is this possible from DirectShow (with the camera driver) or is there another simple solution so that we still can use our program?

Thanks in advance :-)

Stefan Geissler
March 19, 2009, 14:25:18
DirectShow offers an interface for external trigger : IAMVideoControl

samotholt
April 30, 2009, 10:56:06
But will IAMVideoControl (and trigger) actually work? We have a program which uses ISampleGrabber to grab frames. This works flawlessly without IAMVideoControl and the trigger mechanism.

By using IC Capture 2.0 (comes with the camera) we can see that the trigger is working (by using the trigger mode).

Back to our program:
When _connecting_ the trigger cable and using IAMVideoControl like this pAMVidControl->
SetMode(pSourcePin,VideoControlFlag_ExternalTrigge rEnable);
no frames are coming (no callback in ISampleGrabber).

This is the funny thing though; if using IAMVideoControl->SetMode() to external trigger (as above) and not having the trigger cable in the camera we may get 2 or 3 frames before the program hangs.

We also observe that when the trigger mechanism is attached to the camera both IC Capture and our program are slower.

Any suggestions are very much appreciated.

Stefan Geissler
April 30, 2009, 12:51:45
Well,

First of all, I can not perform DirectShow programming support for Micosoft.

Secondly: The DFK 21BUC03 must run in live video first, then the trigger can be enbabled. At this point of time, this problem exist and I think, we can fix this with a firmware update in future.

samotholt
May 4, 2009, 07:03:01
I understand that this is not a support forum for Microsoft. The problem though may be caused by DirectShow or it may be caused by the cameras and drivers. It is kind of hard for me to know, and this forum then seems to be the most relevant one.

I'm not sure what you mean by "run in live video". I can see that this is an option in IC Capture, but I'm not really sure what this means in DirectShow terminology. Is this just starting video capture from the cameras or is it something else? Any suggestions to point me in the right direction?

I can see that we unfortunately may need to use the C++ libraries of IC Imaging Control. I read somewhere that you have more examples than shown on your web site, any examples with using external trigger?

Stefan Geissler
May 4, 2009, 08:59:32
Hi,

you do not need the C++ librararies of IC Imaging Control in any case. "run in live video" means, "MediaControl->Run()" should have been called, before the trigger is enabled.

I must admit, there as not as much samples using the external trigger, because this usually was only one function call. And I also told (kicked) the engineers to have a look on the problem with the external trigger. I hope, I get a solution with a firmware update soon, thus your problem will be solved.

I would like you to ask me in intervalls about this, you can go directly in contact with me using the following link:
http://www.imagingcontrol.com/en_US/support/case/

samotholt
May 4, 2009, 13:04:52
I've been testing with MediaControl->Run(), before and after enabling the trigger but nothing works. I can see though that MediaControl->Run() always returns false (even when not using or enabling the trigger, in which case I get pictures as wanted). I guess this is not good, so I'll research this a bit.

Another thing we experience is that the device is often reported by Windows as not functioning when the trigger cable is attached. Is this related to your wanted firmware upgrade?

How often do you think I should ask for wanted firmware upgrade? Weekly or monthly.

I think if we can't get DirectShow working we'll try your IC API (easier support at least ;). This is what's written about the Grabber->isLive() function: "If the grabber is in live mode, images are continuously grabbed and either copied to the screen or to a memory buffer". Would this mean (when using trigger) that the same picture is coming until a new trigger pulse is sent to the camera? We would certainly want pictures only when camera is triggered by a trigger pulse. If I understand this correctly, this will be solved by the firmware upgrade?

Stefan Geissler
May 4, 2009, 14:18:27
Hello,

I got a corrected firmware from my engineers and it does, what I wanted it to do. Please contact me at http://www.imagingcontrol.com/en_US/support/case/ , thus I can send the firmware update software to you. Please let me know the serialnumber of your camera.


Another thing we experience is that the device is often reported by Windows as not functioning when the trigger cable is attached. Is this related to your wanted firmware upgrade?
This is new to me, but I think, this is no firmware problem. May be you have an electrical problem? In our tests this did not happen.


I think if we can't get DirectShow working we'll try your IC API (easier support at least ;). This is what's written about the Grabber->isLive() function: "If the grabber is in live mode, images are continuously grabbed and either copied to the screen or to a memory buffer". Would this mean (when using trigger) that the same picture is coming until a new trigger pulse is sent to the camera? We would certainly want pictures only when camera is triggered by a trigger pulse. If I understand this correctly, this will be solved by the firmware upgrade?
Edit/Delete Message

If the camera runs triggered, then images are only displayed and copied, if the camera has provided a new image, i.e. it was triggered. If the camera was not triggered, then still nothing will happen (until the next trigger event).

If you want image processing started automatically for each incoming frame, then you should perform following steps:
call grabber->snapMode(false);
create a Sink
create a GrabberListener inherited class and implement the frameReady() method. You may have a look into the "callback" sample for doing this.