pedroSG94 / RTSP-Server

Plugin of rtmp-rtsp-stream-client-java to stream directly to RTSP player.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

set size 1920*1080 problem

109318119 opened this issue · comments

commented

hello,i have a problem about to set the resoulation to 1920 x 1080
i use library 1.1.8
then my layout is surfaceview and i use camera2
and set rtspServerCamera2.prepareVideo(1920, 1080, 30, 1920 x 1080,rotation)
but i can't start the rtstserver, if i change to the 1280 x 720 it works
i see the camera2 api about size i found the max size always 1920 x 972
so i can set the image quality lower than 1920 x 972
higher then 1920 x 972 it can't work
i set surfaceView.getHolder().setFixedSize(1920, 1080); still not works
some reson i can't provide my code so I'd like some advice

Hello,

Did you check that max size using this methods?

rtspServerCamera2.getResolutionsBack()
rtspServerCamera2.getResolutionsFront()

If you get that max size using this methods, I can't do anything. This is the max size supported by your device using camera2.
Alternative you can try using camera1 and check resolutions supported because few devices has a bad implementation of camera2 API.
Also, keep in mind, that back and front camera don't support the same resolutions. Normally, the back camera has higher resolutions

commented

@pedroSG94
Thanks, I will try your advice
if I have any question , I will ask related questions again

commented

@pedroSG94
hello,i have been set the preview size to 1920 x 1080
i found the problem is about layout
Now the preview is correct but RTSP is still not started , and I'm looking for possible problems

Hello,

Maybe the problem is related with your encoder. Maybe your camera support 1080p but you encoder can't do it
Can you show me info about your encoders?

for (String s: CodecUtil.showAllCodecsInfo()) {
      Log.e("Pedro", s);
}

Also, tell me codec used (H264, H265, AV1)

commented

@pedroSG94
hello, i use h264
i will check the encoder

commented

@pedroSG94
hello , i found my code had some problem
now i fix it and now i can use camera2 preview to 1920 x 1080 , also rtsp works !
thank you give me some advice

Closing as solved. You can open other issue if you need