Save video frame into bitmap in Android


#1

Hi,
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?
Thanks

#2

Hi,

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

Regards,
Djavan


#3

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


#4

Hi,

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,
Djavan


#5

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!