ffmpeg 使用
安装
确定已经安装 Homebrew
Homebrew 使用
# 安装
brew install ffmpeg
# 更新最新版本
brew update && brew upgrade ffmpeg
使用
视频转 GIF
# 视频转 GIF
ffmpeg -i video.mp4 video.gif
# 尺寸缩小 1/2
ffmpeg -i video.mp4 -vf scale=iw/2:-1:flags=lanczos video.gif
视频格式转换
ffmpeg -i video.mp4 video.avi
屏幕录制
# 查找当前的设备
ffmpeg -f avfoundation -list_devices true -i ""
# 录制 screen 0
ffmpeg -f avfoundation -i "0" output.ts
# 如果你有音频设备的话,可以指定音频设备下标
ffmpeg -f avfoundation -i "0:0" output.ts
视频下载
# 下载 m3u8 视频
ffmpeg -i [m3u8-url] -c copy video.ts
PREV
听说你想要建站?
NEXT