---
title: "用 FFmpeg 和 Apple Script 压缩视频"
description: "打造一个可以把视频拖放上去、大幅压缩视频的应用程序："
canonical: https://oozou.com/til/use-ffmpeg-and-apple-script-to-compress-videos-12
locale: zh-Hans
date: 2020-10-13
topic: macos
---

# 用 FFmpeg 和 Apple Script 压缩视频

> 打造一个可以把视频拖放上去、大幅压缩视频的应用程序：

Published: 2020-10-13 · Topic: [macos](https://oozou.com/zh-Hans/til-topics/macos) ([markdown](https://oozou.com/zh-Hans/til-topics/macos.md))

打造一个可以把视频拖放上去、大幅压缩视频的应用程序：

先确定你已安装 *ffmpeg*（*brew install ffmpeg*）。

创建一个新的 Apple Script app：
*AppleScript
on open filelist
repeat with i in filelist
tell application "Terminal"
do script "ffmpeg -i " & POSIX path of i & " -vcodec h264 -acodec mp2 " & POSIX path of i & "\_compressed.mp4"
end tell
end repeat
end open*

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hans/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
