ada*_*ara 177 extendscript adobe-premiere
我正在尝试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
Run Code Online (Sandbox Code Playgroud)
小智 2
与其在活动序列上设置输入/输出点,为什么不将原始视频加载到源窗口中,并在那里设置输入/输出点,然后在活动序列内构建最终版本。
将剪辑从源复制到序列可以通过多种方式完成,并且应该非常简单。
所以是的,我的建议是尝试使用源而不是剪辑序列。可能会有更好的运气。
| 归档时间: |
|
| 查看次数: |
6220 次 |
| 最近记录: |