08-11-2015 08:19 AM - edited 08-11-2015 08:22 AM
Hi,
I'm playing video and saving to a avi file at the same time. Since saving the file is very time demanding I just do it in separate loops. I also cut the video files so I do not have problems with resulting avi file size. My cameras can record up to 20 fps, when I acquire at 5 , 10 , 15 fps, things seem to go OK. The problem appears when acquiring at 20 fps: some of the files obtained (it cuts the recording into 30 seconds video files) are OK, but some are not.
Those which are not OK seem to have random speed, they are accelerated for a while, then back to normal speed, then again accelerated...quite wierd...Any suggestions?
Thanks
08-12-2015 10:31 AM
Hi cobayatron,
My name is Mitchell Goon, from National Instruments Technical Support.
Before I investigate further into your issue, I’d be grateful if you could clarify some information regarding your enquiry:
Kind Regards,
Mitchell Lewis
National Instruments
Applications Engineering
08-12-2015 10:53 AM
Hi Mitchell,
Thanks for your interest.
I am using a BASLER aca1600-20uc which is connected through a usb 3.0 connection to a PXIe-8135 controller in a PXIe-1085 chassis.
Regarding the last question...well when I say running correctly or not running correctly, let's see.
I record a video of a clock (physical clock that I have here) and then since the files are of known time length I can check in the clock if it's correct. As an example: if the acquisition frame rate is 10 fps, when I cut the video file with 600 frames, the time recorded should be 60 seconds and this is what I check in the clock. Quite rudimentary, I know...but it helps. Besides the movement of the seconds-hand lets me check if there's acceleration and when it happens.
Hope it helps.
Regards,
08-14-2015 03:45 AM
Hi cobayatron,
I have to say that what you did to keep track of the time is actually a pretty good idea actually. The simplest approach most often is the best one 🙂
As you’ve mentioned you are both playing and saving the video at the same time, if I’m correct? It is quite likely, especially at a higher frame rate, that the PXIe controller is unable to read and process the data from the camera quickly enough, as more memory is being used to both play and save the file. You may wish to try doing both separately and see if that resolves the issue? It might be helpful to have a look at this article as well, as it might be somewhat related to your issue:
http://digital.ni.com/public.nsf/allkb/48F9F0284F60661486256D87005E9107?OpenDocument
Another factor could be due to the resolution you’re recording in as well? From what I can see from your code, the resolution is not specified, so I’m assuming it’s recording in 1624x1234 pixels, according to the camera’s data sheet. Using a larger resolution would definitely increase the amount of data that needs to be read and processed by the hard drive. Perhaps trying to record the files at a lower resolution and see if that improves the frame rate? You should be able to do so with the “IMAQ Create” VI you have in your code, using the terminal “Border Size”.
Do let me know if any of these work for you, and any other troubleshooting steps you’ve taken after that, and the mean time, I’ll do my best to do a bit more research into the issue.
Kind Regards,
Mitchell Lewis
08-14-2015 05:25 AM
Hi Mitchell,
Thanks for the info. It was helpful.
I'm afraid that this situation can only go worse since eventually, I will have to record and play three of these cameras at the same time. Unfortunately, at this stage I cannot decrease the resolution nor the frame rate of the video files because they will have to be delivered to external people.
What I can do is to decrease the visualizing frame rate since this is only an internal tool, I modified the code so I only show one of each 4 frames.
I've recorded a 10 minutes video and the results have significantly improved. I'll try to test the three cameras together. What do you think? Any other approach?
Regards,
08-14-2015 06:58 AM
Hi cobayatron,
Good to hear that you’re seeing improvements on your end. As far as i understand, it seems to be a case of trying to get hardware to accomplish something that may not technologically feasible at the moment.
As you’ve mentioned, the modifications you made to your code resulted in significant improvements in terms of the output video’s performance. I think it’s best to stick with that for the time being, and see if that works for you when you have three cameras running together.
Kind Regards,
Mitchell Lewis
08-14-2015 11:48 AM
Hi Mitchell,
I've implemented the code for the three cameras but something quite strange happens.
One of the IMAQ AVI2 write frame VI generates an error (which changes randomly). The error happens there because I've been tracking the error and everything is OK.
08-17-2015 04:00 AM
Hi cobayatron,
From what I have seen, the error in your screenshot usually occurs when using a USB hub with multiple devices. This usually is due to the single USB port being unable to handle the bandwidth of multiple camera devices. You may wish to try the cameras on individual USB ports, if that’s the case?
Kind Regards,
Mitchell Lewis
08-18-2015 04:43 AM
Thanks Mitchell,
Yes, I am using one of these USB hubs to connect the three cameras. I'll try at least one camera on a individual port and left two on the hub.
Regards