i have created hevc/mp4 bit stream using ffmpeg successfully. after analysing in hex editor, not able locate vps, sps, pps data in mp4 file.
then have used lav splitter , checked output of splitter sending data of first frame not vps/sps/pps data. have gone through this link not getting . vps,sps,pps of hevc/mp4 format in directshow filter ?
can't directshow, here how can find hevc vps, sps , pps data in mp4 file using hex editor.
first, need find moov box, either located close start of file, or close end. identified 4 ascii characters: 'moov'

some bytes after this, hvcc box should indicated.

the data after gives general information hevc stream in mp4 file. format defined in iso/iec 14496-15. in short, skip next 22 bytes.

then, parse following data this:
unsigned int(8) numofarrays; (j=0; j < numofarrays; j++) { bit(1) array_completeness; unsigned int(1) reserved = 0; unsigned int(6) nal_unit_type; unsigned int(16) numnalus; (i=0; i< numnalus; i++) { unsigned int(16) nalunitlength; bit(8*nalunitlength) nalunit; } } each array corresponds set of nal units of 1 type, e.g. set of spss. vps, sps , pps, need arrays nal_unit_type equal 32, 33, , 34, respectively.

in content used example, can see 4 arrays available. first array set of nal units nal_unit_type=32(=0x20), spss. 1 sps present, , has length of 0x0018=24 bytes. sps data starts 0x40010c01.
Comments
Post a Comment