Implement wrapper for sws_getCoefficients() #174
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added new set_colorspace_details method for
Context
(swscaler).By default, you can use sws_scale, but it by default assumes the default colorspace, which I understand to be BT.601.
So if a video with a difference colorspace (BT.709 or BT.2020) is being input, then the colors shifts.
Using this function, you can control it!
For those curious, here is how I intend to use this to convert frames to RGB:
let context = Context::get()
context.set_colorspace_details
input_space
: Pass the value ofvideo.color_space()
src_range
: Pass the value ofvideo.color_range()
dst_range
: In my case, I want to convert it to RGB, so I want full range, therefore I passcolor::Range::JPEG
brightness
: I set to to 0 to make no correctioncontrast
andsaturation
: I set it to1 << 16
to make no correctionI have no experience, I just read https://www.canva.dev/blog/engineering/a-journey-through-colour-space-with-ffmpeg/. If you can, please review carefully.