Save video frame into bitmap in Android


I’m trying to take the ARFrame and store the frame into bitmap file in android. But it turns out it always returns null from the BitMapFactory, which means, it always display “bitmap is null”.
here is the code I have.

Any help?



On which device are you connected? Jumping Sumo, Bebop 1, Bebop 2 ? On which firmware version?



Thanks for the reply. I use Bebop 2. And the firmware version is 1.18.R.4.
Hope this helps.



So I suggest you to read the documentation of MediaCodec.
As the stream is H264 encoded, you should first decode it and then get an image. Maybe getInputImage can help.

I cannot help you more on that as this is an Android topic, not really a SDK one :wink:

Hope this helps,
Best regards,


Hello Djavan.I try MediaCodec for several days.But the picture i get is a black picture. I dont know how to deal with it . Could you give an example code to get bitmap saved from the ARframe by using MediaCodec? Any help will be appreciate!Thank you!