Coppied from (https://github.com/OpenKinect/libfreenect) libfreenect (customized for depth+rgb logging)