hvcC write clears the reserved bits before min_spatial_segmentation_idc
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Read src/boxes/hvcC.ts at the hvcCBox.write() call identified in the issue and check how the 16-bit field is written. The issue author says they have a fix and plan to open a pull request, so check for that work before starting. Done means the four reserved bits are written as 1111 and the round-trip test preserves the hvcC bytes.
Written by the indexing model from the issue text.
Description
hvcCBox.write() drops the 4 reserved bits in front of min_spatial_segmentation_idc:
https://github.com/gpac/mp4box.js/blob/main/src/boxes/hvcC.ts#L89
stream.writeUint16(this.min_spatial_segmentation_idc + (15 << 24));
15 << 24 is outside the 16-bit field, so setUint16 cuts it off and the bits are written as 0000. ISO/IEC 14496-15 says bit(4) reserved = '1111'b there (the other reserved bits in the same record are written right). It should be 15 << 12.
How I hit it: I made an HEVC file with ffmpeg -f lavfi -i testsrc=d=2 -c:v libx265 -tag:v hvc1 out.mp4, parsed it with mp4box.js and wrote every box back. All boxes in stbl came back byte for byte except hvcC, where the byte after general_level_idc changed from f0 to 00. So any file mp4box.js writes with an HEVC track (e.g. segments from initializeSegmentation()) has a non-conformant hvcC.
I have a fix with a round-trip test and will open a PR.
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 390
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gpac/mp4box.js
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 32/100
gpac/mp4box.js#551 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
gpac/mp4box.js#528 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
KilledByAPixel/LittleJS#188 ·
-
enhancement
Difficulty 2/5 Under an hour Newbie friendliness 88/100
stfc/goldilocks-agent#156 ·
Maintainers usually reply within 1 day
-
Add: BRIDGE Jazz SDOpenstreams:add
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
[BUG] iOS - Share extension crashes when the shared page contains "%s" or "% s" (NSLog format string)Possibly taken @kexhest claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
achorein/expo-share-intent#244 ·