02-08-2012 02:01 PM
Hi everyone,
I try to acquire video data from a Basler GigaE camera at 60 fps and save the video compressed (Intel Indeo R3.2) in to a avi file. I create a producer/ consumer loop because the compression take more time that the acquisition and if I do both in the same loop I lose frames. But I have 2 problems: 1) it seems that there is a big difference between the time take to fill the queue and the time to enqueue the images so that the number of elements in the queue increase all the time. 2) when I stop the recording the consumer loop run until the queue is unfilled but even if the number of elements is 0 in the queue the program still run.
I attached a picture of the VI. I tried to use a vi that I find here "NI-Vision Image Processing with Producer/Consumer Loops " but even if I changed the IMAQ copy with IMAQ merge overlay the video acquired don't have the rigth frequency acquisition.
Thank you for your help
Alex
02-09-2012 08:19 AM
Hello,
First, the behavior is totally normal, as your acquisition is faster than your processing. If your camera is 30Hz and your process is at 20Hz, your queue will increase till the RAM is full. The image compression is something that takes a lot of preocessing time. Try to save an uncompressed avi to increase speed or try different codecs. Also, the performances of your hardrive may affect the amount of time needed by your consumer loop.
Then to stop your consumer loop, just check that the mechanical action of your stop button is set to "Latch when Pressed".
Regards
02-09-2012 08:43 AM
Hello
1) Remove Image indicator from your producer loop, that will increase your acquisition speed.
2) Your consumer loop may not be stopping, because you are using dequeue element function & not defining any timeout, that means it waits indefinitely. So if your producer loop stops before that & there is no element in queue then dequeue function will wait indefinitely.
02-29-2012 09:19 AM
Is there a reason you have a shift register for your queue in the producer loop?
02-29-2012 09:30 AM
Hi Palanski,
no, I have seen this in another exemple. Anyway I changed my vi and now I use 2 while loop, one for each camera, and I eliminate all unuseful indicator or other things and the program work well
Thanks to all for the suggestions
Alex
03-01-2012 09:01 AM
Hello alex
Which camera are you using?
I am also facing some problem in file writing, i am using NI 1742 & when i use AVI VI's what you are using in your code, it gives a error message in my case saying not supported in RT. Do we need to install any specific drivers in camera RT ??
03-02-2012 05:42 PM
Hi Rajan,
Writing AVI files is not currently supported in RT at present. Your question seems unrelated to this forum, so if you have additional questions about AVI VIs in RT, go ahead and create a new forum post. We like to keep one question per forum.
Best,
Dan N
Applications Engineer
National Instruments
03-04-2012 09:40 AM
Hello Dan
Thanks for the reply, well my reason for asking about AVI in this post was the reason that alex is using the AVI VI's (see the attachment that alex has shared), which i was not able to do when i tried.
Anyways, if you can please suggest some solution to my problem:
http://forums.ni.com/t5/Machine-Vision/Transmit-50-fps-from-1742-to-cRIO/td-p/1863973
Will highly appreciate any help 🙂
03-05-2012 08:43 AM
Hello Rajan,
I can't see yours vi's because I have Labview 2009. I can check your problem if you are able to convert them in a early version that you utilise. For answering to your question I use 2 balser ACE A100 cameras. Ithe new program that work very well I have one while loop for acquire and save to avi (non compressed) for each cameras.
Alex