惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
MyScale Blog
MyScale Blog
Jina AI
Jina AI
B
Blog
Microsoft Security Blog
Microsoft Security Blog
T
Troy Hunt's Blog
博客园_首页
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
GbyAI
GbyAI
T
Tenable Blog
B
Blog RSS Feed
S
Securelist
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
罗磊的独立博客
AWS News Blog
AWS News Blog
V
V2EX
宝玉的分享
宝玉的分享
J
Java Code Geeks
小众软件
小众软件
Spread Privacy
Spread Privacy
腾讯CDC
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
V
Visual Studio Blog
The Hacker News
The Hacker News
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
C
Check Point Blog
Webroot Blog
Webroot Blog
D
DataBreaches.Net
Cloudbric
Cloudbric
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家

博客园 - 星河赵

flask fastapi mysql 常用命令 LangChain AI 客服 Agent 项目学习笔记 海外stripe 聚合支付 AE中制作带可替换屏幕的视频模版 记录|AI超写实短视频制作流程+提示词 服务端部署Vue 在Pycharm 中使用 Python Module 方式启动 uvicorn Conda 虚拟环境完整指南 CentOS / OpenCloudOS 服务器如何安装远程桌面 Python 项目模块导入问题解决方案 2026 谷歌 Antigravity 最新安装教程! Vscode 常用配置 如何修改 Redis 数据存放路径 Vue 后台项目 Nginx 部署笔记(SPA / Vite 构建) Python -m 用法(极简版) Ubuntu 上安装 MongoDB 并启用事务的完整流程 mac 微信双开新方法 nginx 对静态资源进行压缩 HMAC-SHA256 请求签名与验签实践(Python 可直接复用) python fast api websocket 连接事例 在 Flask 中并发执行任务 Vscode 配置快捷键和JetBrains(pycharm)一样 Linux 服务器的 SSH 登录端口号 从默认的 22 改掉 配置 Docker 镜像加速器 python fast api 部署
ffmpeg 介绍
星河赵 · 2026-05-29 · via 博客园 - 星河赵

FFmpeg 是一款功能极其强大的开源音视频处理工具。由于它基于命令行操作,记住所有参数并不现实。

以下为你整理了 FFmpeg 最常用的核心命令和场景,方便你快速查阅。

1.查看视频基本信息

image

2.视频格式转换(如 MKV 转 MP4):

ffmpeg -i input.mkv output.mp4

3.音频格式转换(如 WAV 转 MP3):

ffmpeg -i input.wav output.mp3

4.不重新编码(极速转换): 如果只是想换个容器(封装格式),可以用 -c copy,这会跳过编解码过程,速度极快且无损。

ffmpeg -i input.mkv -c copy output.mp4

视频剪切

  • 常用参数:

    • -ss: 开始时间 (格式为 hh:mm:ss 或秒数)

    • -to: 结束时间

    • -t: 持续时间 (与 -to 二选一)

# 从第 10 秒开始,截取 20 秒的视频(即到第 30 秒)
ffmpeg -i input.mp4 -ss 00:00:10 -t 20 -c copy output.mp4

# 从第 10 秒开始,截取到第 50 秒
ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:50 -c copy output.mp4

视频合并

如果要合并相同编码、相同分辨率的视频,最快的方法是创建一个文本文件 filelist.txt

file 'part1.mp4'
file 'part2.mp4'

然后运行:

ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp4

如果你觉得视频体积太大,可以通过降低码率(Bitrate)或使用 CRF (Constant Rate Factor) 模式来压缩。CRF 是推荐的压制方式,数值范围为 0–51,23 为默认值,数值越小画质越好,通常 18-28 之间是性价比最高的区间

使用 H.264 编码压缩视频:

ffmpeg -i input.mp4 -vcodec libx264 -crf 22 output.mp4

使用现代的 H.265 (HEVC) 编码(压缩率更高):

ffmpeg -i input.mp4 -vcodec libx265 -crf 24 output.mp4