2011-02-10 196 views
0

我想在flv文件中寫入audiodata。任何人都可以幫助解釋這個嗎?

我發現FLV視頻標籤的結構是

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 frame, 3: disposable inter frame 

而在Flex代碼它是這樣寫的

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

所以這是什麼意思?它們是以十六進制值0X13來描述frametype和codecid嗎?

音頻

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 
+0

這究竟是什麼0xAF?你能否詳細說明一下你想要做什麼以及它如何處理字節? – Maurycy 2011-02-10 09:54:34

+0

@上:編輯我的問題.. – karthick 2011-02-10 10:10:58

回答

1

是。 (byte & 0x0f) >> 0意味着codecID包含在byte的低四位(十六進制  f   =  二進制  1111)。同樣,(byte & 0xf0) >> 4表示frameType存儲在byte的高4位中。因此,0x13中的1是幀類型(關鍵幀),3是codecID(屏幕視頻)。

相關問題