使用特定的导出设置通过 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 批量导出视频,无论您选择什么设置,只需选择要导出的所有其他视频,在 Finder->Services 菜单下选择服务,然后在转换所有视频的同时享受美好的咖啡休息时间!=D

相关内容