PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

video speed

 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

0 Kudos
Message 1 of 9
(5,493 Views)

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:

 

  1. What is the model of the camera you are using?
  2. NI hardware and software used?
  3. Could you elaborate more on what is meant when the program is running correctly vs when it is not running correctly? (i.e. expected time of video/ file sizes with the program, expected outcome when program is finished running?, or any other symptoms, etc)

 

Kind Regards,

 

Mitchell Lewis

National Instruments

Applications Engineering

www.ni.com/support

0 Kudos
Message 2 of 9
(5,445 Views)

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, 

0 Kudos
Message 3 of 9
(5,443 Views)

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

0 Kudos
Message 4 of 9
(5,399 Views)

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,

0 Kudos
Message 5 of 9
(5,385 Views)

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

0 Kudos
Message 6 of 9
(5,370 Views)

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.

Capture.JPG 

 

0 Kudos
Message 7 of 9
(5,350 Views)

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

0 Kudos
Message 8 of 9
(5,320 Views)

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

 

0 Kudos
Message 9 of 9
(5,290 Views)