我需要將一堆大的.avis文件導出/壓縮爲.mov文件。AppleScript從QuickTime洗出口:無法將其導出爲.mov而不是.mp4
我發現下面的動作腳本(取自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
MPEG4容器*是* QuickTime電影。這只是一個標準化的現代QuickTime電影。如果你有一個帶有「.mp4」文件擴展名的文件,你可以簡單地將它改爲「.mov」並且它可以工作。但是沒有理由這樣做。 「.mp4」表示「QuickTime電影+」 - 它表示「我不只是一部QuickTime電影,我是一部標準化的現代QuickTime電影。」您應該關心的主要事情不是電影容器,而是轉換容器內的視頻軌道。也就是說,過時的AVI編解碼器視頻軌道轉碼爲現代H.264編解碼器視頻軌道。 – 2014-08-14 17:48:16