使用Premiere Pro的ExtendScript连接将导入的文件添加到序列中

177
我正在尝试创建一个 ExtendScript 脚本,用于 Premiere Pro,它将加载指定的视频文件,在指定的开始和结束时间剪辑它们,将它们放入序列中,然后导出生成的电影。
我知道 Adobe 没有关于 Premiere Pro 脚本编写的官方文档,所以我一直在使用数据浏览器(在 ExtendScript ToolkitESTK 中),以及我在这里找到的一些有用的类参考。
我已经成功加载了指定信息的 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

2
请同时添加您的代码或jsfiddle示例。 - Anup
6
我已经将我的代码添加到主要问题中。正如您所看到的,我没有与HTML交互的必要,也不需要视频播放器。我已经阅读了您提供的所有Video.js文档,并且我几乎可以确定它无法满足我的需求。 - adara
3
@adara,啊,你说了“视频”这个词!!!让我在这里清晰无关的粘贴jQuery插件链接(http://stackoverflow.com)。那应该可以解决使用ExtendScript制作**ADOBE PREMIERE XML SCHEMA WRITER**的问题!! - Xeoncross
1个回答

2

与其在活动序列上设置进/出点,不如将原始视频加载到源窗口中,然后在那里设置进/出点,然后在活动序列中构建最终版本。

从源到序列的剪辑可以通过多种方式进行复制,应该很容易。

所以,我的建议是尝试使用源而不是序列进行剪辑。可能会有更好的运气。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接