我正在尝试创建一个
我知道 Adobe 没有关于 Premiere Pro 脚本编写的官方文档,所以我一直在使用数据浏览器(在
我已经成功加载了指定信息的 CSV 文件,并且知道如何导入视频文件并创建新序列(如这里所述)。我现在遇到的问题是正确地剪辑导入的文件并将其放入序列中。我看到 activeSequence 有 setInPoint 和 setOutPoint 等方法,但在导出时似乎无法正确修剪。
以下是我的代码及注释,以显示整个脚本的流程:
ExtendScript
脚本,用于 Premiere Pro,它将加载指定的视频文件,在指定的开始和结束时间剪辑它们,将它们放入序列中,然后导出生成的电影。我知道 Adobe 没有关于 Premiere Pro 脚本编写的官方文档,所以我一直在使用数据浏览器(在
ExtendScript Toolkit
或 ESTK
中),以及我在这里找到的一些有用的类参考。我已经成功加载了指定信息的 CSV 文件,并且知道如何导入视频文件并创建新序列(如这里所述)。我现在遇到的问题是正确地剪辑导入的文件并将其放入序列中。我看到 activeSequence 有 setInPoint 和 setOutPoint 等方法,但在导出时似乎无法正确修剪。
以下是我的代码及注释,以显示整个脚本的流程:
#target premierepro
var myDir = "G:\\directoryWithVideoFiles\\";
// defined "indexOf" subfunction here
// ***** begin main body of script *****
// (dataRuns has fields runName, startVideo, startTime, stopVideo, stopTime)
// Import video files listed in dataRuns
var vidFiles = new Array;
for (i=0; i<dataRuns.length; i++) {
if (indexOf.call(vidFiles,myDir + dataRuns[i].startVideo + '.MPG') == -1) {
vidFiles.push(myDir + dataRuns[i].startVideo + '.MPG');
}
if (indexOf.call(vidFiles,myDir + dataRuns[i].stopVideo + '.MPG') == -1) {
vidFiles.push(myDir + dataRuns[i].stopVideo + '.MPG');
}
app.project.createNewSequence(dataRuns[i].runName,'');
}
app.project.importFiles(vidFiles);
// at this point, for each run (called runName) I need to:
// - take a clip of the startVideo from the startTime to the end of the video
// - take a clip of the stopVideo from the start of the video to the stopTime
// - put clip 1 at the beginning of the associated sequence, & clip 2 right after
// - export the sequence as a new video file