FFmpeg:把命令读成人话FFmpeg: Reading a Command

难度LEVELL1 · 入门L1 · Beginner 领域TOPIC交付

学习目标LEARNING OBJECTIVES

学完你能把一条 FFmpeg 命令读成人话,并知道 crf 怎么选。

概念说明CONCEPTS

ffmpeg -i input.mov -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output.mp4:输入文件 → 视频用 H.264 编码 → crf 质量(越小越好)→ preset slow(慢一点换更小体积)→ 音频 AAC 192k → 输出文件(格式由后缀决定)。

crf 怎么选:18 接近无损(母版留档)、23 日常交付、28+ 暗部和渐变开始出块。

备用两条:抽一帧 ffmpeg -ss 00:00:12 -i in.mp4 -frames:v 1 shot.png;无损剪一段 ffmpeg -ss 00:00:10 -to 00:00:25 -i in.mp4 -c copy clip.mp4。

操作步骤STEPS

  1. 把命令按空格拆成六段,逐段说人话
  2. 改 crf 为 28 再导一次,对比体积与暗部
  3. 用 ffprobe 验证输出参数

练习PRACTICE

动手任务

把一条素材分别用 crf 18 与 28 各导一次,对比体积与暗部渐变。

自检清单

做完任务后逐条自查,全部能打勾才算过。

常见问题FAQ

crf 18 和 23 差别大吗?

18 接近无损(母版用),23 日常交付最省心;28 以上暗部和渐变开始出块。

-preset slow 是画质更好吗?

不是——慢一点,换更小体积:同样质量下文件更小。

Learning Objectives学习目标

After this card you can read an FFmpeg command like a sentence and choose crf with intent.

Concepts概念说明

ffmpeg -i input.mov -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output.mp4: input file → video coded as H.264 → crf quality (lower is better) → preset slow (slower, smaller file) → audio AAC 192k → output file (format follows the extension).

Choosing crf: 18 near-lossless (archive masters), 23 everyday delivery, 28+ blocks appear in shadows and gradients.

Two spares: grab a frame ffmpeg -ss 00:00:12 -i in.mp4 -frames:v 1 shot.png; lossless trim ffmpeg -ss 00:00:10 -to 00:00:25 -i in.mp4 -c copy clip.mp4.

Steps操作步骤

  1. Split the command into six parts and say each in plain words
  2. Re-export at crf 28 and compare size and shadows
  3. Verify the output parameters with ffprobe

Practice练习

Hands-on task

Export one clip at crf 18 and again at 28; compare size and gradient banding.

Self-check

Work through the task, then tick every line; all checked means you own this card.

FAQ常见问题

Is there a big difference between crf 18 and 23?

18 is near-lossless (masters), 23 is the everyday delivery sweet spot; 28+ starts blocking in shadows and gradients.

Does -preset slow mean better quality?

No — slower, smaller file: the same quality at a smaller size.