WIP fix: Skip NAL header byte when reading SPS profile data in HlsMuxer #20

Open
dean wants to merge 2 commits from fix/hlsmuxer-codec-string into main
Member

The SPS NAL unit format is: [NAL header, profile_idc, constraint_flags, level_idc, ...]
The code was incorrectly reading from byte 0 (NAL header, typically 0x67)
instead of byte 1 (profile_idc).

This produced invalid codec strings like avc1.676400 instead of valid
ones like avc1.64001f, causing Shaka Player on web to fail with error
4032 (unable to parse codec).

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

What

Changes

Tested on

The SPS NAL unit format is: [NAL header, profile_idc, constraint_flags, level_idc, ...] The code was incorrectly reading from byte 0 (NAL header, typically 0x67) instead of byte 1 (profile_idc). This produced invalid codec strings like `avc1.676400` instead of valid ones like `avc1.64001f`, causing Shaka Player on web to fail with error 4032 (unable to parse codec). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> <!-- ❤️ Thank you for your contribution! ❤️ Make sure you have read the Contributing Guidelines: https://github.com/mrousavy/react-native-vision-camera/blob/main/CONTRIBUTING.md --> ## What <!-- Enter a short description on what this pull-request does. Examples: This PR adds support for the HEVC format. This PR fixes a "unsupported device" error on iPhone 8 and below. This PR fixes a typo in a CameraError. This PR adds support for Quadruple Cameras. --> ## Changes <!-- Create a short list of logic-changes. Examples: * This PR changes the default value of X to Y. * This PR changes the configure() function to cache results. --> ## Tested on <!-- Create a short list of devices and operating-systems you have tested this change on. (And verified that everything works as expected). Examples: * iPhone 11 Pro, iOS 14.3 * Huawai P20, Android 10 --> ## Related issues <!-- Link related issues here. Examples: * Fixes #29 * Closes #30 * Resolves #5 -->
dean added 1 commit 2026-01-13 19:52:32 +00:00
The SPS NAL unit format is: [NAL header, profile_idc, constraint_flags, level_idc, ...]
The code was incorrectly reading from byte 0 (NAL header, typically 0x67)
instead of byte 1 (profile_idc).

This produced invalid codec strings like `avc1.676400` instead of valid
ones like `avc1.64001f`, causing Shaka Player on web to fail with error
4032 (unable to parse codec).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
dean changed title from fix: Skip NAL header byte when reading SPS profile data in HlsMuxer to WIP fix: Skip NAL header byte when reading SPS profile data in HlsMuxer 2026-01-13 20:12:08 +00:00
dean added 1 commit 2026-01-13 20:22:48 +00:00
The codec string fix caused videos to appear squished on web players
like Shaka. Adding an explicit pixel aspect ratio (pasp) box with
1:1 ratio tells the player not to apply any SAR scaling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/hlsmuxer-codec-string:fix/hlsmuxer-codec-string
git checkout fix/hlsmuxer-codec-string
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: railbird/react-native-vision-camera#20
No description provided.