2012-08-27 46 views
1

我想每幀數量而不是秒數剪輯視頻文件。 到目前爲止,我已經嘗試了幾個選項,這是迄今爲止最成功的一個:quicktime中的AppleScript剪輯電影

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

幀不在QuickTime Player字典中。但是,它位於QuickTime Player 7字典中。如果你需要使用框架,而不是秒修剪,我會建議尋找QuickTime播放器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 
+0

感謝的人! 似乎完美的工作! – user1627273