timeline and videoevent for transition

Taeyoung-Kim wrote on 12/9/2020, 2:09 AM

The following functions should be implemented as script api.
Please give me some advice.
I want to place aaa videofile, bbb videofile, ccc videofile ... ... on the timeline.

I want to be able to set each transition fade in/out to each videofile.

I want it to look like the picture below.



If we look at the contents of the script api FAQ, we need to use a mix of AddVideoEvent() and InsertFileAt(), and if you call them each, two identical files will be created.

I would like to know how to add the Media assigned by AddVideoEvent to the timeline without reopening it with OpenFile().

please help me.

Comments

jetdv wrote on 12/9/2020, 9:35 AM

Well... all of that can certainly be done. Here's how I typically add a video clip to the timeline:
 

            Media mymedia = null;
            mymedia = new Media(videoFilePath);

            MediaStream stream = mymedia.Streams.GetItemByMediaType(MediaType.Video, 0);
            if (null != stream)
            {
                myNewVideoEvent = new VideoEvent(starttime, duration);
  //starttime would be the time on the to start the event on the timeline, duration would be the length of the video clip
                Vtrack.Events.Add(myNewVideoEvent);
                Take myNewtake = new Take(stream);
                myNewVideoEvent.Takes.Add(myNewtake);
            }

Then you can add a transition like this:

            //Find the transition
            PlugInNode fx = myvegas.Transitions;
            PlugInNode plugIn = fx.FindChildByName(transitionName);
            
            Effect effect = new Effect(plugIn);
            evnt.FadeIn.Transition = effect;

And you can choose a specific preset for the transitions with:

            effect.Preset = presetName;

 

Taeyoung-Kim wrote on 12/9/2020, 7:41 PM

Well... all of that can certainly be done. Here's how I typically add a video clip to the timeline:
 

            Media mymedia = null;
            mymedia = new Media(videoFilePath);

            MediaStream stream = mymedia.Streams.GetItemByMediaType(MediaType.Video, 0);
            if (null != stream)
            {
                myNewVideoEvent = new VideoEvent(starttime, duration);
  //starttime would be the time on the to start the event on the timeline, duration would be the length of the video clip
                Vtrack.Events.Add(myNewVideoEvent);
                Take myNewtake = new Take(stream);
                myNewVideoEvent.Takes.Add(myNewtake);
            }

Then you can add a transition like this:

            //Find the transition
            PlugInNode fx = myvegas.Transitions;
            PlugInNode plugIn = fx.FindChildByName(transitionName);
            
            Effect effect = new Effect(plugIn);
            evnt.FadeIn.Transition = effect;

And you can choose a specific preset for the transitions with:

            effect.Preset = presetName;

 

Thank you very much~

it works fine :)