开发者

Can anyone help explaining this?

开发者 https://www.devze.com 2023-02-10 04:23 出处:网络
i want to write audiodata in a flv file. I found the structure of video tag in flv to be NameExpressionDescription

i want to write audiodata in a flv file.

I found the structure of video tag in flv to be

Name  Expression  Description  
codecID  (byte & 0x0f) » 0  2: Sorensen H.263, 3: Screen video, 4: On2 VP6, 5: On2 VP6 Alpha, 6: ScreenVideo 2  
frameType  (byte & 0xf0) » 4  1: keyframe, 2: inter f开发者_开发知识库rame, 3: disposable inter frame 

And in the flex code it's written like this

// VIDEODATA 'header'
    v.writeByte(0x13); // frametype (1) + codecid (3)

so what does it mean? Are they describing the frametype and codecid in the hexadecimal value 0X13?

For Audio

soundType  (byte & 0x01) » 0  0: mono, 1: stereo  
soundSize  (byte & 0x02) » 1  0: 8-bit, 1: 16-bit  
soundRate  (byte & 0x0C) » 2  0: 5.5 kHz, 1: 11 kHz, 2: 22 kHz, 3: 44 kHz  
soundFormat  (byte & 0xf0) » 4  0: Uncompressed, 1: ADPCM, 2: MP3, 5: Nellymoser 8kHz mono, 6: Nellymoser, 11: Speex 


Yes. (byte & 0x0f) >> 0 means that codecID is contained in the lower four bits of byte (hex f = binary 1111). Similarly, (byte & 0xf0) >> 4 says that frameType is stored in the upper four bits of byte. So the 1 in 0x13 is the frame type (keyframe), and the 3 is the codecID (Screen video).

0

精彩评论

暂无评论...
验证码 换一张
取 消