Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is writing to tiff files slower than writing to AVI?

Solved!
Go to solution

I am having a problem capturing and saving video at high speeds.  I have images of size 2448 x 2050 x 8bit, which are being acquired at 15 frames/second.  I can successfully write this to disk as an uncompressed AVI in labview, and not miss any frames for the length of an experiment (5-10 minutes).  However, I would prefer to write individual frames to uncompressed tiff files and have so far been unsuccessful in getting the same performance.  Is there some reason that writing to tiff is inherently slower.  Does anyone have any suggestions for improving performance?  With the tiff writing I can get 8-10 frame/second.

 

I've attached a picture of my code with the tiff writing in place (the avi version basically just replaces "write file" with "avi write frame").

 

Any help is appreciated.

 

Ken

0 Kudos
Message 1 of 7
(4,565 Views)

Loolk like HDD is your bottleneck.

 

In worst case 2448 x 2050 x 1 byte x 15 = 75 276 000 or approx. 75 MB. Tiff file can be compressed, but this take additional time. So, your hard drive should be able to write at least 75 MB/s. Commonly you will get 50-60 MB/s, ant this is probably reason. Try to add several HDDs in RAID0.

 

Andrey.

 

Message 2 of 7
(4,563 Views)

Andrey, thanks for the response.  We are close to limited by our HD speed, but I still thought it was weird that I can write 15fps for an AVI but not for a TIFF.  Both are uncompressed in our case.  Our hard drive spec says 78MB/second sustained data transfer rate, so we still would benefit from a RAID array.

 

Ken

0 Kudos
Message 3 of 7
(4,562 Views)
Solution
Accepted by topic author halvorka
I would guess that the cause is the overhead involved in opening and closing each TIFF file you write whereas you open the AVI file once, write to it repeatedly, and then close it.  If you really want them in individual TIFF files, you can always convert them in post-processing.
Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 7
(4,553 Views)
Thanks, I think you guys are right.  I will test this shortly with upgraded hard drives.
0 Kudos
Message 5 of 7
(4,509 Views)

I can vouch that it is indeed the overhead of opening and closing the tiff each time.  I had a beastly machine put together for just such an application (similar image size and write speed), and it could only keep up for a minute or so before dropping frames.  Write to AVI, then convert later.

0 Kudos
Message 6 of 7
(3,897 Views)

ooops,,,didn't notice this post was almost a year old  🙂

0 Kudos
Message 7 of 7
(3,880 Views)