Differences between avc1 and h264

Source: Internet
Author: User

Today, when I access the Internet, I occasionally find the answer to my questions.

H.264 video types

The following media subtypes are defined for H.264 video.

Subtype Fourcc Description
Mediasubtype_avc1 'Avc1' H. 264 bitstream without start codes.
Mediasubtype_h264 'H264' H. 264 bitstream with start codes.
Mediasubtype_h264 'H264' Equivalent to mediasubtype_h264, with a different fourcc.
Mediasubtype_x264 'X264' Equivalent to mediasubtype_h264, with a different fourcc.
Mediasubtype_x264 'X264' Equivalent to mediasubtype_h264, with a different fourcc.

The main difference between these media types is the presence of startcodes in the bitstream. If the subtype is mediasubtype_avc1, thebitstream does not contain start codes.

H.264 bitstream without start Codes

The MP4 container format stores H. 264 data without start codes. instead, each NALU is prefixed by a length field, which gives thelength of the nalu in bytes. the size of the length field can vary, butis typically 1, 2, or 4 bytes.

When start codes are not present in the bitstream, the following media type is used.

Major type Mediatype_video
Subtype Mediasubtype_avc1
Format type Format_mpeg2video

 

The format block is
Mpeg2videoinfoStructure. This structure shocould be filled in as follows:

  • HDR:
    Videoinfoheader2Structure that describes the bitstream. No color table is present after
    BitmapinfoheaderPortion of the structure, and
    BiclrusedMust be zero.
  • Dwstarttimecode: Not used. set to zero.
  • Cbsequenceheader: The length ofDwsequenceheaderArray in bytes.
  • Dwprofile: Specifies the H.264 profile.
  • Dwlevel: Specifies the H.264 level.
  • Dwflags: The number of bytes used for the length field that appears before each
    Nalu. The length field indicates the size of the following NALU in bytes. For example, if
    DwflagsIs 4, each NALU is preceded by a 4-byte length field. The valid values are 1, 2, and 4.
  • Dwsequenceheader: A byte array that may contain sequence parameter set (SPS) and picture parameter set (PPS) nalus.

The MP4 container might sequin sequence parameter sets (SPS) orpicture parameter sets (PPS) as Special NAL units in file headers or Ina separate stream (distinct from the video stream ). when the format isestablished, the media type can specify SPS and PPS
NAL units inDwsequenceheaderArray. IfCbsequenceheaderIs greater than zero,
DwsequenceheaderIs the start of a byte array containing SPS and PPS nalus, delimited by2-byte length fields, all in network byte order (big-Endian ). it ispossible to have both SPs and PPS, only one of these types, or none. the actual type
Each NALU can be determined by examining thenal_unit_type field of the nalu itself.

When this media type is used, each media sample starts at thebeginning of A nalu, and NAL units do not span samples. This enablesthe decoder to recover from data preview uption or dropped samples.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.