0

My project is based on the MediaComposition API.

MediaComposition composition = new MediaComposition();

It uses clips with video effects...

MediaClip mainClip = await MediaClip.CreateFromFileAsync(someVideo);        

mainClip.VideoEffectDefinitions.Add(new VideoEffectDefinition(typeof(SomeVideoEffect).FullName, new PropertySet { "Data", data }));

composition.Clip.Add(mainClip);

And it also uses overlays...

MediaClip overlayClip = MediaClip.CreateFromColor(Colors.Red, mainClip.OriginalDuration);

MediaOverlay overlay = new MediaOverlay(overlayClip);

MediaOverlayLayer layer = new MediaOverlayLayer();
layer.Overlays.Add(overlay);
compositon.OverlayLayers.Add(layer);

The thing is, the overlays are always on top of the video effects, and the order of adding them has no effect. In other words, even if the overlays are added to the composition before the video effects, the overlays still block the view of the video effects. Is there a way to make the video effects show on top of the overlays?

Ken White
  • 123,280
  • 14
  • 225
  • 444
  • It looks by design, the mediaoverlay should top of video content. And could you tell Where you want to place the MediaOverlay? – Nico Zhu Nov 17 '21 at 07:13
  • Absolutely. I have a recorded video and I want this to show as a little box near a corner. Behind that, I want a short video clip looping as background. On top of the background but away from the little box being the recorded video, I want the video effects. I can put all of these as overlays on top of a transparent color clip. Unfortunately, the overlays of the looping background hide the video effects. – M Psyllakis Nov 17 '21 at 09:06
  • Yep, for this scenario, you need make effect video as specific MediaOverlay. and place it top on the looping background. – Nico Zhu Nov 17 '21 at 09:17

0 Answers0