RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

Can't be change streaming quality (like HD or not)

Open hemant-novotrax opened this issue 2 years ago • 5 comments

For now can't be change streaming quality (like HD or not). let me know the way if it is possible

hemant-novotrax avatar May 23 '22 06:05 hemant-novotrax

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

pedroSG94 avatar May 23 '22 19:05 pedroSG94

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

hemant-novotrax avatar Jun 07 '22 04:06 hemant-novotrax

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.

pedroSG94 avatar Jun 07 '22 14:06 pedroSG94

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.

uditshoprtv avatar Jun 07 '22 18:06 uditshoprtv

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

pedroSG94 avatar Jun 09 '22 11:06 pedroSG94