您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
919 B

  1. ref https://stackoverflow.com/questions/53992918/about-fmp4-encoding-how-to-fill-the-mdat-box-wit-h264-frame?r=SearchResults
  2. H.264 can be in different stream formats. One is called "Annex B" the other one is MP4. In "Annex B" your NAL units are prefix with start codes 00 00 00 01 or 00 00 01. In MP4 your NAL units are prefixed with the size in bytes.
  3. I assume your encoder emits "Annex B".
  4. Remove the start code (00) 00 00 01
  5. Prefix your NAL units with the size (typically 4 bytes)
  6. Filter out AUD/SPS/PPS NAL units from your stream
  7. Write you converted NAL units into the MDAT box
  8. Create an AVC Configuration Box ('avcC') based on your SPS, PPS and the length size
  9. Store your avcC box in moov->trak->mdia->minf->stbl->avc1->avcC
  10. While you are writing your samples into mdat - keep track of sizes, offsets and frame types to create the correct stts, stss, stsc, stsz and stco boxes.