0

ビデオから画像シーケンスを作成するために使用されるアップルスクリプトがあります。私のニコンカメラで撮影した映画に最適です。私のキャノンカメラで撮影した映画用に、たくさんの緑色の画像を作成します。奇妙なことに、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
4

1 に答える 1

0

私はイメージ シーケンスを扱ったことはありませんが、Finder で選択した項目を QuickTime 7 で開き、10 個の静止イメージを PICT ファイルとしてキャプチャする AppleScript を持っています。フロント ドキュメントの現在の時間を 1 フレーム増やした場合 (私が行ったような期間 / 11 ではなく)、それは役に立ちますか?

--   Use iPhoto to convert these PICT files to PNGs.
set exportFolder to (path to the desktop as text) & "photos from QuickTime:"
set picturesPerVideo to 10



tell application "Finder" to set theSelection to the selection as list
repeat with i from 1 to (count of theSelection)
    set theItem to item i of theSelection
    tell application "Finder"
        set finderPath to (file (theItem as text))'s POSIX path
        set theName to theItem's name
        open theItem using (path to application "QuickTime Player 7")
    end tell
    set theCurrentDate to current date
    tell application "System Events" to set process "QuickTime Player 7"'s visible to false
    tell application "QuickTime Player 7"
        repeat until front document's path = finderPath
            if ((current date) - 15) > theCurrentDate then error "Timeout."
            delay 1
        end repeat

        repeat with j from 1 to picturesPerVideo
            set timeInVideo to j / (picturesPerVideo + 1)
            set front document's current time to (front document's duration) * timeInVideo
            set exportPath to exportFolder & theName & "_" & j & ".pict"
            export front document to exportPath as picture replacing yes
        end repeat
        close front document
    end tell
end repeat

そして返事が遅くなってすみません。私はあなたの投稿に出くわしました。

于 2013-01-26T17:43:41.850 に答える