Applescript快速修剪电影

时间:2012-08-27 10:17:00

标签: applescript quicktime

我想按帧数修剪视频文件而不是秒。 到目前为止,我已经尝试了一些选项,这是迄今为止最成功的选项:

set start_trim to 5
set end_trim to 6

tell application "QuickTime Player"
    activate
    try
        set movieFile to (the POSIX path of ("PathToMovieFolder")) & "MyMovie.mov"
    on error errorMsg number errorNum
        display alert errorMsg & space & errorNum message ¬
            "An error occured trying to find the file " & movieFile & "." & return & ¬
            "Check the file path exists, and the file spelling." as warning giving up after 60
    end try
    try
        open movieFile with presenting
        delay (0.25)
        present document 1
        delay (0.25)
        trim document 1 from start_trim to end_trim
        display alert errorMsg & space & errorNum message ¬
            "An error occured trying to open & play the file " & movieFile & "." & return & ¬
            "Check the file path exists, and the set delay time" as warning giving up after 60
    end try
end tell

它的作用是将它修剪为秒而不是精确的帧。 关于如何解决这个问题的任何想法?

1 个答案:

答案 0 :(得分:1)

Frame不在QuickTime Player词典中。但是,它位于QuickTime Player 7字典中。如果您需要使用帧而不是秒来修剪,我建议您找一份QuickTime Player 7。

或者你可以这样做:

set FPS to 29.97
set start_trim to 5
set end_trim to 7

set startFrame to start_trim / FPS
set endFrame to end_trim / FPS

tell application "QuickTime Player"
    activate
    trim document 1 from startFrame to endFrame
end tell