使用特定的匯出設定使用 QuickTime Player 7 批次匯出選定的影片?

使用特定的匯出設定使用 QuickTime Player 7 批次匯出選定的影片?

如何使用 applescript 或 Automator 批次匯出我在 Finder 中選擇的影片文件,但是不是使用「對選定的視訊檔案進行編碼」服務方法,該方法只有 4 種格式可供選擇?

基本上,我需要使用上次從 QuickTime 7 導出視頻時選擇的“最近設置”來導出視頻,或者使用 QuickTime 7 中的導出對話框指定設置以選擇特定的格式。

有時我需要編解碼器為“Apple ProRes 422 LT”,有時我需要使用常規的“Apple ProRes 422”。我還需要確保幀率設定為 30,無論來源檔案幀率如何,並且尺寸為 1280x720 或 1920x1080。

最後,我還需要為不同視訊的音訊編碼設定不同的選項。

希望有人知道一種方法來做到這一點。我一直在這裡和谷歌上挖掘,但沒能弄清楚。似乎我在網路上找到的大部分資訊只是告訴人們如何使用相同的方法,即使用「編碼選定的視訊檔案」服務。

答案1

尤里卡!我在網路上找到了一個確實有效的 Automator 工作流程。我只需修改它以將電影文件而不是圖像作為輸入。它使用 QuickTime 7 中的“最新設置”,因此我只需要手動導出第一個視頻即可正確輸入設置,其餘的我只需選擇並批處理即可。萬歲!

我找到的包含資訊和工作流程文件的原始頁面位於此處: http://ptrbrtz.net/batch-convert-animated-gifs-to-videos-using-applescript-automator-quicktime-7-on-os-x/

我也會在此處新增腳本,以防我連結的頁面消失。只需將其作為服務添加到 Automator 中,並將 Finder 中的電影檔案作為輸入即可。

顯示如何在 Automator 中新增服務的影像

這是要新增到服務中的 AppleScript。我剛剛將該服務儲存為“Export_mov_via_QuickTime7.workflow”。

on run {inputFiles}
    if inputFiles is equal to {} then
        set inputFiles to (choose file with prompt "Select the file(s) to convert:" with multiple selections allowed without invisibles)
    end if
    open inputFiles
end run

on open droppedItems
    tell application "Finder" to set inputFolder to (container of first item of droppedItems) as Unicode text
    set outputFolder to (choose folder with prompt "Select output folder:" default location (inputFolder as alias)) as Unicode text

    display dialog "Most recent QuickTime 7 export settings will be used.
Existing files will be overwritten/moved to trash!
Beware of evil QT7 Gamma shift!"

    tell application "QuickTime Player 7"
        activate
        close every window
    end tell

    repeat with currentItem in droppedItems
        tell application "Finder" to set fileName to name of currentItem as Unicode text

        tell application "QuickTime Player 7"
            open currentItem
            tell front document to set frameCount to count of frames of first track
        end tell

        set outputFileName to (outputFolder & fileName & ".mov")

        tell application "Finder"
            if exists file outputFileName then
                delete file outputFileName
            end if
        end tell

        tell application "QuickTime Player 7"
            if frameCount is greater than 1 then
                with timeout of 86400 seconds -- 24 hours
                    export front document to outputFileName as QuickTime movie using most recent settings
                end timeout
            end if
            close front document
        end tell
    end repeat

    quit application "QuickTime Player 7"
end open

現在,無論何時您想使用 QuickTime Player 7 Pro 批量導出視頻,無論您選擇什麼設置,您只需選擇要導出的所有其他視頻,在 F​​inder-> 服務菜單下選擇服務,然後享受一杯美味的咖啡轉換所有影片時中斷! =D

相關內容