Compositing functions counter-intuitive - please enlighten me


#1

So I have a moderately complex project of a short clip, which is assembled of a number of streams from a few cameras. As you can see, most of the tracks on a timeline are used only for editing purposes and are normally disabled; the topmost track is what represents the release video which is to be rendered. While editing, I split helper tracks and copy the needed parts into “main” topmost track.

/ Unable to put more than one image /

What I want to do is to add cool title. :slight_smile: Well, I have designed a title image using Paint.NET, exported it as PNG file and added to shotcut playlist. Then I have added a new video track above the topmost track and put the title image onto it (ignore the text on a clip itself which can be seen on a picture above, it was a desperate attempt to have at least some captions):

/ Unable to put more than one image /

What I see is:

that is, no underlying video is visible under the title image. Of course, the title image does not extend to all the frame area. Its resolution is 1920x196, so it cannot obstruct the underlying picture. Blend mode is set to “Over” on all tracks.

Changing blend mode of any track does nothing in this case.

Now the unexpected part.

When I enable the last track at bottom (labelled as “Aux cam right”), the miracle happens!

With this enabled
/ Unable to put more than one image /
All starts to work as expected:
/ Unable to put more than one image /

For some reason, the compositing function refuses to work with the bottom track video disabled, although enabling it does not change the final image (because blend mode is set to “Over”). Is it expected behavior? If so, I would be glad if someone explained me the logic of how the blend function works…

I’ve noticed that the track at bottom has no blend properties. Is it special in some way I don’t understand?


#2

Every other video track composites/blends with the bottom video track.

This is a workflow problem: the main track should be bottom-most.

I’ve noticed that the track at bottom has no blend properties. Is it special in some way I don’t understand?

It is special because it is the bottom and has nothing with which to blend.


#3

Thank you for the quick answer!

What I cannot understand is why blending does not work at all when bottom-most track is disabled?

Example 1:

[V5 - enabled, “Over”]
[V4 - enabled, “Over”]
[V3 - disabled, “Over”]
[V2 - disabled, “Over”]
[V1 - disabled, “Over”]

Here I can see V5 only. Why Shotcut does not blend [V5] with [V4]?

Example 2:

[V5 - enabled, “Over”]
[V4 - enabled, “Over”]
[V3 - disabled, “Over”]
[V2 - disabled, “Over”]
[V1 - enabled, “Over”]

And now it works as expected. Why? In both examples V1 is not visible anyway, because V4 is enabled, has the same size and blending option “Over”. Why disabling V1 results in situation where only one topmost track is visible?

By the way, apart from this blending issue, I find Shotcut a great software product, which perfectly fits my needs and is overall very easy and intuitive to use.


#4

In addition to what I already wrote, every track blends/composites with V1 - not V5 to V4, then V4 to V3, then V3 to V2, etc. If you want to know more you need to read the source code. I could make every video track blend with a hidden black background track, but then there will be less performance with a single video track even if there is no transparency. In some cases where images and filters result in RGBA, there is a check to see if there is any non-opaque pixel before taking the performance hit to run the blending operation. This situation may change in the future, but that is the way it is for now.


#5

Thank you! This solved the mystery for me!

Since your previous answer I’ve used bottom-most track as the “main” track, no problem, but I was still curious as to why this is mandatory. :slight_smile:

By the way, I think it’s a good idea to point out this way of blending somewhere in the tutorials… Or have I simply missed the mention of this?


closed #6

This topic was automatically closed after 90 days. New replies are no longer allowed.