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

Different alpha compositing with CPU vs. GPU #23

Open
hreinnbeck opened this issue Jul 3, 2019 · 2 comments
Open

Different alpha compositing with CPU vs. GPU #23

hreinnbeck opened this issue Jul 3, 2019 · 2 comments

Comments

@hreinnbeck
Copy link

A discussion over at the forums reminded be of an issue I experienced a few years ago with rendering/compositing of alpha channels from videos. So I just tested an old file with NRK2.1.8 and it's still the same. CCG 2.2 also.

A file to test can be found here: http://hreinnbeck.com/github/ccg_gpu_cpu/iid.mov

Codec ID                                 : qt   2005.03 (qt  )
Overall bit rate mode                    : Variable
Overall bit rate                         : 189 Mb/s
Writing library                          : Apple QuickTime 7.7.7

Video
ID                                       : 1
Format                                   : RLE
Format/Info                              : Run-length encoding
Codec ID                                 : rle 
Duration                                 : 7 s 800 ms
Bit rate mode                            : Variable
Bit rate                                 : 189 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : RGBA
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 3.651
Stream size                              : 176 MiB (100%)

IIRC this file was created in AE on macOS.

It renders and composites correctly when the accelerator is set to CPU.
CPU-NO_BACK
CPU-BACK

But not with GPU:
GPU-NO-BACK
GPU-BACK

I simply converted the files at the time, but I have on occasion been given files with the same issue so this might be something worth looking into.

@Julusian
Copy link
Member

Julusian commented Jul 5, 2019

This is an interesting issue. It really looks like the file is straight alpha, but caspar is ignoring that.
I don't see any opengl code for handling colour values being out of bounds (higher than the alpha), so the first of those gpu screenshots would make sense from that, the second one I am less sure, but I don't know much about how opengl does colour blending.
There is a bit of code in the cpu mixer to make sure the colour values are valid, so it appears to render correctly. However if this is the case, then it isnt technically quite correct output.

I need to give this a try myself and see what I find with various premult and straight source files.

@hreinnbeck
Copy link
Author

Thanks for that Julian. I actually just tested with the TESTPATTERNS/1080_Test file and it behaves the same :/

Found this video from a user in 2013, which appears to show the testpattern being correct at that time. Also see CasparCG#574.

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

No branches or pull requests

2 participants