-
Thank you for your module, It is very helpful. I'm making an app that livestreams a camera with UVC input. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hello, 1- Replace SurfaceView to openglview
I think it is autoexplicative but: Only affect to preview: Only affect to stream: |
Beta Was this translation helpful? Give feedback.
-
Hello,
Yes, using camera1 with SurfaceView or TextureView the preview and buffer data is not allways aligned because the buffer provided and the preview came from differents ways. Using camera2 or OpenGlView the preview and the stream is the same because both share the same source.
Using OpenGlView you can use this method to capture bitmaps: rtmpCamera1.getGlInterface().takePhoto(new TakePhotoCallback() {
@Override
public void onTakePhoto(Bitmap bitmap) {
}
}); |
Beta Was this translation helpful? Give feedback.
-
Hello, The code example posted above must be called after startPreview and each time you want to get a bitmap. For example, when you click a button you can paste that code in the event. |
Beta Was this translation helpful? Give feedback.
Hello,
Yes, using camera1 with SurfaceView or TextureView the preview and buffer data is not allways aligned because the buffer provided and the preview came from differents ways. Using camera2 or OpenGlView the preview and the stream is the same because both share the same source.
I only had a device with this problem in my hand (Nexus 6P) so it is not the normal but it is possible. You can fix it rotating the buffer byte[] but since it only happens in few devices use camera2 or OpenGlView is better a…