LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AVI - frames per second

Hi,

my job is to make a real-time measurement of a video recorded by a USB camera and to store the video during the measurement as an AVI-file, so that it can be used later for the same/or other similar measurements. I have created an VI which does the job, but I have problems with the frames per second...
I don't know how to synchronize the fps from real time with the AVI-video. Actually I thought that I just have to adjust the fps-number in IMAQ AVI Create and the fps my USB camera supports, but it doesn't work! Maybe there's a delay because of the while loop or something ?!?

Can anyone please help?
I am working with Labview 8.0 and Vision 7

Here is my VI....
0 Kudos
Message 1 of 10
(6,560 Views)
The fps setting on the avi create just sets the playback speed of the avi.

To change the frame rate of the camera you need to change the Video Mode when you call IMAQ USB Init.
The video mode may also change the resolution and bytes per pixel. To see what video mode does what you could look it up in the cameras manual, or use
IMAQ USB GetImageInfo to get the resolution and color depth. To detect the frame rate, the only method I know is to do a grab and average the time between Aquires (so if you acquire loop takes an average of ~66.66 ms to run then your camera is at 1000/66.66 = 15 fps. If it takes ~33.33 ms on average then it's 1000/33.33 = 30 fps. So basically set the video mode to what you want and set the AVI fps to what you figured out the camera outputs at that mode. (You could automate the fps detection by grabing some frames and mesuareing their frame rate before you start saving to the avi file).

Matt W
0 Kudos
Message 2 of 10
(6,543 Views)
Hmm I'm sorry but I didn't figure out how to do that!

I have tried the IMAQ USB GetImageInfo function and that works like you told me! But I don't know how to find out the fps! And it also doesn't work to determine the recording fps as a float, I can just choose values like 0,1,2,3,...

Maybe you can help me with that!
Thanks in advance
0 Kudos
Message 3 of 10
(6,481 Views)
Hi

If you you want to find out the frame rate of your camera the best place to start is the manufacturers documentation. What camera are you using?

Usb cameras can be made in such a way so that they are able to aquire at different rates, but it is impossible to tell you what your camera is like without knowing exactly what it is. Matt was right about how you set your camera to aquire at these different rates. Your camera may have different modes of operation which would be stated in the documentation and you can then select the mode you want using the 'IMAQ USB Init' function.
0 Kudos
Message 4 of 10
(6,454 Views)
Hi,

I know that the fps of my camera is 30, which is written by logitech! But the problem is that it doesn't work if I record my real time video with 30 fps! because then the real time video which takes 20 seconds is recorded in a AVI-file with about 4-5 seconds...
There must be any mistake and I don't know where... maybe with the grab function and the while loop???
0 Kudos
Message 5 of 10
(6,449 Views)
One thing I have noticed is that you have not set up the Grab using 'IMAQ USB Grab Setup.vi'.

If you go to 'Help' >> 'Find Examples' in LabVIEW and then search for AVI, you should find some vi's that may help you. The 'Grab and Save to AVI.vi'  will be of interest to you.
0 Kudos
Message 6 of 10
(6,437 Views)
Yeah thanks,

I have orientated myself to that VI, but I can't see the difference!
I have almost done the same, except of using Imaq USB functions instead of Imaq Acquire funtions...


0 Kudos
Message 7 of 10
(6,430 Views)

Hi,

Could you include the camera model and revision please so I can look into this further for you.

Thanks,

Applications Engineer
0 Kudos
Message 8 of 10
(6,412 Views)
Hi,
I think it must be this one, because I don't know if there is another model of that one. On some other pages it is written that it has 30 fps.

http://www.amazon.com/Logitech-Quickcam-for-Notebooks-961404-0403/dp/tech-data/B0007ZFLYS/ref=de_a_smtd

On my camera itself is written :  PC Camera/V-UAM37, Logitech Webcam for notebooks

This is just my privat and cheap camera with which I am trying my program first! When it works I am going to use a better one at University...
0 Kudos
Message 9 of 10
(6,402 Views)

Hi,

Have you looked through the document that comes with the IMAQ for USB software, especially at the example programs & locations?

You can find them at: C:\Program Files\National Instruments\NI-IMAQ for USB as a .pdf document.

 

Being as we don't have a USB camera in the office at the moment I's unable to test what your doing, I will try to hunt one down though.

Applications Engineer
0 Kudos
Message 10 of 10
(6,360 Views)