简体   繁体   中英

android support better method than glreadpixels?

I'm making android game.(using andengine) I need to record game play screen . This is not for making promotion video, It is for game players to review their game play. My app should record video by itself. So I can't solve this problem using available recording app in market. I already checked below code.

http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/ScreenCaptureExample.java?spec=svn66d3057f672175a8a21f9d06e7a045942331f65c&r=66d3057f672175a8a21f9d06e7a045942331f65c

It works very well.. But I want to record game play video, not a one screenshot.

At least I need 24fps for smooth replay, But If I use glreadpixels , I can get 5 fps at my xoom device. I searched various websites to solve this optimization problem. most people saying glreadplxels is too slow to record video.

http://www.gamedev.net/topic/473794-glreadpixel-takes-tooooo-much-time/

they recommend glcopyteximage2d instead of glreadpixels. because glcopyteximage2d is much more faster than glreadpixels. but I can't find how to use glcopyteximage2d in andengine. even someone say that android opengl ES do not support glcopyteximage2d.

Maybe Another method exists to record smooth video. It is read framebuffer of android device. most of recording app in market using this method. but these app needs root permission to grab framebuffer. I've read some news that android will be support capture screen from suface_flinger after gingerbread.

But I can't find out how to use framebuffer without root permission. T_T

These are my guessing solution.

  1. use another opengl API which has better speed than glreadpixels.

  2. find some android API can get framebuffer without root permission. (Maybe I can access to android SURFACE_FLINGER ??)

  3. draw another offscreen texture to record video.

But I don't know how to implement these methods. Which approach is correct? Do you have a example code to record video for android? please help me to solve this problem. If you know any other method, That will be helpful.

any help will be appreciated

Does the GPU vendor of your device support es3.0, if it does you can try to use PBO.

Here is a topic I you can refer to : Low readback performance with PBO , help !!!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM