abema / go-mp4

Go library for reading and writing MP4 file
https://dev.to/sunfishshogi/go-mp4-golang-library-and-cli-tool-for-mp4-52o1
MIT License
464 stars 30 forks source link

add hvc1 box #129

Closed aler9 closed 1 year ago

aler9 commented 1 year ago

Hello @sunfish-shogi, i thought the H265 implementation was complete but there's a box missing.

According to ISO/IEC FDIS 14496-15:2019(E), section 8.3.2:

Parameter sets: A parameter set to be used in a picture must be sent prior to the sample containing that picture or in the sample for that picture. For a video stream that a particular sample entry applies to, the video parameter set, sequence parameter sets, and picture parameter sets, shall be stored only in the sample entry when the sample entry name is ‘hvc1’, and may be stored in the sample entry and the samples when the sample entry name is ‘hev1’.

H265 has two sample entry names, the first one is 'hev1' (added in the previous PR) and the second one is 'hvc1'. 'hev1' is used when VPS/SPS/PPS are both in the track header and inside the stream, while 'hvc1' is used when VPS/SPS/PPS are in the track header only.

sunfish-shogi commented 1 year ago

Thank you for your PR! I will create release v0.10.0