欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

RTSP 抓包分析

程序员文章站 2022-07-01 09:55:20
...

记录 wireshark 抓包记录

  1. OPTION
    询问 Server 有哪些方法可用

    request:

    Request: OPTIONS rtsp://192.168.1.65:554/h264/ch1/main/av_stream RTSP/1.0\r\n
    CSeq: 1\r\n
    User-Agent: Lavf58.45.100\r\n
    \r\n
    

    response:

    Response: RTSP/1.0 200 OK\r\n
    CSeq: 1\r\n
    Public: OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP, TEARDOWN, SET_PARAMETER, GET_PARAMETER\r\n
    Date:  Tue, Nov 24 2020 15:03:17 GMT\r\n
    \r\n
    
  2. DESCRIBE
    获取会话描述信息 (SDP)

    request:

    Request: DESCRIBE rtsp://192.168.1.65:554/h264/ch1/main/av_stream RTSP/1.0\r\n
    Accept: application/sdp\r\n
    CSeq: 2\r\n
    User-Agent: Lavf58.45.100\r\n
    \r\n
    

    response:

    Response: RTSP/1.0 401 Unauthorized\r\n
    CSeq: 2\r\n
    WWW-Authenticate: Digest realm="IP Camera(E6565)", nonce="8a9aab14b3789e63777eb65b431af847", stale="FALSE"\r\n
    Date:  Tue, Nov 24 2020 15:03:17 GMT\r\n
    \r\n
    

    request:

    Request: DESCRIBE rtsp://192.168.1.65:554/h264/ch1/main/av_stream RTSP/1.0\r\n
    Accept: application/sdp\r\n
    CSeq: 3\r\n
    User-Agent: Lavf58.45.100\r\n
    Authorization: Digest username="admin", realm="IP Camera(E6565)", nonce="8a9aab14b3789e63777eb65b431af847", uri="rtsp://192.168.1.65:554/h264/ch1/main/av_stream", response="eba3d573fa7b80f273120f5da1f7413e"\r\n
    \r\n
    

    response:

    RTSP/1.0 200 OK\r\n
    CSeq: 3\r\n
    Content-type: application/sdp
    Content-Base: rtsp://192.168.1.65:554/h264/ch1/main/av_stream/\r\n
    Content-length: 600
    \r\n
    Session Description Protocol
        Session Description Protocol Version (v): 0
        Owner/Creator, Session Id (o): - 1606230197063842 1606230197063842 IN IP4 192.168.1.65
        Session Name (s): Media Presentation
        E-mail Address (e): NONE
        Bandwidth Information (b): AS:5050
        Time Description, active time (t): 0 0
        Session Attribute (a): control:rtsp://192.168.1.65:554/h264/ch1/main/av_stream/
        Media Description, name and address (m): video 0 RTP/AVP 96
        Connection Information (c): IN IP4 0.0.0.0
        Bandwidth Information (b): AS:5000
        Media Attribute (a): recvonly
        Media Attribute (a): x-dimensions:1280,720
        Media Attribute (a): control:rtsp://192.168.1.65:554/h264/ch1/main/av_stream/trackID=1
        Media Attribute (a): rtpmap:96 H264/90000
        Media Attribute (a): fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z00AH5Y1wKALdNwEBAUAAAcIAAFfkAQ=,aO4xsg==
        Media Attribute (a): Media_header:MEDIAINFO=494D4B48010300000400000100000000000000000000000000000000000000000000000000000000;
        Media Attribute (a): appversion:1.0
    
  3. SETUP
    建立会话

    request:

    SETUP rtsp://192.168.1.65:554/h264/ch1/main/av_stream/trackID=1 RTSP/1.0\r\n
    Transport: RTP/AVP/UDP;unicast;client_port=20608-20609
    CSeq: 4\r\n
    User-Agent: Lavf58.45.100\r\n
    Authorization: Digest username="admin", realm="IP Camera(E6565)", nonce="8a9aab14b3789e63777eb65b431af847", uri="rtsp://192.168.1.65:554/h264/ch1/main/av_stream/trackID=1", response="d9bd735cc80cd7a66c8d12f1fee75620"\r\n
    \r\n
    

    response:

    RTSP/1.0 200 OK\r\n
    CSeq: 4\r\n
    Session: 1662328301;timeout=60
    Transport: RTP/AVP/UDP;unicast;client_port=20608-20609;server_port=8216-8217;ssrc=4b2301c0;mode="play"
    Date:  Tue, Nov 24 2020 15:03:17 GMT\r\n
    \r\n
    
  4. PLAY
    播放请求

    request:

    PLAY rtsp://192.168.1.65:554/h264/ch1/main/av_stream/ RTSP/1.0\r\n
    Range: npt=0.000-\r\n
    CSeq: 5\r\n
    User-Agent: Lavf58.45.100\r\n
    Session: 1662328301
    Authorization: Digest username="admin", realm="IP Camera(E6565)", nonce="8a9aab14b3789e63777eb65b431af847", uri="rtsp://192.168.1.65:554/h264/ch1/main/av_stream/", response="e7188ba85ae681178942f779c0a86ba4"\r\n
    \r\n
    

    response:

    RTSP/1.0 200 OK\r\n
    CSeq: 5\r\n
    Session: 1662328301
    RTP-Info: url=rtsp://192.168.1.65:554/h264/ch1/main/av_stream/trackID=1;seq=43491;rtptime=190323206\r\n
    Date:  Tue, Nov 24 2020 15:03:17 GMT\r\n
    \r\n
    
相关标签: rtsp