pedroSG94 / RTSP-Server

Plugin of rtmp-rtsp-stream-client-java to stream directly to RTSP player.
Apache License 2.0
214 stars 66 forks source link

Can not connect to to server when I don't call startPreview #89

Open Colaman0 opened 1 year ago

Colaman0 commented 1 year ago

When i don't pass the surfaceview of textureview to build the RtspServerCamera1 or don't call the rtspServerCamera1.startPreview() , RtspServer will return the sps or pps is null error. Just hide the rtspServerCamera1.startPreview() in sample

gobeyondmyself commented 1 year ago

because when you call startpreview,you will call Camera1Base.startPreview, then,call the Camera1ApiManager.start, last ,get the camera yuv data.

Colaman0 commented 1 year ago

it will call Camera1ApiManager.start event I didn't call startPreview. I found the problem is VideoEncode didn't accept the formatChanged ,so the spa and pps is null

image
gobeyondmyself commented 1 year ago

i don't knwo that,I'm also studying the source code. can you help me solve #88 problem?

Colaman0 commented 1 year ago

I found that if you didn't call startPreview before startStream,the RtspServer will fail to open。 because startPreview will init the camera config ,it will select the camera facing , then startStream will open camera,so that it will open the camera 0 and my device didn't have it ,so I can't get the camera frame data. RtspServer will check the ssp and data , and both two data come from the frame data , so the RtspServer can't open .