flv格式用什么打开 打开flv格式的播放器( 四 )


ScriptTagBody onMetaData;onMetaData.Name.Type == 0x02onMetaData.Name.ScriptDataValue.StringLength == 0x000AonMetaData.Name.ScriptDataValue.StringData =https://www.0579wy.com/article/= /"onMetaData\"onMetaData.Value.Type == 0x08onMetaData.Value.ScriptDataValue.ECMAArrayLength == onMetaData.Value.ScriptDataValue.Variables[0].PropertyName == {0x0005, \"width\"}// SCRIPTDATASTRING 类型onMetaData.Value.ScriptDataValue.Variables[0].PropertyData =https://www.0579wy.com/article/= {0x00, 1280.0}// SCRIPTDATAVALUE 类型onMetaData.Value.ScriptDataValue.Variables[1].PropertyName == {0x0005, /"height\"} // SCRIPTDATASTRING 类型onMetaData.Value.ScriptDataValue.Variables[1].PropertyData =https://www.0579wy.com/article/= {0x00, 720.0}// SCRIPTDATAVALUE 类型...4. 总结
FLV 结构如下图所示:

flv格式用什么打开 打开flv格式的播放器

文章插图
flv格式用什么打开 打开flv格式的播放器

文章插图
在 C 语言中定义 FLV 文件结构,一目了然:
【flv格式用什么打开 打开flv格式的播放器】/* * @brief flv file header 9 bytes */typedef struct flv_header {uint8_t signature[3];uint8_t version;uint8_t type_flags;uint32_t data_offset; // header size, always 9} __attribute__((__packed__)) flv_header_t;/* * @brief flv tag general header 11 bytes */typedef struct flv_tag {uint8_t tag_type;uint32_t data_size;uint32_t timestamp;uint8_t timestamp_ext;uint32_t stream_id;void *data; // will point to an audio_tag or video_tag}flv_tag_t;typedef struct audio_tag {uint8_t sound_format; // 0 - raw, 1 - ADPCM, 2 - MP3, 4 - Nellymoser 16 KHz mono, 5 - Nellymoser 8 KHz mono, 10 - AAC, 11 - Speexuint8_t sound_rate; // 0 - 5.5 KHz, 1 - 11 KHz, 2 - 22 KHz, 3 - 44 KHzuint8_t sound_size; // 0 - 8 bit, 1 - 16 bituint8_t sound_type; // 0 - mono, 1 - stereovoid *data;}audio_tag_t;typedef struct video_tag {uint8_t frame_type;uint8_t codec_id;void *data;}video_tag_t;typedef struct avc_video_tag {uint8_t avc_packet_type; // 0x00 - AVC sequence header, 0x01 - AVC NALUuint32_t composition_time;uint32_t nalu_len;void *data;}avc_video_tag_t;

推荐阅读