GesEffect not applying to preview of video after playback has started

When adding effects to a clip the effect does not show up on the preview of the video. I am adding these effects after playback has started. On exporting the video the effect is saved to the new file. When adding an effect during pipeline creation the preview does show it (tho the resolution is incorrect for the rotate)

What do I need to update to get the preview to register the effect? I tried adding a new clip instead of updating but the preview did not change.

My pipeline creation is identical to the example found in the examples repo. My code for adding the effect is below.

fn replace_or_add_effect(&mut self, effect: &Effect, effect_name: &str) {
        let info = self.playing_info.as_mut().unwrap();

        let found_element = info
            .clip
            .children(false)
            .into_iter()
            .find(|child| child.name().unwrap() == effect_name);

        if let Some(prev_effect) = found_element {
            info.clip
                .remove(&prev_effect)
                .expect("could not delete previous effect");
        }

        info.clip.add(effect).unwrap();
    }

    fn add_orientation(&mut self, orientation: VideoOrientationMethod) {
        let val = Self::video_orientation_method_to_val(orientation);

        let effect = format!("autovideoflip video-direction={val}");
        let flip = Effect::new(effect.as_str()).expect("could not make flip");
        flip.set_name(Some("orientation"))
            .expect("Unable to set name");

        self.replace_or_add_effect(&flip, "orientation");
    }

Simple mistake on my end. I was not commiting the change to the timeline. At the end of my replace_or_add_effect function I just needed to add info.timeline.commit_sync();.

1 Like