Closed IakovlevAA closed 4 weeks ago
Agent comment from yating.liao in Zendesk ticket #115208:
The LiveStream does not have an interface to obtain frame data. The image pushed by LiveStream is the camera's image; can we use the camera's frame data as a substitute?
°°°
Yes, I meant obtaining frames from camera and converting them to Bitmap
Agent comment from yating.liao in Zendesk ticket #115208:
You may want to take a look at this issue. If you obtain the YUV data, you can implement the conversion to bitmap on your own.
https://sdk-forum.dji.net/hc/en-us/community/posts/33709871608089-YUV-to-Bitmap
°°°
Yes, thanks. This approach helped me, for anyone who will wonder I'll leave sample of code that works for me
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val byteBuffer = ByteBuffer.wrap(frameData)
bitmap.copyPixelsFromBuffer(byteBuffer)
val stream = ByteArrayOutputStream()
bitmap?.compress(Bitmap.CompressFormat.JPEG, 100, stream)
val image = stream.toByteArray()
Agent comment from yating.liao in Zendesk ticket #115208:
I am pleased to help you.
°°°
Hi DJI, I found in sample app possibilty of catching frames from camera stream. Is it possible, that I can capture frames and turning them into .png pictures? This is code from Sample
Does .image format can be changed to another(.yuv) ? If I save frame as .yuv and convert to .png I can't get normal picture