Skip to content

Add support for RGBA capture for Windows software encoding#1163

Closed
cgutman wants to merge 2 commits intoLizardByte:nightlyfrom
cgutman:display_ram_rgba
Closed

Add support for RGBA capture for Windows software encoding#1163
cgutman wants to merge 2 commits intoLizardByte:nightlyfrom
cgutman:display_ram_rgba

Conversation

@cgutman
Copy link
Collaborator

@cgutman cgutman commented Apr 9, 2023

Description

This PR adds support for RGBA capture for software encoding on Windows. Previously, DWM had to convert RGBA desktop surfaces to BGRA for our capture code, which causes additional load on the system and reduces performance.

I pulled in the changes from @psyke83 's old PR #522 for handling RGB surfaces in video.cpp with modifications to work with the current code.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@cgutman cgutman marked this pull request as draft April 12, 2023 03:26
@cgutman
Copy link
Collaborator Author

cgutman commented Apr 12, 2023

Looks like the color conversion isn't correct on this one when in RGBA capture mode

@ns6089
Copy link
Contributor

ns6089 commented Apr 12, 2023

Looks like the color conversion isn't correct on this one when in RGBA capture mode

How incorrect are we talking here, tolerable or intolerable level? Or it's just a matter of changing our color conversion shaders.

@cgutman
Copy link
Collaborator Author

cgutman commented Apr 14, 2023

How incorrect are we talking here, tolerable or intolerable level? Or it's just a matter of changing our color conversion shaders.

Noticable, which is too much. This codepath isn't actually using shaders. It's using sws_scale() for software color conversion and scaling.

I think I know how to fix it, but I want to also change the way we use swscale to take advantage of the new threaded swscale support in FFmpeg. Color conversion is the currently by far the biggest bottleneck for software encoding, since it's a single thread operating individually on every pixel in an entire frame.

@LizardByte-bot
Copy link
Member

This PR is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days.

@LizardByte-bot
Copy link
Member

This PR was closed because it has been stalled for 10 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants