分享

RTSP 交互过程(抓包)

 mediatv 2014-12-28
 

使用Live555的openClient读到mediaServer上媒体文件的日志:

TCP

 

Java代码  收藏代码
  1. E:\source\C\RTP_RTCP\Live555\live.2013.04.30\live\Debug>playCommon.exe -t rtsp://192.168.1.107:554/test.mkv  
  2. Opening connection to 192.168.1.107, port 554...  
  3. ...remote connection opened  
  4. Sending request: OPTIONS rtsp://192.168.1.107:554/test.mkv RTSP/1.0  
  5. CSeq: 2  
  6. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  7.   
  8.   
  9. Received 152 new bytes of response data.  
  10. Received a complete OPTIONS response:  
  11. RTSP/1.0 200 OK  
  12. CSeq: 2  
  13. Date: Sat, Oct 05 2013 05:05:31 GMT  
  14. Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER  
  15.   
  16.   
  17. Sending request: DESCRIBE rtsp://192.168.1.107:554/test.mkv RTSP/1.0  
  18. CSeq: 3  
  19. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  20. Accept: application/sdp  
  21.   
  22.   
  23. Received 961 new bytes of response data.  
  24. Received a complete DESCRIBE response:  
  25. RTSP/1.0 200 OK  
  26. CSeq: 3  
  27. Date: Sat, Oct 05 2013 05:05:31 GMT  
  28. Content-Base: rtsp://192.168.1.107/test.mkv/  
  29. Content-Type: application/sdp  
  30. Content-Length: 798  
  31.   
  32. v=0  
  33. o=- 1380948674223678 1 IN IP4 192.168.1.107  
  34. s=Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  35. i=test.mkv  
  36. t=0 0  
  37. a=tool:LIVE555 Streaming Media v2011.12.23  
  38. a=type:broadcast  
  39. a=control:*  
  40. a=range:npt=0-60.511  
  41. a=x-qt-text-nam:Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  42. a=x-qt-text-inf:test.mkv  
  43. m=video 0 RTP/AVP 96  
  44. c=IN IP4 0.0.0.0  
  45. b=AS:500  
  46. a=rtpmap:96 H264/90000  
  47. a=fmtp:96 packetization-mode=1;profile-level-id=42C00D;sprop-parameter-sets=Z0LADZp0OXzyQgAAAwACAAADACkeKFVA,aM4yyA==  
  48. a=control:track1  
  49. m=audio 0 RTP/AVP 97  
  50. c=IN IP4 0.0.0.0  
  51. b=AS:96  
  52. a=rtpmap:97 MPEG4-GENERIC/44100/2  
  53. a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=0A10  
  54. a=control:track2  
  55.   
  56. Opened URL "rtsp://192.168.1.107:554/test.mkv", returning a SDP description:  
  57. v=0  
  58. o=- 1380948674223678 1 IN IP4 192.168.1.107  
  59. s=Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  60. i=test.mkv  
  61. t=0 0  
  62. a=tool:LIVE555 Streaming Media v2011.12.23  
  63. a=type:broadcast  
  64. a=control:*  
  65. a=range:npt=0-60.511  
  66. a=x-qt-text-nam:Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  67. a=x-qt-text-inf:test.mkv  
  68. m=video 0 RTP/AVP 96  
  69. c=IN IP4 0.0.0.0  
  70. b=AS:500  
  71. a=rtpmap:96 H264/90000  
  72. a=fmtp:96 packetization-mode=1;profile-level-id=42C00D;sprop-parameter-sets=Z0LADZp0OXzyQgAAAwACAAADACkeKFVA,aM4yyA==  
  73. a=control:track1  
  74. m=audio 0 RTP/AVP 97  
  75. c=IN IP4 0.0.0.0  
  76. b=AS:96  
  77. a=rtpmap:97 MPEG4-GENERIC/44100/2  
  78. a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=0A10  
  79. a=control:track2  
  80.   
  81. Created receiver for "video/H264" subsession (client ports 12574-12575)  
  82. Created receiver for "audio/MPEG4-GENERIC" subsession (client ports 12576-12577)  
  83. Sending request: SETUP rtsp://192.168.1.107/test.mkv/track1 RTSP/1.0  
  84. CSeq: 4  
  85. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  86. Transport: RTP/AVP/TCP;unicast;interleaved=0-1  
  87.   
  88.   
  89. Received 179 new bytes of response data.  
  90. Received a complete SETUP response:  
  91. RTSP/1.0 200 OK  
  92. CSeq: 4  
  93. Date: Sat, Oct 05 2013 05:05:31 GMT  
  94. Transport: RTP/AVP/TCP;unicast;destination=192.168.1.107;source=192.168.1.107;interleaved=0-1  
  95. Session: 5E0C0061  
  96.   
  97.   
  98. Setup "video/H264" subsession (client ports 12574-12575)  
  99. Sending request: SETUP rtsp://192.168.1.107/test.mkv/track2 RTSP/1.0  
  100. CSeq: 5  
  101. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  102. Transport: RTP/AVP/TCP;unicast;interleaved=2-3  
  103. Session: 5E0C0061  
  104.   
  105.   
  106. Received a complete SETUP response:  
  107. RTSP/1.0 200 OK  
  108. CSeq: 5  
  109. Date: Sat, Oct 05 2013 05:05:31 GMT  
  110. Transport: RTP/AVP/TCP;unicast;destination=192.168.1.107;source=192.168.1.107;interleaved=2-3  
  111. Session: 5E0C0061  
  112.   
  113.   
  114. Setup "audio/MPEG4-GENERIC" subsession (client ports 12576-12577)  
  115. Created output file: "video-H264-1"  
  116. Created output file: "audio-MPEG4-GENERIC-2"  
  117. Sending request: PLAY rtsp://192.168.1.107/test.mkv/ RTSP/1.0  
  118. CSeq: 6  
  119. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  120. Session: 5E0C0061  
  121. Range: npt=0.000-60.511  
  122.   
  123.   
  124. Received a complete PLAY response:  
  125. RTSP/1.0 200 OK  
  126. CSeq: 6  
  127. Date: Sat, Oct 05 2013 05:05:31 GMT  
  128. Range: npt=0.000-60.511  
  129. Session: 5E0C0061  
  130. RTP-Info: url=rtsp://192.168.1.107/test.mkv/track1;seq=28522;rtptime=3173087908,url=rtsp://192.168.1.107/test.mkv/track2;seq=51818;rtptime=2747140000  
  131.   
  132.   
  133. Started playing session  
  134. Receiving streamed data (for up to 65.511000 seconds)...  
  135. Sending request: TEARDOWN rtsp://192.168.1.107/test.mkv/ RTSP/1.0  
  136. CSeq: 7  
  137. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  138. Session: 5E0C0061  
  139.   
  140.   
  141. Received a complete TEARDOWN response:  
  142. RTSP/1.0 200 OK  
  143. CSeq: 7  
  144. Date: Sat, Oct 05 2013 05:06:37 GMT  

 

 

UDP

Java代码  收藏代码
  1. E:\source\C\RTP_RTCP\Live555\live.2013.04.30\live\Debug>playCommon.exe rtsp://192.168.1.107:554/test.mkv  
  2. Opening connection to 192.168.1.107, port 554...  
  3. ...remote connection opened  
  4. Sending request: OPTIONS rtsp://192.168.1.107:554/test.mkv RTSP/1.0  
  5. CSeq: 2  
  6. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  7.   
  8.   
  9. Received 152 new bytes of response data.  
  10. Received a complete OPTIONS response:  
  11. RTSP/1.0 200 OK  
  12. CSeq: 2  
  13. Date: Sat, Oct 05 2013 05:02:11 GMT  
  14. Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER  
  15.   
  16.   
  17. Sending request: DESCRIBE rtsp://192.168.1.107:554/test.mkv RTSP/1.0  
  18. CSeq: 3  
  19. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  20. Accept: application/sdp  
  21.   
  22.   
  23. Received 961 new bytes of response data.  
  24. Received a complete DESCRIBE response:  
  25. RTSP/1.0 200 OK  
  26. CSeq: 3  
  27. Date: Sat, Oct 05 2013 05:02:11 GMT  
  28. Content-Base: rtsp://192.168.1.107/test.mkv/  
  29. Content-Type: application/sdp  
  30. Content-Length: 798  
  31.   
  32. v=0  
  33. o=- 1380948674223678 1 IN IP4 192.168.1.107  
  34. s=Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  35. i=test.mkv  
  36. t=0 0  
  37. a=tool:LIVE555 Streaming Media v2011.12.23  
  38. a=type:broadcast  
  39. a=control:*  
  40. a=range:npt=0-60.511  
  41. a=x-qt-text-nam:Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  42. a=x-qt-text-inf:test.mkv  
  43. m=video 0 RTP/AVP 96  
  44. c=IN IP4 0.0.0.0  
  45. b=AS:500  
  46. a=rtpmap:96 H264/90000  
  47. a=fmtp:96 packetization-mode=1;profile-level-id=42C00D;sprop-parameter-sets=Z0LADZp0OXzyQgAAAwACAAADACkeKFVA,aM4yyA==  
  48. a=control:track1  
  49. m=audio 0 RTP/AVP 97  
  50. c=IN IP4 0.0.0.0  
  51. b=AS:96  
  52. a=rtpmap:97 MPEG4-GENERIC/44100/2  
  53. a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=0A10  
  54. a=control:track2  
  55.   
  56. Opened URL "rtsp://192.168.1.107:554/test.mkv", returning a SDP description:  
  57. v=0  
  58. o=- 1380948674223678 1 IN IP4 192.168.1.107  
  59. s=Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  60. i=test.mkv  
  61. t=0 0  
  62. a=tool:LIVE555 Streaming Media v2011.12.23  
  63. a=type:broadcast  
  64. a=control:*  
  65. a=range:npt=0-60.511  
  66. a=x-qt-text-nam:Matroska video+audio+(optional)subtitles, streamed by the LIVE555 Media Server  
  67. a=x-qt-text-inf:test.mkv  
  68. m=video 0 RTP/AVP 96  
  69. c=IN IP4 0.0.0.0  
  70. b=AS:500  
  71. a=rtpmap:96 H264/90000  
  72. a=fmtp:96 packetization-mode=1;profile-level-id=42C00D;sprop-parameter-sets=Z0LADZp0OXzyQgAAAwACAAADACkeKFVA,aM4yyA==  
  73. a=control:track1  
  74. m=audio 0 RTP/AVP 97  
  75. c=IN IP4 0.0.0.0  
  76. b=AS:96  
  77. a=rtpmap:97 MPEG4-GENERIC/44100/2  
  78. a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=0A10  
  79. a=control:track2  
  80.   
  81. Created receiver for "video/H264" subsession (client ports 12566-12567)  
  82. Created receiver for "audio/MPEG4-GENERIC" subsession (client ports 12568-12569)  
  83. Sending request: SETUP rtsp://192.168.1.107/test.mkv/track1 RTSP/1.0  
  84. CSeq: 4  
  85. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  86. Transport: RTP/AVP;unicast;client_port=12566-12567  
  87.   
  88.   
  89. Received 205 new bytes of response data.  
  90. Received a complete SETUP response:  
  91. RTSP/1.0 200 OK  
  92. CSeq: 4  
  93. Date: Sat, Oct 05 2013 05:02:12 GMT  
  94. Transport: RTP/AVP;unicast;destination=192.168.1.107;source=192.168.1.107;client_port=12566-12567;server_port=6974-6975  
  95. Session: 5DBD3416  
  96.   
  97.   
  98. Setup "video/H264" subsession (client ports 12566-12567)  
  99. Sending request: SETUP rtsp://192.168.1.107/test.mkv/track2 RTSP/1.0  
  100. CSeq: 5  
  101. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  102. Transport: RTP/AVP;unicast;client_port=12568-12569  
  103. Session: 5DBD3416  
  104.   
  105.   
  106. Received 205 new bytes of response data.  
  107. Received a complete SETUP response:  
  108. RTSP/1.0 200 OK  
  109. CSeq: 5  
  110. Date: Sat, Oct 05 2013 05:02:12 GMT  
  111. Transport: RTP/AVP;unicast;destination=192.168.1.107;source=192.168.1.107;client_port=12568-12569;server_port=6976-6977  
  112. Session: 5DBD3416  
  113.   
  114.   
  115. Setup "audio/MPEG4-GENERIC" subsession (client ports 12568-12569)  
  116. Created output file: "video-H264-1"  
  117. Created output file: "audio-MPEG4-GENERIC-2"  
  118. Sending request: PLAY rtsp://192.168.1.107/test.mkv/ RTSP/1.0  
  119. CSeq: 6  
  120. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  121. Session: 5DBD3416  
  122. Range: npt=0.000-60.511  
  123.   
  124.   
  125. Received 259 new bytes of response data.  
  126. Received a complete PLAY response:  
  127. RTSP/1.0 200 OK  
  128. CSeq: 6  
  129. Date: Sat, Oct 05 2013 05:02:12 GMT  
  130. Range: npt=0.000-60.511  
  131. Session: 5DBD3416  
  132. RTP-Info: url=rtsp://192.168.1.107/test.mkv/track1;seq=32252;rtptime=2700761571,url=rtsp://192.168.1.107/test.mkv/track2;seq=22188;rtptime=648106684  
  133.   
  134.   
  135. Started playing session  
  136. Receiving streamed data (for up to 65.511000 seconds)...  
  137. Sending request: TEARDOWN rtsp://192.168.1.107/test.mkv/ RTSP/1.0  
  138. CSeq: 7  
  139. User-Agent: playCommon.exe (LIVE555 Streaming Media v2013.04.30)  
  140. Session: 5DBD3416  
  141.   
  142.   
  143. Received 65 new bytes of response data.  
  144. Received a complete TEARDOWN response:  
  145. RTSP/1.0 200 OK  
  146. CSeq: 7  
  147. Date: Sat, Oct 05 2013 05:03:17 GMT  

 

 

附件:

RTSPClient_log_UDP.txt

RTSTClient_log_TCP.txt

timer.mkv

 

  •  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多