Skip to content

Conversation

@WyattBlue
Copy link
Member

Set colorspace and color_range metadata on reformatted frames

When VideoFrame.reformat() is called with explicit dst_colorspace or dst_color_range parameters, the output frame's metadata now correctly reflects these values. Previously, the swscale conversion was performed but the frame metadata was not updated.

Changes:

  • Add SWS_CS_* to AVColorSpace mapping for correct metadata translation
  • Only set frame metadata when user explicitly specifies dst parameters
  • Preserve source frame metadata when dst params are not specified

Set colorspace and color_range metadata on reformatted frames

When VideoFrame.reformat() is called with explicit dst_colorspace or
dst_color_range parameters, the output frame's metadata now correctly
reflects these values. Previously, the swscale conversion was performed
but the frame metadata was not updated.

Changes:
- Add SWS_CS_* to AVColorSpace mapping for correct metadata translation
- Only set frame metadata when user explicitly specifies dst parameters
- Preserve source frame metadata when dst params are not specified

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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