RTMP 协议

RTMP 协议RTMP 协议_第1张图片

Real Time Messaging Protocol (Handshake C0+C1)
    Handshake C0+C1
        Protocol version: 03
        Handshake data: 9bb6b6520000000096000956faa30569f3a75071a37c4266…
Real Time Messaging Protocol (Handshake S0+S1+S2)
    Handshake S0+S1+S2
        Protocol version: 03
        Handshake data: 9bb6b6520000000096000956faa30569f3a75071a37c4266…
        Handshake data: 9bb6b6520000000096000956faa30569f3a75071a37c4266…
Real Time Messaging Protocol (Handshake C2)
    Handshake C2
        Handshake data: 9bb6b6520000000096000956faa30569f3a75071a37c4266…
Real Time Messaging Protocol (Set Chunk Size 4096)
    RTMP Header
        00.. .... = Format: 0
        ..00 0010 = Chunk Stream ID: 2
        Timestamp: 0
        Body size: 4
        Type ID: Set Chunk Size (0x01)
        Stream ID: 0
    RTMP Body
        Chunk size: 4096
Real Time Messaging Protocol (AMF0 Command connect('live'))
    Response to this call in frame: 1021
    RTMP Header
        00.. .... = Format: 0
        ..00 0011 = Chunk Stream ID: 3
        Timestamp: 0
        Body size: 179
        Type ID: AMF0 Command (0x14)
        Stream ID: 0
    RTMP Body
        String 'connect'
            AMF0 type: String (0x02)
            String length: 7
            String: connect
        Number 1
            AMF0 type: Number (0x00)
            Number: 1
        Object (5 items)
            AMF0 type: Object (0x03)
            Property 'app' String 'live'
            Property 'type' String 'nonprivate'
            Property 'flashVer' String 'FMLE/3.0 (compatible; FMSc/1.0)'
            Property 'swfUrl' String 'rtmp://10.155.32.220:1935/live'
            Property 'tcUrl' String 'rtmp://10.155.32.220:1935/live'
            End Of Object Marker
Real Time Messaging Protocol (Window Acknowledgement Size 5000000)
    RTMP Header
        00.. .... = Format: 0
        ..00 0010 = Chunk Stream ID: 2
        Timestamp: 0
        Body size: 4
        Type ID: Window Acknowledgement Size (0x05)
        Stream ID: 0
    RTMP Body
        Window acknowledgement size: 5000000
Real Time Messaging Protocol (Set Peer Bandwidth 5000000,Dynamic)
    RTMP Header
        00.. .... = Format: 0
        ..00 0010 = Chunk Stream ID: 2
        Timestamp: 0
        Body size: 5
        Type ID: Set Peer Bandwidth (0x06)
        Stream ID: 0
    RTMP Body
        Window acknowledgement size: 5000000
        Limit type: Dynamic (2)
Real Time Messaging Protocol (Set Chunk Size 4000)
    RTMP Header
        00.. .... = Format: 0
        ..00 0010 = Chunk Stream ID: 2
        Timestamp: 0
        Body size: 4
        Type ID: Set Chunk Size (0x01)
        Stream ID: 0
    RTMP Body
        Chunk size: 4000
Real Time Messaging Protocol (AMF0 Command _result('NetConnection.Connect.Success'))
    Call for this response in frame: 1018
    RTMP Header
        00.. .... = Format: 0
        ..00 0011 = Chunk Stream ID: 3
        Timestamp: 0
        Body size: 190
        Type ID: AMF0 Command (0x14)
        Stream ID: 0
    RTMP Body
        String '_result'
            AMF0 type: String (0x02)
            String length: 7
            String: _result
        Number 1
            AMF0 type: Number (0x00)
            Number: 1
        Object (2 items)
            AMF0 type: Object (0x03)
            Property 'fmsVer' String 'FMS/3,0,1,123'
            Property 'capabilities' Number 31
            End Of Object Marker
        Object (4 items)
            AMF0 type: Object (0x03)
            Property 'level' String 'status'
            Property 'code' String 'NetConnection.Connect.Success'
            Property 'description' String 'Connection succeeded.'
            Property 'objectEncoding' Number 0
            End Of Object Marker
Real Time Messaging Protocol (AMF0 Command releaseStream('1'))
    RTMP Header
        01.. .... = Format: 1
        ..00 0011 = Chunk Stream ID: 3
        Timestamp delta: 0
        Timestamp: 0 (calculated)
        Body size: 30
        Type ID: AMF0 Command (0x14)
    RTMP Body
        String 'releaseStream'
            AMF0 type: String (0x02)
            String length: 13
            String: releaseStream
        Number 2
            AMF0 type: Number (0x00)
            Number: 2
        Null
            AMF0 type: Null (0x05)
        String '1'
            AMF0 type: String (0x02)
            String length: 1
            String: 1
Real Time Messaging Protocol (AMF0 Command FCPublish('1'))
    RTMP Header
        01.. .... = Format: 1
        ..00 0011 = Chunk Stream ID: 3
        Timestamp delta: 0
        Timestamp: 0 (calculated)
        Body size: 26
        Type ID: AMF0 Command (0x14)
    RTMP Body
        String 'FCPublish'
            AMF0 type: String (0x02)
            String length: 9
            String: FCPublish
        Number 3
            AMF0 type: Number (0x00)
            Number: 3
        Null
            AMF0 type: Null (0x05)
        String '1'
            AMF0 type: String (0x02)
            String length: 1
            String: 1
Real Time Messaging Protocol (AMF0 Command createStream())
    Response to this call in frame: 1026
    RTMP Header
        01.. .... = Format: 1
        ..00 0011 = Chunk Stream ID: 3
        Timestamp delta: 0
        Timestamp: 0 (calculated)
        Body size: 25
        Type ID: AMF0 Command (0x14)
    RTMP Body
        String 'createStream'
            AMF0 type: String (0x02)
            String length: 12
            String: createStream
        Number 4
            AMF0 type: Number (0x00)
            Number: 4
        Null
            AMF0 type: Null (0x05)
Real Time Messaging Protocol (AMF0 Command _result())
    Call for this response in frame: 1025
    RTMP Header
        00.. .... = Format: 0
        ..00 0011 = Chunk Stream ID: 3
        Timestamp: 0
        Body size: 29
        Type ID: AMF0 Command (0x14)
        Stream ID: 0
    RTMP Body
        String '_result'
            AMF0 type: String (0x02)
            String length: 7
            String: _result
        Number 4
            AMF0 type: Number (0x00)
            Number: 4
        Null
            AMF0 type: Null (0x05)
        Number 1
            AMF0 type: Number (0x00)
            Number: 1
Real Time Messaging Protocol (AMF0 Command publish('1'))
    RTMP Header
        00.. .... = Format: 0
        ..00 0100 = Chunk Stream ID: 4
        Timestamp: 0
        Body size: 31
        Type ID: AMF0 Command (0x14)
        Stream ID: 1
    RTMP Body
        String 'publish'
            AMF0 type: String (0x02)
            String length: 7
            String: publish
        Number 5
            AMF0 type: Number (0x00)
            Number: 5
        Null
            AMF0 type: Null (0x05)
        String '1'
            AMF0 type: String (0x02)
            String length: 1
            String: 1
        String 'live'
            AMF0 type: String (0x02)
            String length: 4
            String: live
Real Time Messaging Protocol (AMF0 Command onStatus('NetStream.Publish.Start'))
    RTMP Header
        00.. .... = Format: 0
        ..00 0101 = Chunk Stream ID: 5
        Timestamp: 0
        Body size: 105
        Type ID: AMF0 Command (0x14)
        Stream ID: 1
    RTMP Body
        String 'onStatus'
            AMF0 type: String (0x02)
            String length: 8
            String: onStatus
        Number 0
            AMF0 type: Number (0x00)
            Number: 0
        Null
            AMF0 type: Null (0x05)
        Object (3 items)
            AMF0 type: Object (0x03)
            Property 'level' String 'status'
            Property 'code' String 'NetStream.Publish.Start'
            Property 'description' String 'Start publishing'
            End Of Object Marker
Real Time Messaging Protocol (AMF0 Data @setDataFrame())
    RTMP Header
        00.. .... = Format: 0
        ..00 0100 = Chunk Stream ID: 4
        Timestamp: 0
        Body size: 399
        Type ID: AMF0 Data (0x12)
        Stream ID: 1
    RTMP Body
        String '@setDataFrame'
            AMF0 type: String (0x02)
            String length: 13
            String: @setDataFrame
        String 'onMetaData'
            AMF0 type: String (0x02)
            String length: 10
            String: onMetaData
        ECMA array (20 items)
            AMF0 type: ECMA array (0x08)
            Array length: 20
            Property 'duration' Number 0
            Property 'fileSize' Number 0
            Property 'width' Number 1280
            Property 'height' Number 720
            Property 'videocodecid' String 'avc1'
            Property 'videodatarate' Number 2500
            Property 'framerate' Number 30
            Property 'audiocodecid' String 'mp4a'
            Property 'audiodatarate' Number 160
            Property 'audiosamplerate' Number 44100
            Property 'audiosamplesize' Number 16
            Property 'audiochannels' Number 2
            Property 'stereo' Boolean true
            Property '2.1' Boolean false
            Property '3.1' Boolean false
            Property '4.0' Boolean false
            Property '4.1' Boolean false
            Property '5.1' Boolean false
            Property '7.1' Boolean false
            Property 'encoder' String 'obs-output module (libobs version 24.0.6)'
            End Of Object Marker
Real Time Messaging Protocol (Audio Data)
    RTMP Header
        00.. .... = Format: 0
        ..00 0100 = Chunk Stream ID: 4
        Timestamp: 0
        Body size: 4
        Type ID: Audio Data (0x08)
        Stream ID: 1
    RTMP Body
        Control: 0xaf (HE-AAC 44 kHz 16 bit stereo)
        Audio data: 001210
Real Time Messaging Protocol (Video Data)
    RTMP Header
        00.. .... = Format: 0
        ..00 0100 = Chunk Stream ID: 4
        Timestamp: 0
        Body size: 45
        Type ID: Video Data (0x09)
        Stream ID: 1
    RTMP Body
        Control: 0x17 (keyframe H.264)
        Video data: 000000000164001fffe100196764001facd9405005ba1000…
Real Time Messaging Protocol (Video Data)
    RTMP Header
        01.. .... = Format: 1
        ..00 0100 = Chunk Stream ID: 4
        Timestamp delta: 33
        Timestamp: 33 (calculated)
        Body size: 49
        Type ID: Video Data (0x09)
    RTMP Body
        Control: 0x27 (inter-frame H.264)
        Video data: 0100004200000028419e42426f00000300006d1eaa0001ad…
Real Time Messaging Protocol (AMF0 Command FCUnpublish())
    RTMP Header
        01.. .... = Format: 1
        ..00 0011 = Chunk Stream ID: 3
        Timestamp delta: 0
        Timestamp: 25480792 (calculated)
        Body size: 28
        Type ID: AMF0 Command (0x14)
    RTMP Body
        String 'FCUnpublish'
            AMF0 type: String (0x02)
            String length: 11
            String: FCUnpublish
        Number 6
            AMF0 type: Number (0x00)
            Number: 6
        Null
            AMF0 type: Null (0x05)
        String '1'
            AMF0 type: String (0x02)
            String length: 1
            String: 1
Real Time Messaging Protocol (AMF0 Command deleteStream())
    RTMP Header
        01.. .... = Format: 1
        ..00 0011 = Chunk Stream ID: 3
        Timestamp delta: 0
        Timestamp: 25480792 (calculated)
        Body size: 34
        Type ID: AMF0 Command (0x14)
    RTMP Body
        String 'deleteStream'
            AMF0 type: String (0x02)
            String length: 12
            String: deleteStream
        Number 7
            AMF0 type: Number (0x00)
            Number: 7
        Null
            AMF0 type: Null (0x05)
        Number 1
            AMF0 type: Number (0x00)
            Number: 1
Real Time Messaging Protocol (AMF0 Command onStatus('NetStream.Unpublish.Success'))
    RTMP Header
        00.. .... = Format: 0
        ..00 0101 = Chunk Stream ID: 5
        Timestamp: 0
        Body size: 108
        Type ID: AMF0 Command (0x14)
        Stream ID: 1
    RTMP Body
        String 'onStatus'
            AMF0 type: String (0x02)
            String length: 8
            String: onStatus
        Number 0
            AMF0 type: Number (0x00)
            Number: 0
        Null
            AMF0 type: Null (0x05)
        Object (3 items)
            AMF0 type: Object (0x03)
            Property 'level' String 'status'
            Property 'code' String 'NetStream.Unpublish.Success'
            Property 'description' String 'Stop publishing'
            End Of Object Marker

你可能感兴趣的:(rtmp,rtmp,流媒体,直播,音视频)