一些記錄 when dealing with MP4 container

來源:互聯網
上載者:User

【部落格只是做個記錄,技術性不強,能給遊客提供協助,最好不過。錯誤或模稜兩可的地方,還望不吝斧正。——寫在前面】

 

記錄的資訊,不一定只適用於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_H264MEDIASUBTYPE_h264MEDIASUBTYPE_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.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.