pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.54k stars 772 forks source link

Error configure stream, setup audio 400 #1149

Closed vintageyj closed 2 years ago

vintageyj commented 2 years ago

Hi,

My project currently implements the latest rtplibrary version 2.1.9.

I am trying to stream to the rtsp-simple-server but I am encountered with the error in the title.

This issue is not present with the previous versions and I could get successful connections.

This is the log output:

I/CommandsManager: OPTIONS rtsp://10.0.2.2:8554/streamer RTSP/1.0 CSeq: 1 User-Agent: com.pedro.rtsp 2.1.9 I/CommandsManager: RTSP/1.0 200 OK CSeq: 1 Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN Server: gortsplib I/CommandsManager: ANNOUNCE rtsp://10.0.2.2:8554/streamer RTSP/1.0 Content-Type: application/sdp CSeq: 2 User-Agent: com.pedro.rtsp 2.1.9 Session: Content-Length: 429

v=0 o=- 0 0 IN IP4 127.0.0.1 s=Unnamed i=N/A c=IN IP4 10.0.2.2 t=0 0 a=recvonly m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAKY1oHgUaQgAAAwAPCIRq,aM4BqDXI a=control:streamid=0 m=audio 0 RTP/AVP 97 a=rtpmap:97 MPEG4-GENERIC/32000/2 a=fmtp:97 profile-level-id=1; mode=AAC-hbr; config=1290; sizelength=13; indexlength=3; indexdeltalength=3 a=control:streamid=1 I/CommandsManager: RTSP/1.0 200 OK CSeq: 2 Server: gortsplib I/RtspClient: announce success I/CommandsManager: SETUP rtsp://10.0.2.2:8554/streamer/streamid=0 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=record CSeq: 3 User-Agent: com.pedro.rtsp 2.1.9 Session: I/CommandsManager: RTSP/1.0 200 OK CSeq: 3 Server: gortsplib Session: 2859889040 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 I/CommandsManager: SETUP rtsp://10.0.2.2:8554/streamer/streamid=1 RTSP/1.0 Transport: RTP/AVP/TCP;unicast;interleaved=2-3;mode=record CSeq: 4 User-Agent: com.pedro.rtsp 2.1.9 Session: 2859889040 Transport: RTP/AVP/TCP I/CommandsManager: RTSP/1.0 400 Bad Request CSeq: 4 Server: gortsplib I/CommandsManager: TEARDOWN rtsp://10.0.2.2:8554/streamer RTSP/1.0 CSeq: 5 User-Agent: com.pedro.rtsp 2.1.9 Session: I/RtspClient: write teardown success I/MicrophoneManager: Microphone stopped I/VideoEncoder: stopped I/AudioEncoder: stopped I/hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients D/BufferPoolAccessor2.0: bufferpool2 0xed8cd178 : 0(0 size) total buffers - 0(0 size) used buffers - 839/844 (recycle/alloc) - 5/1678 (fetch/transfer) D/BufferPoolAccessor2.0: evictor expired: 1, evicted: 1

pedroSG94 commented 2 years ago

Hello,

Using app example wtih OpenGl RTSP example is working for me. Server version: v0.19.2 Try to use app example compiled and that server version. I have plan to update library version soon

vintageyj commented 2 years ago

All the rtsp examples from the app example works fine with server version v0.19.2.

The issue is specific to my android project using the latest rtplibrary. I took reference from the default rtsp example and ported the ExampleRtspActivity to my app and added the library to my build gradle to test out. The same issue occurs for 2.1.9. Works fine on 2.1.8 though.

pedroSG94 commented 2 years ago

Try to compile last commit using this gradle:

implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:54790ce5f8'
vintageyj commented 2 years ago

Thanks, the connection is successful again with the last commit

pedroSG94 commented 2 years ago

Nice! Closing issue