RootEncoder
RootEncoder copied to clipboard
Can't be change streaming quality (like HD or not)
For now can't be change streaming quality (like HD or not). let me know the way if it is possible
You can set stream resolution in prepareVideo method: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera2Base.java#L314
You can set stream resolution in prepareVideo method: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera2Base.java#L314
But no option to set stream resolution. Please let me know in which key pass the stream resolution
Hello,
Stream resolution is width and height. I recommend you get supported resolutions using:
rtmpCamera.getResolutionsBack();
rtmpCamera.getResolutionsFront();
Depend if you are using front or back camera.
Pedro, I have tried to use
rtmpCamera.getResolutionsBack(); rtmpCamera.getResolutionsFront();
But how can we set resolution according to device as resolution list is big and how to identify that particular resolution is perfect for that particular device. Currently I have set static resolution 1920 x 1080 as height width. So, whenever I am starting streaming if my camera shake little at other end output turn pixelated for time being. So, how can I stream in better quality?
Thanks.
Hello,
This is normally related to bitrate. You can get a guide here: https://support.google.com/youtube/answer/2853702?hl=en#zippy=%2Cp Higher bitrate increase quality reducing pixelation but also increase bandwidth used and CPU usage because you need to handle with higher buffers. I haven't a way to get optimal resolution. You have to do it yourself following requirements of you app. In most of cases it can be solved if you let user set resolution of a reduced list decided by yourself and use one of this resolutions by default. Only one last hint. If you want allow switchcamera on fly (front and back). The resolution must be supported in both cameras or you will get CameraOpenException like here: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/openglexample/OpenGlRtmpActivity.java#L433