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

RtspServerFromFile loop mode not work!

Flykoki opened this issue · comments

Hi pedroSG94,

Used RtspServerFromFile.kt file to play local video (video path: /data/data/xxx/file/xxx.mp4) and call the method setLoopMode before startStream , but the loop mode don't work the vlc player don't received the data from rtsp server , here is the test step and log snapshot , help check it !

Test step :

  1. RtspServerFromFile mRtspServerFromFile = new RtspServerFromFile();
  2. mRtspServerFromFile.setLoopMode(true);
  3. mRtspServerFromFile.prepareAudio(filePath) && mRtspServerFromFile.prepareVideo(filePath)
  4. mRtspServerFromFile.startStream()

log snapshot
06-28 14:48:45.287 7714 30474 I BaseRtpSocket: wrote packet: Audio, size: 210, port: 55178
06-28 14:48:45.293 7714 30380 D FromFileBase: getAacData: streaming=true
06-28 14:48:45.294 7714 30474 I BaseRtpSocket: wrote packet: Audio, size: 210, port: 55178
06-28 14:48:45.298 7714 30380 D FromFileBase: getAacData: streaming=true
06-28 14:48:45.298 7714 30474 I BaseRtpSocket: wrote packet: Audio, size: 191, port: 55178
06-28 14:48:45.302 7714 30380 D FromFileBase: getAacData: streaming=true
06-28 14:48:45.303 7714 30474 I BaseRtpSocket: wrote packet: Audio, size: 208, port: 55178
06-28 14:48:45.306 7714 30380 D FromFileBase: getAacData: streaming=true
06-28 14:48:45.306 7714 30474 I BaseRtpSocket: wrote packet: Audio, size: 190, port: 55178
06-28 14:48:46.306 7714 30474 I RtspSender: Skipping iteration, frame null
06-28 14:48:46.509 7714 30466 I CommandsManager: OPTIONS xxx:1935/ RTSP/1.0
06-28 14:48:46.509 7714 30466 I CommandsManager: CSeq: 8
06-28 14:48:46.509 7714 30466 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:46.509 7714 30466 I CommandsManager: Session: xxx
06-28 14:48:46.509 7714 30466 I CommandsManager:
06-28 14:48:46.510 7714 30466 I Client : RTSP/1.0 200 OK

06-28 14:48:46.510 7714 30466 I Client : Server: pedroSG94 Server

06-28 14:48:46.510 7714 30466 I Client : Cseq: 8

06-28 14:48:46.510 7714 30466 I Client : Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE

06-28 14:48:46.510 7714 30466 I Client :

06-28 14:48:47.148 7714 30466 I CommandsManager: TEARDOWN xxx/ RTSP/1.0
06-28 14:48:47.148 7714 30466 I CommandsManager: CSeq: 9
06-28 14:48:47.148 7714 30466 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.148 7714 30466 I CommandsManager: Session: xxxx
06-28 14:48:47.148 7714 30466 I CommandsManager:
06-28 14:48:47.149 7714 30466 I Client : RTSP/1.0 200 OK

06-28 14:48:47.149 7714 30466 I Client : Server: pedroSG94 Server

06-28 14:48:47.149 7714 30466 I Client : Cseq: 9

06-28 14:48:47.149 7714 30466 I Client :

06-28 14:48:47.149 7714 30466 I Client : Client disconnected
06-28 14:48:47.172 7714 32735 I Client : New client xxx
06-28 14:48:47.172 7714 32735 I CommandsManager: OPTIONS rtsp://xxx:1935/ RTSP/1.0
06-28 14:48:47.172 7714 32735 I CommandsManager: CSeq: 2
06-28 14:48:47.172 7714 32735 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.172 7714 32735 I CommandsManager:
06-28 14:48:47.172 7714 32735 I Client : RTSP/1.0 200 OK

06-28 14:48:47.172 7714 32735 I Client : Server: pedroSG94 Server

06-28 14:48:47.172 7714 32735 I Client : Cseq: 2

06-28 14:48:47.172 7714 32735 I Client : Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE

06-28 14:48:47.172 7714 32735 I Client :

06-28 14:48:47.174 7714 32735 I CommandsManager: DESCRIBE rtsp://xxx:1935/ RTSP/1.0
06-28 14:48:47.174 7714 32735 I CommandsManager: CSeq: 3
06-28 14:48:47.174 7714 32735 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.174 7714 32735 I CommandsManager: Accept: application/sdp
06-28 14:48:47.174 7714 32735 I CommandsManager:
06-28 14:48:47.175 7714 32735 I Client : RTSP/1.0 200 OK

06-28 14:48:47.175 7714 32735 I Client : Server: pedroSG94 Server

06-28 14:48:47.175 7714 32735 I Client : Cseq: 3

06-28 14:48:47.175 7714 32735 I Client : Content-Length: 440

06-28 14:48:47.175 7714 32735 I Client : Content-Base: xxx:1935/

06-28 14:48:47.175 7714 32735 I Client : Content-Type: application/sdp

06-28 14:48:47.175 7714 32735 I Client :

06-28 14:48:47.175 7714 32735 I Client : v=0

06-28 14:48:47.175 7714 32735 I Client : o=- 0 0 IN IP4 xxx

06-28 14:48:47.175 7714 32735 I Client : s=Unnamed

06-28 14:48:47.175 7714 32735 I Client : i=N/A

06-28 14:48:47.175 7714 32735 I Client : c=IN IP4 xxx

06-28 14:48:47.175 7714 32735 I Client : t=0 0

06-28 14:48:47.175 7714 32735 I Client : a=recvonly

06-28 14:48:47.175 7714 32735 I Client : m=video 0 RTP/AVP 96

06-28 14:48:47.175 7714 32735 I Client : a=rtpmap:96 H264/90000

06-28 14:48:47.175 7714 32735 I Client : a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0IAH42NYCgC3QgAAB9IAAdTACA=,aMpDyA==

06-28 14:48:47.175 7714 32735 I Client : a=control:streamid=0

06-28 14:48:47.175 7714 32735 I Client : m=audio 0 RTP/AVP 97

06-28 14:48:47.175 7714 32735 I Client : a=rtpmap:97 MPEG4-GENERIC/44100/2

06-28 14:48:47.175 7714 32735 I Client : a=fmtp:97 profile-level-id=1; mode=AAC-hbr; config=1210; sizelength=13; indexlength=3; indexdeltalength=3

06-28 14:48:47.175 7714 32735 I Client : a=control:streamid=1

06-28 14:48:47.175 7714 32735 I Client :

06-28 14:48:47.184 7714 32735 I CommandsManager: SETUP xxx:1935/streamid=0 RTSP/1.0
06-28 14:48:47.184 7714 32735 I CommandsManager: CSeq: 4
06-28 14:48:47.184 7714 32735 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.184 7714 32735 I CommandsManager: Transport: RTP/AVP;unicast;client_port=42450-42451
06-28 14:48:47.184 7714 32735 I CommandsManager:
06-28 14:48:47.185 7714 32735 I ServerCommandManager: Video ports: [42450, 42451]
06-28 14:48:47.185 7714 32735 I ServerCommandManager: Video ports: [42450, 42451]
06-28 14:48:47.185 7714 32735 I Client : RTSP/1.0 200 OK

06-28 14:48:47.185 7714 32735 I Client : Server: pedroSG94 Server

06-28 14:48:47.185 7714 32735 I Client : Cseq: 4

06-28 14:48:47.185 7714 32735 I Client : Content-Length: 0

06-28 14:48:47.185 7714 32735 I Client : Transport: RTP/AVP/UDP;unicast;destination=xxx;client_port=42450-42451;server_port=5006-5007;mode=play

06-28 14:48:47.185 7714 32735 I Client : Session: xxxx

06-28 14:48:47.185 7714 32735 I Client : Cache-Control: no-cache

06-28 14:48:47.185 7714 32735 I Client :

06-28 14:48:47.189 7714 32735 I CommandsManager: SETUP xxx:1935/streamid=1 RTSP/1.0
06-28 14:48:47.189 7714 32735 I CommandsManager: CSeq: 5
06-28 14:48:47.189 7714 32735 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.189 7714 32735 I CommandsManager: Transport: RTP/AVP;unicast;client_port=37426-37427
06-28 14:48:47.189 7714 32735 I CommandsManager: Session: xxx
06-28 14:48:47.189 7714 32735 I CommandsManager:
06-28 14:48:47.189 7714 32735 I ServerCommandManager: Audio ports: [37426, 37427]
06-28 14:48:47.190 7714 32735 I ServerCommandManager: Audio ports: [37426, 37427]
06-28 14:48:47.191 7714 32735 I Client : RTSP/1.0 200 OK

06-28 14:48:47.191 7714 32735 I Client : Server: pedroSG94 Server

06-28 14:48:47.191 7714 32735 I Client : Cseq: 5

06-28 14:48:47.191 7714 32735 I Client : Content-Length: 0

06-28 14:48:47.191 7714 32735 I Client : Transport: RTP/AVP/UDP;unicast;destination=xxx;client_port=37426-37427;server_port=5004-5005;mode=play

06-28 14:48:47.191 7714 32735 I Client : Session: xxx

06-28 14:48:47.191 7714 32735 I Client : Cache-Control: no-cache

06-28 14:48:47.191 7714 32735 I Client :

06-28 14:48:47.205 7714 32735 I CommandsManager: PLAY xxx:1935/ RTSP/1.0
06-28 14:48:47.205 7714 32735 I CommandsManager: CSeq: 6
06-28 14:48:47.205 7714 32735 I CommandsManager: User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)
06-28 14:48:47.205 7714 32735 I CommandsManager: Session: xxx
06-28 14:48:47.205 7714 32735 I CommandsManager: Range: npt=0.000-
06-28 14:48:47.205 7714 32735 I CommandsManager:
06-28 14:48:47.206 7714 32735 I Client : RTSP/1.0 200 OK

06-28 14:48:47.206 7714 32735 I Client : Server: pedroSG94 Server

06-28 14:48:47.206 7714 32735 I Client : Cseq: 6

06-28 14:48:47.206 7714 32735 I Client : Content-Length: 0

06-28 14:48:47.206 7714 32735 I Client : RTP-Info: url=rtsp://xxx:1935/streamid=0;seq=1;rtptime=0,url=rtsp://xxx:1935/streamid=1;seq=1;rtptime=0

06-28 14:48:47.206 7714 32735 I Client : Session:xx

06-28 14:48:47.206 7714 32735 I Client :

06-28 14:48:47.206 7714 32735 I Client : Protocol UDP

06-28 14:48:48.214 7714 32736 I RtspSender: Skipping iteration, frame null
06-28 14:48:49.214 7714 32736 I RtspSender: Skipping iteration, frame null
06-28 14:48:50.214 7714 32736 I RtspSender: Skipping iteration, frame null

Hello,

Loop mode and moveTo method were modified recently in the main project, so this should be already fixed.
I will update version in the next days after confirm that other fix is working fine.

Refer to pedroSG94's comment