LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not enough speed when using AVI read

Hello!

 

I have a problem with the speed, when I'm using the 'AVI read' VI.

I want to read 60 frames per second, but my test.vi allows to read at least 20 to 30 fps (->33 - 50ms loop time), even when I do it in the easiest way (only the AVIread in the loop without any analize, graphs and of course wait functions).

The VI profiler tells me, that the AVI read VI only needs 1ms per loop. During that the CPU utilization is 10%.

My hard disks are fast enough, because its possible to write more than 60 frames per second in real time.

 

So, can anybody help me and tell me, where the VI spend its time and how to make it faster???

 

Thank you,

Gero

0 Kudos
Message 1 of 14
(4,788 Views)

Hello Gero,

 

please open the avi file with the windows media player and look at the framerate (or property)

Maybe the movie contains only 30 frames per second.

If the movie contains 60 frames per second you should be able to read all farmes with the original example.

Please open the example finder and type in avi to get the example.

 

Kind Regards,

 

Elmar

 

 

0 Kudos
Message 2 of 14
(4,762 Views)

Hello Elmar,

 

thanks for your reply.

 

I set the param 'frames per second' in AVI create to 90. But theres no difference when I replay the avi in my test-VI.

The windows media player is able to play round about 45-50 frames per second maximum.

 

My test-VI is based on the original NI example.

It's still not possible to read more than 25 frames with that example in real time.

 

Thanks,

Gero

 

 

0 Kudos
Message 3 of 14
(4,741 Views)

Hello Gero,

 

if you look at the context help "Imaq AVI Read Frame" the function dosent support RT Targets.

 

Kind regards,

 

Elmar

0 Kudos
Message 4 of 14
(4,733 Views)

Hello Elmar,

 

I know that the AVI read is no RT function, but my question was, how to speed up the framerate in AVI read.

 

I don't see a reason, why there's a limit of 25 frames per second when i'm using AVI read (and that in the easiest way). The VI profiler tells me, that AVIread needs only 1ms to read a frame and my cpu has 90% of power left. So, who slows down the framerate?

 

Thanks,

Gero

0 Kudos
Message 5 of 14
(4,729 Views)

Hey Gero,

 

This behaviour is not totally unexpected.

When you play AVIs in e.g. MediaPlayer the processing happens on the video card. However, LabVIEW is using direct show to read AVIs which means that all the processing takes place at the CPU. Therefore the frame rate cannot be guranteed.

 

When you are working with AVIs, you do post-processing, so why is timing so important for you?

If its just necessary to "look good", you can read in all the frames before and process them in a different loop with the respective loop timing.



Christian
0 Kudos
Message 6 of 14
(4,722 Views)
166 frames on a windows system.
0 Kudos
Message 7 of 14
(4,718 Views)

@Christian 

Hello Christian,

 

I have to store 2 video streams (RGB 1032x778) with each 30 frames per second at the same time for 120sec. To do that, I can't do any compressing or analizing while writing the stream to an AVI file.

Then I have to post process my 2x8.6GB AVI files.

The main analizing of the video stream has to be done by a person, who watches the streams (both togehther -> time is money). Therefore its necessary to have a stream that looks like real time (now, there is a very inhomogenous replaying).

So, I want to replay the AVIs with real 60fps. And that's not possible, till now. And I don't see a reason for it.

 

Thanks

 

@Elmar

 Hello Elmar,

 

I want to read 60 frames in a second, not 60 frames at all. The flame example has 166 frames at all. I'm afraid that's not your performance in fps with your WinPC.

 

Regards,

 

Gero

 

0 Kudos
Message 8 of 14
(4,704 Views)

Hey Gero,

 

if i understand you correctly its not possible to view a video with 30 frames/second (30 frames in one second) in labview.

Therefore it will be greate if you could post your movie with 30 frames/second (not the hole 120sec because of the size) on our ftp server.

 

ftp://ftp.ni.com/incoming/

 

Create for example a "AVI" folder for that.

And i will test it out with your movie.

 

Kind regards,

 

Elmar

0 Kudos
Message 9 of 14
(4,689 Views)

Hi all,

 

i just played around a bit using an advertisment video from Heineken. The default video is set to 24 fps which is displayed as expected.

I converted the video (sadly with a not so good comporession) to 72 fps. In Windows Media Player, i'd say that the 72 fps are maintained.

Using my Player.vi, the video is played with about 40fps on my Laptop. The CPU load is about 15%. So it seem that either my programming is bad or there is a platform dependency in the performance.

Removing the display from the loop (so no visualisation of the video), the performance got up to near 43 fps.

 

Gero, please confirm if this is the behaviour you are seeing. I asume quite an impact by different platforms, so feel free to check other systems as well.

 

hope this helps,

Norbert

 

PS: I split the attachment and repacked the _fast-version using a higher compression (lossy) for a smaller file size.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 14
(4,685 Views)