Layer clip with straight alpha

  • casparcg version 2.3.3
  • Clip Codec: Quicktime RLE 32 bit (with Alpha Channel)
  • Alpha Type: Straight Alpha

The wiki tells sources should be premultiplied to have clean video layering inside casparcg

Is there any way to layer video with straight alpha, too?

You can use the Straight Alpha Mixer command.

seems not to work:

[2022-09-15 18:05:16.227] [info]    Received message from 127.0.0.1: MIXER 1 STRAIGHT_ALPHA_OUTPUT 1\r\n
[2022-09-15 18:05:16.227] [info]    Sent message to 127.0.0.1:400 ERROR\r\nMIXER 1 STRAIGHT_ALPHA_OUTPUT 1\r\n

I changed my config file, too. But this seems not to have any influence, also.

<mixer>
    <blend-modes>          true</blend-modes>
    <straight-alpha>       true</straight-alpha>
    <chroma-key>           true</chroma-key>
    <mipmapping_default_on>true</mipmapping_default_on>
</mixer>

I would expect ffmpeg to know that its straight alpha and to auto convert it.
Or perhaps using an ffmpeg filter to do that conversion will work? I dont know the syntax for that

I don’t know if it works with these spaces:

<mixer>
    <blend-modes>          true</blend-modes>
    <straight-alpha>       true</straight-alpha>
    <chroma-key>           true</chroma-key>
    <mipmapping_default_on>true</mipmapping_default_on>
</mixer>

Would you mind trying:

<mixer>
    <blend-modes>true</blend-modes>
    <straight-alpha>true</straight-alpha>
    <chroma-key>true</chroma-key>
    <mipmapping_default_on>true</mipmapping_default_on>
</mixer>

Im pretty sure any support for mixing or outputting straight alpha got removed in 2.2

Seems like that. Removing the spaces in my config file didn’t solve it.

Do we know why? That means that now if you change the opacity of a layer, it will bring down the opacity of both signals: fill and key.

If I recall correctly… The way it used to work on 2.0.7 with straight alpha ON is that the key signal was affected by the opacity but the fill signal was left unchanged. That allowed for colors to be displayed transparent without being so dimmed.

Setting up the key as straight / linear in some mixers was very convinient and straightforward. Outputting fill+key without straight alplha usually meant a bit more work and tinker in integrating the key on the mixer, as luma or similar.

Any chance of bringing it back or does it clash with any of the new features on the 2.3.x branch?

Thanks!

1 Like

I think someone classed it as “unnecessary” complexity?

In 2.1 (I dont know about 2.0), mixing was always done premultiplied. There was an extra step done after the compositing that straightened out the alpha. So it had a performance (and code complexity) cost, for no visual benefit.

I have no problem with someone bringing it back. Being a post-step it feels to me like it should be pretty self contained.
But I am not sure on mixing in straight alpha, if that is what you are after. I am guessing that will result in needing large changes to the shader, and possibly to various producers and consumers to produce/consume correctly with this.

AFAIK that is not possible or at least very complex and does not help.

I once worked in an OB van with a Grass Valley vision mixer. The technician said a bit angry, that it is ABSOLUTELY not possible to switch it to premultiplied (or he did not know how, or just did not want to do it). So I was happy, that I could switch the output to straight alpha, to calm him down :slight_smile: and make it work anyway. That was on 2.0.7.

Because of cases like that I also would find it very good, if we could bring it back, as most modern (read lottie) HTML templates do not run on 2.0.7.

1 Like

So if I understand correctly there’s two different concepts: 1 is outputting whatever is being sent on the channel as straight alpha through decklink and 2 is mixing casparcg layers internally as straight.

I cannot think of scenarios where I would need to set internal mixing in straight, but the final output being straight alpha is still used (and explicitly requested) in several control rooms and OB vans, as @didikunz mentioned.

I agree, that is a feature we still use in 2.0.7 and we will miss it when we switch to the new 2.3

1 Like

To have the choice which key type to use in vision mixers (additive or linear) it would be nice to have an optional casparcg straight output, too. It’s usually the more brilliant composition in the final output.

I don’t agree to useless straight layering inside casparcg. In production I have to deal with different render sources for clips (fill+key). One can render both key types but the other renders only straight alpha. To use clips from both renderers without switching configuration it would be nice to use straight alpha through the whole pipeline.

1 Like

I’d really like to see this added back to 2.3

2 Likes
Privacy Policy   Terms of Service