Skip to content

Conversation

@jonoomph
Copy link
Member

@jonoomph jonoomph commented Jun 5, 2023

Effects are currently processed before we apply keyframes on each clip object. This is usually the preferred sequence of events, for example, we might want to apply a crop or mask before we position and resize the clip (i.e. process the clip’s keyframes).

However, there are times when it makes sense to apply an effect after the clip keyframes, for example, we might want to animate some scrolling credits moving down the screen, and apply a mask AFTER we have applied the clip keyframes. In this example, the scrolling credits might fade away mid-screen due to a mask… but because we apply this mask after the clip keyframes, it would appear to animate down the screen and fade away at a static location.

Mask-Credits-experimental

jonoomph added 5 commits May 24, 2023 17:12
… AFTER a clip's keyframes are applied. For example, this allows for a mask to apply after an animation/movement is applied to the clip image, like an animated scrolling credits to be masked/faded in a static location.
@jonoomph
Copy link
Member Author

jonoomph commented Jun 5, 2023

@jonoomph
Copy link
Member Author

jonoomph commented Jun 5, 2023

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #932 (d5a7998) into develop (e91bd82) will increase coverage by 0.27%.
The diff coverage is 9.10%.

@@             Coverage Diff             @@
##           develop     #932      +/-   ##
===========================================
+ Coverage    53.66%   53.93%   +0.27%     
===========================================
  Files          182      182              
  Lines        16829    16917      +88     
===========================================
+ Hits          9031     9124      +93     
+ Misses        7798     7793       -5     
Impacted Files Coverage Δ
src/Clip.h 68.75% <ø> (ø)
src/EffectBase.h 37.50% <ø> (ø)
src/TimelineBase.h 100.00% <ø> (ø)
src/audio_effects/Compressor.cpp 0.00% <0.00%> (ø)
src/audio_effects/Delay.cpp 0.00% <0.00%> (ø)
src/audio_effects/Distortion.cpp 0.00% <0.00%> (ø)
src/audio_effects/Echo.cpp 0.00% <0.00%> (ø)
src/audio_effects/Expander.cpp 0.00% <0.00%> (ø)
src/audio_effects/Noise.cpp 0.00% <0.00%> (ø)
src/audio_effects/ParametricEQ.cpp 0.00% <0.00%> (ø)
... and 25 more

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jeffski
Copy link
Contributor

jeffski commented Jun 6, 2023

Not sure if I was affected by this just recently. The issue I had was applying a mask to a clip that had been stretched due to SCALE_CROP. The clip was an image that was very wide but thin, i.e. 1000px wide by 20px high, it had a mask effect applied and a scale keyframe added.

I think what happens is the clip is scaled due to SCALE_CROP so it becomes really wide to fit in a 1920 x 1080 video, the width will be > 100000's of pixels wide by 1080px high. The mask is then applied to the huge area, which makes it very very slow. Then a scale was added to shrink it down again to fit in 1920px x 1080px.

This might seem like a bit of an edge case and of course you would be better off using SCALE_NONE, but it did make me think if the scaling is done first and then the mask applied then you would be applying the effect on the original shape and not the massive scaled shape.

Anyway I am keen to see if this fixes that scenario because it would be huge performance boost.

@jonoomph
Copy link
Member Author

@jeffski Applying the mask effect after the clip keyframes is much more efficient. I experienced the exact issue you mentioned in the example video above, where I have a tall, skinny SVG image of all credits. Applying the mask before, is very slow per frame, but applying the mask after, is only masking the visible portion of the SVG credits image, and thus, is super fast.

@jonoomph jonoomph merged commit 95eccaf into develop Jun 11, 2023
@jonoomph jonoomph deleted the effect-sequencing branch June 11, 2023 15:31
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.

3 participants