我试图在ExtendScript中为Premiere创建一个脚本,该脚本将加载指定的视频文件,在指定的开始和停止时间剪辑它们,将它们放入一个序列,然后导出最终的电影。
我知道Adobe没有关于Premiere脚本的正式文档,所以我一直在使用数据浏览器(在ExtendScript Toolkit或ESTK中)和一组方便的类引用,我找到了here。
我已经成功地加载了CSV文件,该文件指定了所需的信息,并且知道如何导入视频文件并创建一个新的序列(如解释的here)。我现在遇到的麻烦是将导入的文件正确地剪裁并放入序列中。我看到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发布于 2015-08-25 22:18:20
与其在活动序列上设置输入/输出点,不如将原始视频加载到源窗口,并在那里设置输入/输出点,然后在活动序列中构建最终版本。
将剪辑从源代码复制到序列可以通过多种方式完成,而且应该非常容易。
所以,我的建议是尝试使用源,而不是剪辑的顺序。也许运气会更好。
https://stackoverflow.com/questions/19234310
复制相似问题