Open MrAdhit opened 4 months ago
Hey, thank you for pointing out the issue!
This behavior occurs because of the ColorFormat being set here
let color_format = match options.output_type {
FrameType::BGRAFrame => ColorFormat::Bgra8,
_ => ColorFormat::Rgba8,
};
which sets the color format of any other frameType as Rgba8 which was causing the issue as the default FrameType is set as YUV frame as you can see here
#[derive(Debug, Clone, Copy, Default)]
pub enum FrameType {
#[default]
YUVFrame,
BGR0,
RGB, // Prefer BGR0 because RGB is slower
BGRAFrame,
}
@RohanPunjani I think the problem is that only BGRA frames are sent from the capturer: https://github.com/helmerapp/scap/blob/1b7c70df754ee9c2c4e040266f45d16354367bd7/src/capturer/engine/win/mod.rs#L82-L84 https://github.com/helmerapp/scap/blob/1b7c70df754ee9c2c4e040266f45d16354367bd7/src/capturer/engine/win/mod.rs#L102-L104
I think I might be ahving a similar issue with #110
When I set
output_type
to default, the frame format is in RGBA even tho it uses the BGRA enum, this doesn't happen if I specify theoutput_type
to BGRA explicitlyhere's the reproducible code https://gist.github.com/MrAdhit/12a35dec29741703173263717724b5a5
https://github.com/helmerapp/scap/assets/47937950/c6bded9f-9e8c-4e71-b920-ed319ad3a286