有一种比将电影重新编码为mp4更简单的方法。在quicktime中,您可以从电影导出图像序列。图像序列的图像可以是png图像。因此,您可以应用此脚本。这是你需要做的事情的基本轮廓。可能看起来很复杂,但其实很简单。
首先,为导出为图像序列创建一个设置文件。可以通过启动导出并设置导出的设置来完成此操作。然后运行此applescript将设置保存在文件中。。。
set exportFileName to "ImageSequenceExportSettings.qtSettings"
set exportFilePath to (path to desktop as text) & exportFileName
tell application "QuickTime Player 7"
tell first document
save export settings for image sequence to file exportFilePath
end tell
end tell
其次,你的applescript需要一段时间在你想要图像的地方,然后你基本上修剪电影,使它只包含该时间的帧,然后你使用设置文件将该帧导出为你的图像,如下所示。。。注意:我没有测试下面的脚本
set timeOfImage to 60 -- in seconds
set settingsFile to (path to desktop as text) & "ImageSequenceExportSettings.qtSettings"
tell application "QuickTime Player 7"
tell document 1
if (can export as image sequence) then
-- trim the movie to one frame
set ts to time scale
set theFrame to timeOfImage * ts
select at theFrame to (theFrame + 1)
trim
-- save the image
set theName to text 1 thru -5 of (get name)
set outPath to (path to desktop as text) & theName & ".png"
export to outPath as image sequence using settings settingsFile
-- close the movie
close saving no
else
error "The front movie cannot be exported to an image sequence!"
end if
end tell
end tell