add compress function into camera.