Streaming and recording with different quality Camera2 API
See original GitHub issueHi!
I need to stream and record with different video quality using Camera2 API.
I read this issue (https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/issues/228), but it is for Camera1. As i understand, i need to duplicate VideoEncoder in Camera2Base.java, add this new VideoEncoder to listSurfaces in Camera2ApiManager.java’s startPreview and set useOpengl to false in RtmpCamera2 init:
rtmpCamera2 = new RtmpCamera2(App.getContext(), false, connectCheckerRtmp);
Am i right?
But after setting useOpengl to false (without any other modifications) i got errors:
2019-01-14 11:47:53.612 13103-13493/ru.altatec.server I/Camera2ApiManager: Camera opened 2019-01-14 11:47:53.613 13103-13493/ru.altatec.server E/Camera2ApiManager: Configuration failed
Device is Sony Xperia XZ1 Compact Android 9 and camera working at background.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Yes, you are right. You need modify library code. You have an example posted above but maybe you need fix something. I’m not doing this implementation because you need create 2 videoencoders to do it and this result in worse performance and it is more difficult to maintain
No, because openglview only support 2 surfaces (preview and encoder). You need modify SurfaceManager to make it work and create a way to scale image correctly to both encoders.