0
我有一個applescript用於從視頻創建圖像序列。它適用於用尼康相機拍攝的電影。它爲我的佳能相機拍攝的電影創建了一串穩定的綠色圖像。奇怪的是,如果我使用quicktime手動導出圖像序列,它工作正常(沒有綠色圖像)。只有在通過腳本運行時,quicktime纔會創建綠色框架(順便說一句,所有綠色框架)。蘋果腳本quicktime圖像序列導出創建綠色幀
下面是代碼:
#set vFile to (choose file with prompt "Select a video file:")
on open of finderObjects -- "open" handler triggered by drag'n'drop launches
repeat with vFile in (finderObjects) -- in case multiple objects dropped on applet
tell application "Finder"
list folder ":Library:QuickTime:Presets"
set theList to result
set qSet to (choose from list theList)
set vBase to the name of vFile
end tell
tell application "Finder"
if (folder ((path to movies folder as string) & "TLTemp") exists) then
delete folder ((path to movies folder as string) & "TLTemp")
end if
if not (folder ((path to movies folder as string) & "TLTemp") exists) then
set TLDir to make new folder at (path to movies folder as string) with properties ¬
{name:"TLTemp"}
end if
end tell
#tell application "QuickTime Player 7" to open vFile
tell application "QuickTime Player 7"
open vFile
set settings_file to (":Library:QuickTime:Presets:" & qSet)
set TLtemp to ((path to movies folder as string) & "TLTemp:" & vBase)
with timeout of 500 seconds
export document 1 to TLtemp as image sequence using settings settings_file
end timeout
#export document 1 to TLtemp as image sequence
close document 1
end tell
set the item_list to list folder ((path to movies folder as string) & "TLTemp:") without invisibles
set pictureFile to ((path to movies folder as string) & "TLTemp:" & item 1 of item_list)
tell application "QuickTime Player 7"
activate
open image sequence pictureFile frames per second 30
set the looping of document 1 to true
play document 1
end tell
end repeat
end open
這並不能解決我的問題,因爲問題發生在快速導出過程中。 iPhoto無法從視頻文件中導出幀。 – tavis
我使用QuickTime 7生成.PICT圖像,然後僅使用iPhoto將它們轉換爲不同的圖像格式。你是說上面的AppleScript爲你生成穩定的綠色圖像嗎?你能給我一段你的片段供我測試嗎? [該腳本適用於我。](http://dl.dropbox.com/u/475192/2013_03_22.mov) –
該腳本適用於使用尼康相機拍攝的視頻。但用我的canon powershot,我可以在進行圖像序列輸出時獲得所有可靠的綠色圖像。 – tavis