AppleScript从QuickTime导出导出:无法将其导出为.mov而不是.mp4

时间:2022-11-23 11:04:18

I need to export /compress a bunch of large .avis to .movs.

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

I found the Action Script below (taken from http://ldopa.net/2008/05/23/batch-export-for-quicktime-pro/) to do that.

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

It successfully takes the videos from a folder called "Input" on the desktop and exports them to a folder called "Export" on the desktop.

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

Only problem is though, it isn't exporting "with most recent settings" that I used in Quicktime. Furthermore, it exports it as .mp4 instead of .mov.

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

Note: the original script did say:

注意:原始脚本确实说:

export front document to output_file as MPEG-4

But I changed it to:

但我把它改为:

export front document to output_file as QuickTime movie

And it's still exporting as mpeg-4.

它仍然以mpeg-4的形式出口。

Full script:

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

3 个解决方案

#1


Just a quick shot, but you could try to change the following line

只是快速拍摄,但您可以尝试更改以下行

set file_extension to "_export.mp4"

to

set file_extension to "_export.mov"

No idea if this will do the trick, but it may help.

不知道这是否可以解决问题,但它可能有所帮助。

#2


If you want better control than just using the previous settings, you can save the export settings. Set up an export with the settings how you want it and then use something like

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

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

I don't know why you have to specify a document, rather than the app, but that's how it is in the dictionary.

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


You could also use a programme like MPEG Streamclip (Free) or ffmpeg (FOSS, command line only, but GUIs do exist) to do the same thing. MPEG Streamclip comes with a batch list facility and can convert pretty much anything to anything else. Saves you having to reinvent the wheel.

#3


You should use a combination.

你应该使用一个组合。

Change the file_extension to .mov (as Bjoern) said and change the MPEG-4 to Quicktime Movie.

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

Your change would export the movie as a MOV-file but not change the file extension. (If you tried to open it with a MOV-only-player it should be able to play the movie)

您的更改会将影片导出为MOV文件,但不会更改文件扩展名。 (如果你试图用MOV-only-player打开它应该可以播放电影)

Cheers,

#1


Just a quick shot, but you could try to change the following line

只是快速拍摄,但您可以尝试更改以下行

set file_extension to "_export.mp4"

to

set file_extension to "_export.mov"

No idea if this will do the trick, but it may help.

不知道这是否可以解决问题,但它可能有所帮助。

#2


If you want better control than just using the previous settings, you can save the export settings. Set up an export with the settings how you want it and then use something like

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

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

I don't know why you have to specify a document, rather than the app, but that's how it is in the dictionary.

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


You could also use a programme like MPEG Streamclip (Free) or ffmpeg (FOSS, command line only, but GUIs do exist) to do the same thing. MPEG Streamclip comes with a batch list facility and can convert pretty much anything to anything else. Saves you having to reinvent the wheel.

#3


You should use a combination.

你应该使用一个组合。

Change the file_extension to .mov (as Bjoern) said and change the MPEG-4 to Quicktime Movie.

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

Your change would export the movie as a MOV-file but not change the file extension. (If you tried to open it with a MOV-only-player it should be able to play the movie)

您的更改会将影片导出为MOV文件,但不会更改文件扩展名。 (如果你试图用MOV-only-player打开它应该可以播放电影)

Cheers,