【部落格只是做個記錄,技術性不強,能給遊客提供協助,最好不過。錯誤或模稜兩可的地方,還望不吝斧正。——寫在前面】
記錄的資訊,不一定只適用於MP4容器,僅僅是修複該類型容器的檔案時,查到的一些資訊。
1. FOURCC : "avc1" "H264" "h264" ……有什麼不同呢?來自於:http://msdn.microsoft.com/en-us/library/dd757808(v=vs.85).aspx(建議直接看原文)
The following media subtypes are definedfor H.264 video.
H.264Bitstream with Start Codes
H.264 bitstreams that are transmittedover the air, or contained in MPEG-2 program or transport streams, or recordedon HD-DVD, are formatted as described in Annex B of ITU-T Rec. H.264. Accordingto this specification, the bitstream
consists of a sequence of networkabstraction layer units (NALUs), each of which is prefixed with a start codeequal to 0x000001 or 0x00000001.
specifiedtypes : MEDIASUBTYPE_H264, MEDIASUBTYPE_h264, MEDIASUBTYPE_X264,or MEDIASUBTYPE_x264
H.264Bitstream Without Start Codes
The MP4 container format stores H.264data without start codes.Instead, each NALU is prefixed by a length field, which gives the length of theNALU in bytes. The size of the length field can vary, but
is typically 1, 2, or4 bytes.
specified types : MEDIASUBTYPE_AVC1
【也因此,parse某些容器時,對於264的有這樣的標記:V_H264_AVC,V_H264_ANNEXB.】
The MP4 container might containsequence parameter sets (SPS) or picture parameter sets (PPS) as special NALunits in file headers or in a separate stream (distinct from the video stream).When the format is established, the media
type can specify SPS and PPS NALunits in the dwSequenceHeader array.If cbSequenceHeader isgreater than zero, dwSequenceHeader isthe start of a byte array containing SPS and PPS NALUs, delimited by 2-bytelength
fields, all in network byte order (big-endian). It is possible to haveboth SPS and PPS, only one of these types, or none. The actual type of eachNALU can be determined by examining the nal_unit_type fieldof the NALU itself.
When this media type is used, eachmedia sample starts at the beginning of a NALU, and NAL units do not spansamples. This enables the decoder to recover from data corruption or droppedsamples.