框架三:rtmp 负载数据格式

2020-09-15  本文已影响0人  Wonton_skin

1、rtmp 负载数据格式,实际上就是 flv tag 格式,flv格式详情可参考 “video_file_format_spec_v10.pdf” 。

2、Video FLV Tag

2.1、FrameType(4bit)
        1: keyframe (for AVC, a seekable frame)
        2: inter frame (for AVC, a nonseekable frame)
        3: disposable inter frame (H.263 only)
        4: generated keyframe (reserved for server use only)
        5: video info/command frame

2.2、CodecID(4bit)   
        1: JPEG (currently unused)
        2: Sorenson H.263
        3: Screen video
        4: On2 VP6
        5: On2 VP6 with alpha channel
        6: Screen video version 2
        7: AVC

    2.3、VideoData

    If CodecID == 2
        H263VIDEOPACKET
    If CodecID == 3
        SCREENVIDEOPACKET
    If CodecID == 4
        VP6FLVVIDEOPACKET
    If CodecID == 5
        VP6FLVALPHAVIDEOPACKET
    If CodecID == 6
        SCREENV2VIDEOPACKET
    if CodecID == 7
        AVCVIDEOPACKET

2.3.1、AVCPacketType(1B)
        0: AVC sequence header
        1: AVC NALU
        2: AVC end of sequence (lower level NALU sequence ender is not required or supported)

2.3.2、CompositionTime(3B)
    if AVCPacketType == 1
        Composition time offset
    else
        0

2.3.3、Data
    if AVCPacketType == 0
        AVCDecoderConfigurationRecord (详情可参考 “ISO-14496-15 AVC file format”  5.2.4.1.1 )
    else if AVCPacketType == 1
        One or more NALUs (can be individual slices per FLV packets; full frames are not strictly required)
    else if AVCPacketType == 2
        Empty    

3、Audio FLV Tag

3.1、SoundFormat(4bit)
        0 = Linear PCM, platform endian
        1 = ADPCM
        2 = MP3
        3 = Linear PCM, little endian
        4 = Nellymoser 16-kHz mono
        5 = Nellymoser 8-kHz mono
        6 = Nellymoser
        7 = G.711 A-law logarithmic PCM
        8 = G.711 mu-law logarithmic PCM
        9 = reserved
        10 = AAC
        11 = Speex
        14 = MP3 8-Khz
        15 = Device-specific sound

3.2、SoundRate(2bit)
        0 = 5.5-kHz
        1 = 11-kHz
        2 = 22-kHz
        3 = 44-kHz

3.3、SoundSize(1bit)
        0 = snd 8Bit
        1 = snd 16Bit

3.4、SoundType(1bit)
        0 = sndMono
        1 = sndStereo

3.5、SoundData

    if SoundFormat == 10
        AACAUDIODATA
    else
        Sound data—varies by format

3.5.1、AACPacketType
0: AAC sequence header
1: AAC raw

3.5.2、Data
    if AACPacketType == 0
        AudioSpecificConfig  (详情可参考 “SO-14496-3 Audio” 1.6.2.1 )
    else if AACPacketType == 1
        Raw AAC frame data

上一篇 下一篇

猜你喜欢

热点阅读