How to get raw preview data from Camera object at least 15 frames per second in Android?

后端 未结 6 1343
忘了有多久
忘了有多久 2020-11-30 19:32

I need to obtain raw preview data from Camera object at least 15 frame per second, but I can only get a frame in 110 milliseconds which means I can get only

6条回答
  •  隐瞒了意图╮
    2020-11-30 20:28

    I'm affraid, you can not. Preview framerate setting is hint for camera appplication ( which runs in separate process) - and it is free to accept or silently ignore it. It is also not related with preview frame retrieval

    When you request preview frame, you just say external application that you would like to have it. Buffer for it is allocated in camera application and then passed to your activity via mmaped memory segment - this takes time.

    You may get desired performance on some devices, but not necessarily on one you are playing with.

    If you need defined frame rate, you will have to capture video and then parse / decompress resulting binary stream.

提交回复
热议问题