ExtendScript - overwriteClip() Overwrites Audio As Well?

New Here ,
Mar 09, 2021 Mar 09, 2021

Copy link to clipboard

Copied

Working on a script that takes a show build sequence of nested sequences and then finds all the nested sequences in the project panel, duplicates them, iterates version number, and then puts the newly versioned sequences in the bin where the original came from. From there, the new nested sequences are cut into the show build sequences identically to how they were laid out originally.

 

Only issue I'm having here is when using the overwriteClip() function.

 

Though I'm only cutting in the video - app.project.sequences[index].videoTracks[index].overwriteClip(projectItem,
time) - this method will STILL cut in the audio.

 

Anyone have any insight as to how to avoid overwriteClip() defaultly cutting in the corresponding audio?

 

Thanks!

TOPICS
Editing, Error or problem, SDK

Views

149

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 09, 2021 Mar 09, 2021

Copy link to clipboard

Copied

There's no API for adding only the audio or video portion of an a/v clip. 

Potentially helpful: Here's how to unlink the audio and video portions of a clip, already in a sequence: https://github.com/Adobe-CEP/Samples/blob/63f176a4903b9be9e6aa73133ae689a3904f78c8/PProPanel/jsx/PPR...

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

There is a fun trick:

var seq = app.project.sequences[s]; // target sequence
var nest = app.project.sequences[n]; // nested sequence
nest.projectItem.setOutPoint('0', 2); // set project item audio outpoint to 0;
seq.videoTracks[i].overwriteClip(nest.projectItem, time);
nest.projectItem.clearOutPoint(); // clear outPoint (in case you will need this later)

This doesn't work for opposite, when you want to overwrite audio clip and omit video clip.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

setOutPoint explained:

https://premiere-scripting-guide.readthedocs.io/item/projectitem.html?highlight=setinPoint#projectit...

 

I used setOutPoint ('0', 2),  which means that your nested sequence starts at 0.

Otherwise you can use pass different start time.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

test

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Appreciate the replies! However, I could not get either of these ideas to work. Maybe (probably) it's just me.

 

I was able to do this however...

 

Before I overwrite the new nested sequence into the showbuild sequence, I manipulate the Audio Channel Mapping:

var mapping = theDupCap.getAudioChannelMapping;

mapping.audioClipsNumber = 0;

theDupCap.setAudioChannelMapping(mapping);

 

Then, a few other things in the script happen and the theDupCap is eventually overwritten into the showbuild sequence.

I then want to change Audio Channel Mapping settings back to normal after the overwrite, but that doesn't seem to work out.

 

This is the code I use to try and revert the audio settings back to normal and it's written right after I use the overwriteClip() Method:

mapping = theDupCap.getAudioChannelMapping;

mapping.audioClipsNumber = 1;//fails here

mapping.audioChannelsType = 1;

theDupCap.setMappingForChannel(0,0);

theDupCap.setMappingForChannel(1,1);

theDupCap.setAudioChannelMapping(mapping);

 

Essentially, I want to:

-Change the Audio Channel settings.

-Do somemthing with that object.

-Change Audio Channel settings again.

 

I hope this is a clear explanation.

 

Thanks! 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines