Open rogerhu opened 9 months ago
Hi Roger, it seems this PR contains the changes from #21. Is this expected?
Hi Roger, it seems this PR contains the changes from #21. Is this expected?
I just rebased! I squashed all the commits which included those PR changes.
Depends on https://github.com/noirotm/flvmeta/pull/21
I spent the last month studying how ffmpeg code handles parsing HVEC NALU's. =)
It turns out that most of the information I need has to be retrieved from the hvcc atom that's included as part of the HEVCDecoderConfigurationRecord.
A new Video Parameter Set (VPS) is added, but it contains no useful information about the video dimensions from what I can tell. The SPS needs to be parsed, but there is an emulation prevention byte 0x00003 that has to be replaced. The ffmpeg code has a lot of special ways of looking for it (including this crazy way of check for zero bytes - https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord), but I chose to extract the the least common denominator to parse it.
I implemented the logic from FFMPEG based on decode_profile_tier_level and parse_ptl.