From: Goran <sen...@gm...> - 2012-12-23 22:05:23
|
Thanks to you guys for the detailed informations. Indeed, I have a high frame rate (80) which makes it impossible to write to a normal hard disk. But a SSD disk does the job. Even with several cams. My problem is - as far as I see - the computation time. Is there a GPU libpng (openCL) lib planed/possible? At the moment I write the array in Bayer8 format direct into file. That's not to bad as it's only - round about - 30% bigger than PNG 8bit gray. But nevertheless I would prefer PNG. Thanks for helping Goran Am 20.12.2012 03:10 schrieb "John Bowler" <joh...@gm... >: > On Wed, Dec 19, 2012 at 7:34 AM, Goran <sen...@gm...> wrote: > > The size of an image with 656x492 pixels and RGB24 format would be: > > ImageBufferSize = 656*492*3 = 968256 > > > > What would be the most efficient way to write such an array with > > libpng to harddisk? > > As Glenn says it depends on what you mean by efficient; where your > bottleneck is. These are low resolution images delivered over gigabit > ethernet but you have multiple cameras; presumably you have a very > high frame rate and you need to compress either to fit within disk > space limitations or, perhaps more likely, to fit the bandwidth of the > disk you are writing to. > > Presumably this isn't a security camera application, because then you > would just use JPEG - JPEG compression is well understood, very > effective and takes a predictable amount of time, however it is only > suitable for images that are for human consumption; it introduces > artefacts that humans don't notice but machines do. > > One important thing about PNG compression is that the time required is > unpredictable; the compression algorithm (LZ77) involves a search that > takes variable amounts of time according to the input data. If you > have issues with the computation time, rather than the time to write > to disk, you may need to look at another algorithm. You can minimize > this variability by selecting a low zlib compression level, but the > simplified API Glenn suggested does not allow this to be specified; > you would need to alter the value in the libpng code (this is easy; > just search the code for Z_DEFAULT_COMPRESSION) to select a value > other than the default. > > Assuming that the bottleneck is getting the images stored onto the > disk it is likely that just using either the simplified API or > png_write_image will do exactly what you want - send a reasonably > compressed image to the disk without damaging the image for later > processing. > > If you encounter issues with time in the compression, however, it's > very easy to eliminate (at compile time) the libpng code which > attempts to optimize the compression and to reduce the compression > search time (as above.) > > -- > John Bowler <joh...@gm...> > +1 (541) 450-9885 > PO BOX 3151 > KERBY OR 97531-3151 > USA > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > png-mng-implement mailing list > png...@li... > https://lists.sourceforge.net/lists/listinfo/png-mng-implement > |