LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem w/ Case Statement and Video Capture

Hey!

 

I've got a question about a topic which seems pretty trivial, but has been giving me quite the trouble for some time now. I was hoping that someone on this forum would be able to help me catch and fix my mistake.

 

Basically what I'm trying to do is capture video from a camera, run some video analysis for a certain duration, and store the raw footage for that same duration in an avi file. I'm using IMAQdx and a Logitech C920 camera to gather video. When I run the program, I want there to be an output of the raw video on the front panel. When I then hit a button, I would like the camera to save a .avi file of the video for a set number of frames and concurrently run some analysis and display the results on another display on the front panel. The purpose of the raw footage in the .avi file is to be able to run the analysis again at a later date.

 

I've attached both a screenshot and the .vi file to this post. When I run the current script, I'm confronted with one of two possible errors (not sure why they're different from time to time). The Video Acquisition Block either "Time Out"s or the Write to AVI block issues an incompatible image type error. The reason why I'm baffled by this is because when I take it out of the case statement and have it run with the rest of the program, the .avi file is generated accurately and stored.

 

Any help would be greatly appreciated. Thanks!

Download All
0 Kudos
Message 1 of 2
(2,031 Views)

Greetings, 

 

Would the time out error happen every time you run the VI? In addition, do these errors have a code?

 

I was able to replicate the issue and initially believe that it might be that we are simultaneously opening two sessions to the same camera. Could you simply take a finite number of images from the first acquisition and chain the second one via sequence structure? It would limit the viewer to only view the video on the other Image Display during saving the AVI, but it might be worthwhile looking into. 

 

It might also be worthwhile to consider enquewing a certain number of images whenever the button is pressed, but that would require some more programming logic.

 

Cordially;

 

Simon P.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(1,994 Views)