Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

example streaming program to disk

Does anyone have a vi that can be used to test the throughput of video to disk. I've installed a dedicated SATA drive for streaming 640x480x30Hz frame rate video and cant get all of the frames in real time. My calculations say that I shouldnt be bandwidth limited

Thanks
Brian
0 Kudos
Message 1 of 5
(3,723 Views)
Hello Brian,

I'm not aware of any VIs out there that test the throughput of data streamed to disk, but there might be one.  Hopefully the owner of such a VI will post here.  Even with a SATA drive, there will most likely be missed frames when doing disk I/O if you are only acquiring images via a grab and writing each file to a separate jpg or png file.  For fastest stream times I would recommend using an AVI file and separating out the frames from the AVI post acquisition.  If this won't work for you then you will need to use a ring acquisition with enough buffers to prevent overflow.
S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,705 Views)
The problem is that the data that i need to write is 16-bit grayscale and according to the NI documentation, the AVI files are only 8-bit grayscale or 24 bit color.

Does AVI have a no-compression setting? I need raw data

I'd be ok with saving the images as one large file and then break them into individual images later.
0 Kudos
Message 3 of 5
(3,700 Views)
Hi Brian -

AVI files written with the Vision module are uncompressed by default.  The file definition for AVI is limited to 8-bits per plane, though (which translates to 8-bit grayscale and 24-bit color).  If you need higher bit depths, I recommend acquiring in a Ring with a large buffer list and writing the images to a file in a separate thread.  This allows some jitter in the write process, which can be caught up a few frames down the line.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,680 Views)
OK - I have a workaround where i break the 16-bit word into two 8-bit channels and write these to the RED and BLUE channels of a 24-bit AVI file. Then after i make the AVI, I can post process the AVI into individual 16-bit TIFFs afterwords.

Thanks for the help.
0 Kudos
Message 5 of 5
(3,678 Views)