0

I'm using Google Glass to stream video, and need to grab the camera frames. I'm using the OnPreviewFrame() callback to get it, and everything is fine with resolution up to 800x480. When trying to do the same with 720p resolution I get a corrupted frame. If I save the data to file and try to show it as 720p NV21 frame, it is completely corrupted. I played around a bit, and discovered that if I show it with 1288 width, I can recognize what of the image, but it still has some issues with it. I'm using SurfaceTexture for the preview. The same code works fine on Nexus7.

ArikYa
  • 146
  • 6

2 Answers2

1

So it turns out Glass has an issue with 720p60 preview. When I changed the frame rate to 30fps, I got perfect 720p frames

ArikYa
  • 146
  • 6
0

In your init preview method, did you set parameters like this?

parameters.setPreviewFpsRange(30000, 30000);
parameters.setPreviewSize(640, 360);
mCamera.setParameters(parameters);

I found with these settings, my Glass preview would look distorted.

Jeff Tang
  • 1,804
  • 15
  • 16