android - Maximum camera grab and display performance -
i've researched topic lot, seems i'm doing wrong or understanding somehow off.
i simply want achieve best performance (e.g. measured in fps) grabbing high quality image android driven smartphone , showing directly user without modifications.
since have pretty capable smartphone (nexus 4), assumed should trivial task. efforts didn't pay off. e.g. achieved 10 fps 800x480 stream using latest opencv framework.
so, possible achieve >25fps grabbing , displaying high quality video phone's camera? if so, best strategy so? device specific considerations welcome well.
resources used:
- http://obviam.net/index.php/texture-mapping-opengl-android-displaying-images-using-opengl-and-squares/
- http://mesai0.blogspot.de/2013/01/android-native-camera-with-opencv-and.html
- http://opencv.org/
update: i've been able increase grabbing performance constant ~25fps@1280x720 setting recording hint while using surfacetexture , textureview camera sink.
yet i'm wondering if possible increase performance further. tried use different preview formats, without luck. maybe there implicit upper limit enforced on grabbing performance i'm unaware of.
nevertheless i'll continue research , keep informed. sorts of information still welcome!
the limiting factor how can move big pile of data around. there's similar discussion here. have 3 tasks: (1) acquire image, (2) save image ("capture"), , (3) display image. (if i've misunderstood question, , don't need #2, camera's surface preview mode want @ high speed.)
one memory-bandwidth-efficient approach, available on android 4.3, feed camera's surface preview avc encoder, save encoded mpeg stream, , decode frames display. buffers camera can fed mediacodec encoder without having copy them or convert data different format. (see cameratompegtest example.) approach may incompatible 1 of stated goals: compression applied each frame may reduce quality below acceptable levels.
if need keep frames "whole", have copy data around, possibly multiple times, , write disk. larger frame, more data have move, , slower goes. example, camera captures data , writes native buffer; native buffer copied managed buffer dalvik vm; buffer written disk; yuv converted rgb; rgb displayed on screen uploading data texture , rendering it.
Comments
Post a Comment