Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set description to undefined if decode fails #130

Merged

Conversation

therishidesai
Copy link
Contributor

For H264 annexb format description is undefined since SPS/PPS are defined in the NALUs before a keyframe

@kixelated
Copy link
Owner

JK there's a typescript error


obj.description = Hex.decode(obj.description)
obj.description = obj.description ? Hex.decode(obj.description) : undefined
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (typeof obj.description === "string") {
  obj.description = Hex.decode(obj.description)
} else if (obj.description !== undefined) {
  return false;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on my phone on the train, untested

@therishidesai therishidesai force-pushed the rdesai/undefined-description branch from 505dd36 to 25b16d0 Compare November 19, 2024 23:59

obj.description = Hex.decode(obj.description)
obj.description = obj.description && typeof obj.description === "string" ? Hex.decode(obj.description) : undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this instead, it runs and also passes build and biome. Tested with both fMP4/AVCC and annexb

@kixelated kixelated merged commit bc78f9c into kixelated:main Nov 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants