I'm displaying a real-time video on Surfaceview ,the data comes from mediacodec. So if I'm directly decoding the data to a surface, How can I get the bitmap of the current frame efficiently (with in 30ms).Currently I am dealing with the Bytebuffer output from mediacodec . It seems too slow to convert YUV to RGB and fill the bitmap with rgb data.
Asked
Active
Viewed 114 times
0
-
I faced this problem and was unable to speedup YUV to RGB conversion however I managed to get good fps by editing YUV directly and re-encoding. I was overlapping some images to frames so I converted those images into YUV and one rum time i just replaced some values of run-time frame to that overlapping image. – Ahmad Nawaz May 13 '15 at 03:39
-
thanks for your advice @Ahmad Nawaz ~I want to know how do you render the YUV data to the Surfaceview? I use canvas.drawBitmap()... so other than YUVRGB convert ,the bitmap creating is also time-costing – Siberiamark May 13 '15 at 03:48
-
Have a look on [http://stackoverflow.com/questions/25091703/how-to-create-and-save-a-screenshot-from-a-surfaceview][1] [1]: http://stackoverflow.com/questions/25091703/how-to-create-and-save-a-screenshot-from-a-surfaceview – Anand Makwana May 13 '15 at 03:50
-
@Siberiamark As I told i was just encoding edited frames with ffmpeg. I think your case is different from mine. So best of luck. – Ahmad Nawaz May 13 '15 at 03:51