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 caching, decode images ahead of time #229

Merged
merged 17 commits into from
Jul 17, 2024

Conversation

actuday6418
Copy link
Contributor

No description provided.

@actuday6418
Copy link
Contributor Author

These commits implement the caching fix mentioned in #173 along with some miscellaneous improvements.

@TristanDebrunner
Copy link
Collaborator

Thanks @actuday6418. #173 also introduced #228, can you get that fixed as well in this PR?

@actuday6418
Copy link
Contributor Author

Fixes #228

@TristanDebrunner
Copy link
Collaborator

Thanks for sending the updates. Unfortunately with the alphagen updates I think I need to test this on actual hardware to see how the keyer responds. I will not be able to do that until Friday or next Monday

@TristanDebrunner
Copy link
Collaborator

I also noticed one more problem while using the app at the tournament, #173 updated the sudden death view to be wide, but did not add the team name text back in. I have not had a chance to verify the behavior in the overtime periods. Could you fix this?

@TristanDebrunner
Copy link
Collaborator

I did some testing with the ATEM, and I don't think either the old code nor the new code you uploaded is correct.

Here is a screenshot of the old code:
old

And with the changes you made:
actuday

As you can see in both images, the white transparency is far less transparent than the black, though they should be equal. The changes proposed here make the problem worse, not better.

I did some research, and the ATEM is expecting a pre-multiplied key, which means we actually have to multiply the color channels by the alpha channel while processing from raw to color. I have tried changing to that, and I think the result is what we actually want:
pmk

I have pushed my changes here. @actuday6418 could you make sure the pmk process also gets applied to any images that get downloaded?

@TristanDebrunner
Copy link
Collaborator

It doesn't look like #228 is resolved yet. See the video below.

timeout_flags_cropped.mp4

@TristanDebrunner
Copy link
Collaborator

Also, the rendering when the game changes isn't quite fixed. Some comments on the video below:

  1. It looks like we still have a 1-2 second freeze when the game number changes. I think this is acceptable, but it would be nice to reduce/eliminate
  2. The change to the game number is rendered a few seconds before the team flags/names are updated. This needs to be fixed. If the new flags/names have not been processed by the backend yet, the placeholders must be used, not old data.
game_change_cropped.mp4

@actuday6418
Copy link
Contributor Author

It doesn't look like #228 is resolved yet. See the video below.
timeout_flags_cropped.mp4

It was fixed with my change of drawing the timeout graphic underneath the team name banner graphic and drawing to the color feed without alpha. Looks like your change reintroduced the issue by adding transparency to the color feed, revealing the timeout graphics underneath.

I think the best solution, if possible, would be to switch the ATEM to straight keying. We would avoid the extra image processing as well.

If that cannot be done, I can try to come up with a solution like drawing only the part of the image that is on the right side of the time and state graphic.

@TristanDebrunner
Copy link
Collaborator

Unfortunately the pre-multiplied key is the only mode supported by the ATEM.

Would it be simple to just draw the flag first, then draw a black box over it on the left side? (Draw all the other stuff after the black box, so that nothing gets unintentionally covered)

Merged via the queue into AtlantisSports:master with commit f0d9c84 Jul 17, 2024
11 checks 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