0

I'm trying to find the fastest way to export a PNG sequence or movie with processing. I'm capturing Kinect data and currently, in each draw call, I'm using:

saveFrame("output/fames####.png");

but this is too slow. Anything I can do that's faster?

I'm using simple-openni for the kinect feed.

Liam McInroy
  • 4,339
  • 5
  • 32
  • 53
mheavers
  • 29,530
  • 58
  • 194
  • 315

3 Answers3

1

How long does it take you to process/encode one frame (and what time is acceptable to you)? You could try to buffer the data and have it asynchronously processed by a fixed number of worker threads. Otherwise you will have to resort to capturing video because then, the installed codec can use hardware acceleration/optimized CPU based encoding.

Edit: To absorb the encoding latency, you can use a Circular Buffer where you dump frames that need to be encoded. Then, launch Tasks that encode a set of frames in parallel. Once those finish, see if there are frames in the buffer and process those.

Ani
  • 10,826
  • 3
  • 27
  • 46
1

You can try to save to the .oni format and there's already a SimpleOpenNI Sample for recording and playing back. Even though this should use a lot of memory, I imagine it might still be faster than saveFrame()

The advantage of using the .oni format is you can easily process the nodes recorded with SimpleOpeni (for example skeleton/hand tracking or other features can be tested on a .oni recording). If you need images, there should ways to extract/parse .oni files

George Profenza
  • 50,687
  • 19
  • 144
  • 218
0

This might be to late, but you get a lot better performance if you save them as tif instead of png.

Oscar Abraham
  • 182
  • 1
  • 10