当前位置: 首页 > news >正文

网站图片切换初学者怎么制作平面图

网站图片切换,初学者怎么制作平面图,我的钢铁网网站架构,百度竞价排名查询目录(?)[-] OverviewFile Structure The FLV headerThe FLV File BodyFLV Tag Definition FLVTAGAudio TagsVideo TagsSCRIPTDATA onMetaDatakeyframes Overview Flash Video(简称FLV),是一种流行的网络格式。目前国内外大部分视频分享网站都是采用的这种格式. File Structure…   目录(?)[-] OverviewFile Structure The FLV headerThe FLV File BodyFLV Tag Definition FLVTAGAudio TagsVideo TagsSCRIPTDATA onMetaDatakeyframes Overview Flash Video(简称FLV),是一种流行的网络格式。目前国内外大部分视频分享网站都是采用的这种格式. File Structure 从整个文件上开看,FLV是由The FLV header 和 The FLV File Body 组成. 1.The FLV header FieldTypeCommentSignatureUI8Signature byte always F (0x46)SignatureUI8Signature byte always L (0x4C)SignatureUI8Signature byte always V (0x56)VersionUI8File version (for example, 0x01 for FLV version 1)TypeFlagsReservedUB [5]Shall be 0TypeFlagsAudioUB [1]1 Audio tags are presentTypeFlagsReservedUB [1]Shall be 0TypeFlagsVideoUB [1]1 Video tags are presentDataOffsetUI32The length of this header in bytes Signature: FLV 文件的前3个字节为固定的‘F’‘L’‘V’,用来标识这个文件是flv格式的.在做格式探测的时候 如果发现前3个字节为“FLV”就认为它是flv文件. Version: 第4个字节表示flv版本号. Flags: 第5个字节中的第0位和第2位,分别表示 video 与 audio 存在的情况.(1表示存在,0表示不存在) DataOffset : 最后4个字节表示FLV header 长度. 2.The FLV File Body FieldTypeCommentPreviousTagSize0UI32Always 0Tag1FLVTAGFirst tagPreviousTagSize1UI32 Size of previous tag, including its header, in bytes. For FLV version1, this value is 11 plus the DataSize of the previous tag. Tag2FLVTAGSecond tag.........PreviousTagSizeN-1UI32Size of second-to-last tag, including its header, in bytes.TagNFLVTAGLast tagPreviousTagSizeNUI32Size of last tag, including its header, in bytes FLV header之后,就是 FLV File Body. FLV File Body是由一连串的back-pointers tags构成.back-pointers就是4个字节数据,表示前一个tag的size. FLV Tag Definition FLV文件中的数据都是由一个个TAG组成,TAG里面的数据可能是video、audio、scripts. 下表是TAG的结构: 1.FLVTAG FieldTypeCommentReservedUB [2]Reserved for FMS, should be 0FilterUB [1]Indicates if packets are filtered. 0 No pre-processing required. 1 Pre-processing (such as decryption) of the packet is required before it can be rendered. Shall be 0 in unencrypted files, and 1 for encrypted tags. See Annex F. FLV Encryption for the use of filters.TagTypeUB [5] Type of contents in this tag. The following types are defined: 8 audio 9 video 18 script data DataSizeUI24Length of the message. Number of bytes after StreamID to end of tag (Equal to length of the tag – 11)TimestampUI24Time in milliseconds at which the data in this tag applies. This value is relative to the first tag in the FLV file, which always has a timestamp of 0.TimestampExtendedUI8Extension of the Timestamp field to form a SI32 value. This field represents the upper 8 bits, while the previous Timestamp field represents the lower 24 bits of the time in milliseconds.StreamIDUI24Always 0.AudioTagHeaderIF TagType 8 AudioTagHeaderVideoTagHeaderIF TagType 9 VideoTagHeaderEncryptionHeaderIF Filter 1 EncryptionTagHeaderFilterParamsIF Filter 1 FilterParamsDataIF TagType 8 AUDIODATA IF TagType 9 VIDEODATA IF TagType 18 SCRIPTDATAData specific for each media type. TagType: TAG中第1个字节中的前5位表示这个TAG中包含数据的类型,8 audio,9 video,18 script data. DataSize:StreamID之后的数据长度. Timestamp和TimestampExtended组成了这个TAG 包数据的PTS信息,记得刚开始做FVL demux的时候并没有考虑TimestampExtended的值,直接就把Timestamp默认为是PTS后来发生的现 象就是画面有跳帧的现象,后来才仔细看了一下文档发现真正数据的PTS是PTS Timestamp | TimestampExtended24. StreamID之后的数据就是每种格式的情况不一样了接下格式进行详细的介绍. Audio Tags 如果TAG包中的TagType8时就表示这个TAG是audio。 StreamID之后的数据就表示是AudioTagHeaderAudioTagHeader结构如下 FieldTypeCommentSoundFormatUB [4]Format of SoundData. The following values are defined: 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 Formats 7, 8, 14, and 15 are reserved. AAC is supported in Flash Player 9,0,115,0 and higher. Speex is supported in Flash Player 10 and higher.SoundRateUB [2]Sampling rate. The following values are defined: 0 5.5 kHz 1 11 kHz 2 22 kHz 3 44 kHzSoundSizeUB [1] Size of each audio sample. This parameter only pertains to uncompressed formats. Compressed formats always decode to 16 bits internally. 0 8-bit samples 1 16-bit samples SoundTypeUB [1]Mono or stereo sound 0 Mono sound 1 Stereo soundAACPacketTypeIF SoundFormat 10 UI8The following values are defined: 0 AAC sequence header 1 AAC raw AudioTagHeader的头1个字节也就是接跟着StreamID的1个字节包含着音频类型、采样率等的基本信息.表里列的十分清楚. AudioTagHeader之后跟着的就是AUDIODATA数据了也就是audio payload 但是这里有个特例如果音频格式SoundFormat是10 AACAudioTagHeader中会多出1个字节的数据AACPacketType这个字段来表示AACAUDIODATA的类型0 AAC sequence header1 AAC raw。 FieldTypeCommentData IF AACPacketType 0 AudioSpecificConfig The AudioSpecificConfig is defined in ISO14496-3. Note that this is not the same as the contents of the esds box from an MP4/F4V file. ELSE IF AACPacketType 1 Raw AAC frame data in UI8 [ ] audio payload AAC sequence header也就是包含了AudioSpecificConfigAudioSpecificConfig包含着一些更加详细音频的信息AudioSpecificConfig的定义在ISO14496-3中1.6.2.1 AudioSpecificConfig这里就不详细贴了。而且在ffmpeg中有对AudioSpecificConfig解析的函数ff_mpeg4audio_get_config(),可以对比的看一下理解更深刻。 AAC raw 这种包含的就是音频ES流了也就是audio payload. 在FLV的文件中一般情况下 AAC sequence header 这种包只出现1次而且是第一个audio tag为什么要提到这种tag因为当时在做FLVdemux的时候如果是AAC的音频需要在每帧AAC ES流前边添加7个字节ADST头,ADST在音频的格式中会详细解读这是解码器通用的格式就是AAC的纯ES流要打包成ADST格式的AAC文件解码器才能正常播放.就是在打包ADST的时候需要samplingFrequencyIndex这个信息samplingFrequencyIndex最准确的信息是在AudioSpecificConfig中所以就对AudioSpecificConfig进行解析并得到了samplingFrequencyIndex。 到这步你就完全可以把FLV 文件中的音频信息及数据提取出来送给音频解码器正常播放了。 Video Tags 如果TAG包中的TagType9时就表示这个TAG是video. StreamID之后的数据就表示是VideoTagHeaderVideoTagHeader结构如下 FieldTypeCommentFrame TypeUB [4]Type of video frame. The following values are defined: 1 key frame (for AVC, a seekable frame) 2 inter frame (for AVC, a non-seekable frame) 3 disposable inter frame (H.263 only) 4 generated key frame (reserved for server use only) 5 video info/command frameCodecIDUB [4]Codec Identifier. The following values are defined: 2 Sorenson H.263 3 Screen video 4 On2 VP6 5 On2 VP6 with alpha channel 6 Screen video version 2 7 AVCAVCPacketTypeIF CodecID 7 UI8 The following values are defined: 0 AVC sequence header 1 AVC NALU 2 AVC end of sequence (lower level NALU sequence ender is not required or supported) CompositionTimeIF CodecID 7 SI24IF AVCPacketType 1 Composition time offset ELSE 0 See ISO 14496-12, 8.15.3 for an explanation of composition times. The offset in an FLV file is always in milliseconds. VideoTagHeader的头1个字节也就是接跟着StreamID的1个字节包含着视频帧类型及视频CodecID最基本信息.表里列的十分清楚. VideoTagHeader之后跟着的就是VIDEODATA数据了也就是video payload.当然就像音频AAC一样这里也有特例就是如果视频的格式是AVCH.264的话VideoTagHeader会多出4个字节的信息. AVCPacketType 和 CompositionTime。AVCPacketType 表示接下来 VIDEODATA AVCVIDEOPACKET的内容 IF AVCPacketType 0 AVCDecoderConfigurationRecordAVC sequence header IF AVCPacketType 1 One or more NALUs (Full frames are required) AVCDecoderConfigurationRecord.包含着是H.264解码相关比较重要的sps和pps信息再给AVC解码器送数据 流之前一定要把sps和pps信息送出否则的话解码器不能正常解码。而且在解码器stop之后再次start之前如seek、快进快退状态切换等都 需要重新送一遍sps和pps的信息.AVCDecoderConfigurationRecord在FLV文件中一般情况也是出现1次也就是第一个 video tag. AVCDecoderConfigurationRecord的定义在ISO 14496-15, 5.2.4.1中这里不在详细贴 SCRIPTDATA 如果TAG包中的TagType18时就表示这个TAG是SCRIPT. SCRIPTDATA 结构十分复杂定义了很多格式类型每个类型对应一种结构. FieldTypeCommentTypeUI8Type of the ScriptDataValue. The following types are defined: 0 Number 1 Boolean 2 String 3 Object 4 MovieClip (reserved, not supported) 5 Null 6 Undefined 7 Reference 8 ECMA array 9 Object end marker 10 Strict array 11 Date 12 Long stringScriptDataValueIF Type 0 DOUBLE IF Type 1 UI8 IF Type 2 SCRIPTDATASTRING IF Type 3 SCRIPTDATAOBJECT IF Type 7 UI16 IF Type 8 SCRIPTDATAECMAARRAY IF Type 10 SCRIPTDATASTRICTARRAY IF Type 11 SCRIPTDATADATE IF Type 12 SCRIPTDATALONGSTRINGScript data value. The Boolean value is (ScriptDataValue ≠ 0). 类型在FLV的官方文档中都有详细介绍. onMetaData onMetaData 是SCRIPTDATA中对我们来说十分重要的信息结构如下表 Property NameTypeCommentaudiocodecidNumberAudio codec ID used in the file (see E.4.2.1 for available SoundFormat values)audiodatarateNumberAudio bit rate in kilobits per secondaudiodelayNumberDelay introduced by the audio codec in secondsaudiosamplerateNumberFrequency at which the audio stream is replayedaudiosamplesizeNumberResolution of a single audio samplecanSeekToEndBooleanIndicating the last video frame is a key framecreationdateStringCreation date and timedurationNumberTotal duration of the file in secondsfilesizeNumberTotal size of the file in bytesframerateNumberNumber of frames per secondheightNumberHeight of the video in pixelsstereoBooleanIndicating stereo audiovideocodecidNumberVideo codec ID used in the file (see E.4.3.1 for available CodecID values)videodatarateNumberVideo bit rate in kilobits per secondwidthNumberWidth of the video in pixels 这里面的duration、filesize、视频的width、height等这些信息对我们来说很有用. keyframes 当时在做flv demux的时候发现官方的文档中并没有对keyframes index做描述但是flv的这种结构每个tag又不像TS有同步头如果没有keyframes index 的话seek及快进快退的效果会非常差因为需要一个tag一个tag的顺序读取。后来通过网络查一些资料发现了一个keyframes的信息藏在SCRIPTDATA中。 keyframes几乎是一个非官方的标准也就是民间标准.在网上已经很 难看到flv文件格式但是metadata里面不包含 keyframes项目的视频 . 两个常用的操作metadata的工具是flvtool2和FLVMDI都是把keyframes作为一个默认的元信息项目.在FLVMDI的主页 (http://www.buraks.com/flvmdi/)上有描述 keyframes: (Object) This object is added only if you specify the /k switch. keyframes is known to FLVMDI and if /k switch is not specified, keyframes object will be deleted. keyframes object has 2 arrays: filepositions and times. Both arrays have the same number of elements, which is equal to the number of key frames in the FLV. Values in times array are in seconds. Each correspond to the timestamp of the nth key frame. Values in filepositions array are in bytes. Each correspond to the fileposition of the nth key frame video tag (which starts with byte tag type 9). 也就是说keyframes中包含着2个内容 filepositions and times分别指的是关键帧的文件位置和关键帧的PTS.通过keyframes可以建立起自己的Index然后再seek和快进快退的操作中快速有效的跳转到你想要找的关键帧的位置进行处理。
http://www.dnsts.com.cn/news/61498.html

相关文章:

  • 购物网站首页图片wordpress cdn登录
  • 网站开发文档模板下载google推广方式和手段有哪些
  • 郑州做网站价格公司没有网站如何做外贸
  • 电子商务网站建设实践报告wordpress页面和文章
  • 网站头部怎么做瑞安做网站建设哪家好
  • 手机购物网站模板网站字体 font-family
  • 网页和网站做哪个好用吗网站运营推广怎做
  • 没有公司怎么做网站wordpress 自定义文章排序
  • 网页建站网站导航网源码
  • 深圳网站推广公司建立网站一般要多少钱
  • 手机网站微信登录接口用c语言做公司网站
  • 深圳网站建设哪个公司好网站建设模板源码特效
  • 焊枪公司网站怎么做品牌网上做推广
  • 混沌鸿蒙网站建设温州集团网站建设公司
  • 触屏网站模板免费站推广网站2022
  • 开网站怎么开网站流量钱是谁给的
  • 做网站和做微商城有什么区别查询网站怎么做的
  • 网站片头怎么做企业官方网站是什么
  • 个人阿里云账号可以做网站备案电子商务网站运营
  • 建国外网站需要多少钱怎么打开手机app
  • 建筑专业网站泰安那家网好
  • mvc6 网站开发实战推广过程
  • 网站开发到上线的流程福田做商城网站建设哪家公司便宜点
  • 马家堡网站建设大型h5手游平台
  • 中国新农村建设促进会网站顺德网站建设收费标准
  • 贵州省安顺市网站建设网站访客
  • 微信 网站 织梦自己做网站做外贸可以吗
  • 山东食品行业网站模板百度广告联盟电话
  • 延庆网站建设天津专业网站制作设计
  • 哪个网站做图找图片网站做视频在线观看网址