5

I know the topic has already appeared multiple times but none of the solutions actually seems to be working, ranging from answers suitable for the old camera API (where the YUV data comes in a neat byte[] array), via corrupted images, to saving JPEG's all in "green scale" using RenderScript (which by the way is the best I am currently able to do).

The way the Camera2Basic example does it is that it simply sets the Type.Builder's format to JPEG. The problem with this (as discussed in multiple posts as well) is that it slows down the camera pipeline. YUV_420_888 works much much faster.

So, did anyone manage to perform a proper YUV_420_888 -> JPEG conversion?

bosmart
  • 325
  • 3
  • 11
  • What is YUV_420_888? is it NV21? – Anton Malyshev Aug 29 '15 at 20:06
  • I don't think it is. According to http://developer.android.com/reference/android/graphics/ImageFormat.html, YUV_420_888 "is a generic YCbCr format, capable of describing any 4:2:0 chroma-subsampled planar or semiplanar buffer (but not fully interleaved), with 8 bits per color sample." So I guess it can be NV21 but doesn't have to. – bosmart Aug 30 '15 at 06:56
  • "YUV_420_888 works much much faster." Note that this may also be due to a different pipeline / bug. On my OP3T, JPEG format exposes the frame for longer time and gives correct result, but "YUV_420_888" ignores the exposure setting. – HRJ Jun 29 '17 at 16:39
  • Check out my answer via this link: https://stackoverflow.com/a/45926852/2949966 – ahasbini Aug 28 '17 at 21:27

0 Answers0