Copy link to clipboard
Copied
I am testing out a workflow that includes editing RED footage using mov proxies. I need to be able to easily replace mov footage that has an R3D counterpart. I would need to do this with extendscript, but I don't know if that is even possible.
Thanks,
Miles
// Warning: assumes the zero-th item in the project is footage. |
var item = app.project.rootItem.children[0]; | ||||||||||||||
if (item.canChangeMediaPath()) | ||||||||||||||
{ | ||||||||||||||
var replacement_media = File.openDialog( | "Choose new media file, for project item " + | |||||||||||||
item.name, | ||||||||||||||
0, | ||||||||||||||
false); | ||||||||||||||
if (replacement_media != null) | ||||||||||||||
{ | ||||||||||||||
item.name = replacement_media.name + ", formerly known as " + item.name; |
item.changeMediaPath(replacement_media.fsName); |
replacement_media.close(); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
alert("Couldn't change path. replaceMedia() can't act on merged clips, |
Copy link to clipboard
Copied
// Warning: assumes the zero-th item in the project is footage. |
var item = app.project.rootItem.children[0]; | ||||||||||||||
if (item.canChangeMediaPath()) | ||||||||||||||
{ | ||||||||||||||
var replacement_media = File.openDialog( | "Choose new media file, for project item " + | |||||||||||||
item.name, | ||||||||||||||
0, | ||||||||||||||
false); | ||||||||||||||
if (replacement_media != null) | ||||||||||||||
{ | ||||||||||||||
item.name = replacement_media.name + ", formerly known as " + item.name; |
item.changeMediaPath(replacement_media.fsName); |
replacement_media.close(); | ||||
} | ||||
} | ||||
else | ||||
{ | ||||
alert("Couldn't change path. replaceMedia() can't act on merged clips, or maybe the zero-th item isn't footage."); | ||||
} |
Copy link to clipboard
Copied
Great stuff! You answered so quick, and I'm sorry for not getting back sooner. I wanted to try out the code before replying, but different tasks kept popping up. I still plan on implementing this script, and I just wanted to thank you for it.
Thanks,
Miles
Copy link to clipboard
Copied
No problem—let me know how it goes.
Copy link to clipboard
Copied
I did notice that replacing 0 in the second parameter to File.openDialog with ["*.mov", "*.r3d"] will show the MOVs and R3Ds.
I have put together a script that finds R3D footage and automatically replaces the footage with MOV footage if it is found in our proxies.
The next step is UI... I'll start another thread for that.
Thanks,
Miles
Copy link to clipboard
Copied
Hi Bruce,
Can we do the relinking or somehow change the linked media path for a merged files with the latest Premiere pro APIs.
Thanks and regards,
Anoop NR
Copy link to clipboard
Copied
For those trying to read over the unfortunately-formatted code in the currently accepted response, perhaps this may be of use:
// Warning: assumes the zero-th item in the project is footage.
var item = app.project.rootItem.children[0];
if (item.canChangeMediaPath())
{
var replacement_media = File.openDialog("Choose new media file, for project item " +
item.name,
0,
false);
if (replacement_media != null)
{
item.name = replacement_media.name + ", formerly known as " + item.name;
item.changeMediaPath(replacement_media.fsName);
replacement_media.close();
}
}
else
{
alert("Couldn't change path. replaceMedia() can't act on merged clips, or maybe the zero-th item isn't footage.");
}
Copy link to clipboard
Copied
Hi,
Would like to know if there is any possible way we can change the media for the merged clips, in the latest Premiere API
Bruce reply came back in 2014, hope there is some work around for this by now.
Thanks and Regards,
Anoop NR
Copy link to clipboard
Copied
Still not possible, but API feature request B-124601 ("Allow for footage replacement within merged clips") is climbing up the backlog.