2

我需要将一堆大的.avis 导出/压缩到.movs。

我找到了下面的动作脚本(取自http://ldopa.net/2008/05/23/batch-export-for-quicktime-pro/)来做到这一点。

它成功地从桌面上名为“Input”的文件夹中获取视频,并将它们导出到桌面上名为“Export”的文件夹中。

唯一的问题是,它没有导出我在 Quicktime 中使用的“最新设置”。此外,它将其导出为 .mp4 而不是 .mov。

注意:原始脚本确实说:

export front document to output_file as MPEG-4

但我将其更改为:

export front document to output_file as QuickTime movie

它仍然以 mpeg-4 格式导出。

完整脚本:

with timeout of 86400 seconds

    display dialog "Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop." with icon note

    tell application "Finder"
        set the startup_disk to the name of the startup disk
    end tell

    set user to do shell script "whoami"
    set input_folder_name to "Input"
    set input_folder to startup_disk & ":Users:" & user & ":Desktop:" & input_folder_name & ":"
    set user_desktop to startup_disk & ":Users:" & user & ":Desktop:"
    set output_folder to startup_disk & ":Users:" & user & ":Desktop:Output:"
    set file_extension to "_export.mp4"

    try
        tell application "Finder"
            make new folder at user_desktop with properties {name:"Output"}
        end tell
    end try

    try
        set the_folder_list to list folder input_folder without invisibles
        repeat with x from 1 to count of the_folder_list
            set the_file to input_folder & item x of the_folder_list
            set output_file to output_folder & item x of the_folder_list & file_extension
            tell application "QuickTime Player"
                activate
                open the_file
                export front document to output_file as QuickTime movie using most recent settings with replacing
                close front document
            end tell
        end repeat
    on error
        display dialog "This script requires a folder named ‘" & input_folder_name & "‘ located on the desktop." with icon stop
    end try

    beep

end timeout
4

3 回答 3

1

只是一个快速的镜头,但您可以尝试更改以下行

set file_extension to "_export.mp4"

set file_extension to "_export.mov"

不知道这是否会起作用,但它可能会有所帮助。

于 2009-04-21T06:21:47.030 回答
1

如果您想要比仅使用以前的设置更好的控制,您可以保存导出设置。使用您想要的设置设置导出,然后使用类似

tell quicktime player
    tell movie 1
        save export settings for Quick Time Movie to mysettingsfile--or whatever format you exported to
    end tell
end tell

我不知道为什么你必须指定一个文档,而不是应用程序,但字典中就是这样。


您还可以使用诸如MPEG Streamclip(免费)或ffmpeg(FOSS,仅命令行,但确实存在 GUI)之类的程序来做同样的事情。MPEG Streamclip 带有一个批处理列表功能,几乎可以将任何内容转换为其他任何内容。省去你重新发明轮子的麻烦。

于 2009-07-23T18:40:47.677 回答
0

您应该使用组合。

将 file_extension 更改为 .mov(如 Bjoern 所说)并将 MPEG-4 更改为 Quicktime Movie。

您的更改会将电影导出为 MOV 文件,但不会更改文件扩展名。(如果您尝试使用仅限 MOV 的播放器打开它,它应该能够播放电影)

干杯,

于 2009-05-12T11:46:42.083 回答