What is the Order of Operations When Applying Filters on Both the Track and the Clip

Having been using filters on both occasions simultaneously, I’m trying to achieve predictable results. I’m sure there is a rhyme and reason. I just don’t know what it is. I definitely see different behavior based on where I put the filter.


Clip first, track head next, Output last.

A way to verify:

  1. Put a colorful clip on V1.
  2. Add an HLS filter on the clip and set Saturation to zero. Preview turns black and white.
  3. Add a color grading filter on the track head and set Shadows to deep blue. Preview turns blue.

HLS (the clip filter) couldn’t have been last or else the Preview would stay black and white.

If the filters are switched, the Preview does turn black and white, confirming the track head’s HLS filter was applied last.

It’s possible to apply video filters to the Output track as well, which are evaluated after the track head filters. This can be verified the same way as above.

1 Like

That’s what I’m seeing so far, but I want to test it with other filters to make sure the behavior is consistent.

So if you have 3 tracks on your timeline, does applying a filter on the Output track universally applies the filter on all 3 tracks?

In theory, the compositing engine merges all the video tracks together into a single frame, and then the filters on the Output track are applied to that frame. Output filters are applied to the output of the compositing engine, as opposed to being applied to every track going into the compositing engine.

I could be wrong about some of the following details, but here’s what I’ve gathered from previous threads and a casual review of source code in regard to compositing:

  1. On each track, a frame for that point in the timeline is extracted from the source clip. Filters that are attached directly to the clip will be applied first, and then filters attached to the track head are applied next. This becomes the final frame for that track of video, and it will be entered into the compositing engine to be merged with frames from other tracks.

  2. If a project has more than one video track, then compositing is engaged. This includes a hidden black layer that’s added by Shotcut and can be thought of as V0. Because compositing is engaged and there’s a solid black V0 waiting to fill any holes in the alpha channel left behind by higher tracks, it becomes impossible to export transparent video if there is more than one track. I could understand a black or checkerboard V0 being used to help somebody know where holes are while previewing the timeline during editing, but I admit I’m not certain what technical problem is being solved by adding a black V0 to the final export. This just appears to be the way it works.

  3. If a project has only one video track, then compositing is not engaged. This is what allows single-track video to be exported with an alpha channel. It doesn’t merge the black V0 hidden layer or wipe out alpha data.

  4. If a project has video tracks V1 to V4, and Shotcut detects that V4 has no holes in its alpha channel, then there is an optimization to skip compositing for that frame and send V4 direct to the Output because V4 completely covers up V0 to V3 anyway.

  5. If compositing is required, a painter’s algorithm is used. This means V2 is laid over V1, and the result becomes the “new V1”. V3 is now laid on top of the “new V1”, and the result becomes the “new new V1”. Basically, tracks are merged from the bottom up (V1 to Vx). I haven’t looked into whether the merge with solid black V0 happens first or last in the process.

  6. Once the top-most track is merged and the compositing process is complete, the resulting frame becomes the output of the compositing engine. This output frame is what receives any filters placed on the Output track. The same concept applies to the audio channels as well.

Again, this is “as best I can tell”. I could have missed some nuance. But these points seem to check out pretty well overall.


Order of effects (collective term for filters, transition, and track blending/mixing):

  1. filters on clip
  2. transition
  3. filters on transition
  4. filters on track
  5. track blending/mixing
  6. filters on Output

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