How to capture preview image frames from Camera Application in Android Programming?

后端 未结 2 1413
情歌与酒
情歌与酒 2020-12-13 22:15

I am writing an app to capture the camera preview frames and convert it to bitmap in Android. Here is my code:

   Camera.PreviewCallback previewCallback = ne         


        
2条回答
  •  不知归路
    2020-12-13 23:04

    Have you tried decoding the preview frame data to RGB before you use BitmapFactory? The default format is YUV which I'm not sure is compatible with BitmapFactory. Dave Manpearl's decode method can be found here:

    Getting frames from Video Image in Android

    Let me know if it works.

    Cheers,

    Paul

提交回复
热议问题