FFmpeg指定编码重编码省略码率参数的行为及默认码率来源咨询
Great question—let’s break down exactly what’s happening here, since this is a common point of confusion with FFmpeg’s default settings.
What’s going on when you skip the bitrate parameter?
When you run the command ffmpeg.exe -i a.mp4 -c:v h264 c.mp4, FFmpeg defaults to using the libx264 encoder (the industry-standard open-source H.264 encoder) for H.264 video. Instead of locking into a fixed bitrate, libx264 uses a Constant Rate Factor (CRF) mode by default—this mode prioritizes keeping a consistent subjective quality level, rather than hitting a specific bitrate target.
Where does that 4467 kb/s bitrate come from?
That output bitrate isn’t a universal standard value—it’s determined by three key factors:
- Default CRF value: libx264 uses a default CRF of 23, a setting calibrated to balance visual quality and file size (often called "visually lossless" for most everyday use cases).
- Original video content: The encoder dynamically adjusts bitrate based on how complex your source video is. For example:
- Fast-moving, high-detail scenes (like action footage) will need a higher bitrate to maintain the CRF 23 quality bar.
- Static or low-detail scenes (like a talking head or slideshow) will use a much lower bitrate.
- Encoder efficiency: libx264 is far more efficient than many other encoders (including some hardware-based ones). Your original video’s 17282 kb/s bitrate might have come from a less efficient encoder, or it could have been over-provisioned with bits that didn’t add meaningful quality. libx264 cuts that excess while preserving similar visual fidelity.
Will this bitrate be the same for all videos?
Nope—you’d get wildly different results if you ran the same command on a 4K action clip vs. a 720P static slideshow. CRF mode keeps quality consistent, but bitrate shifts entirely based on the source content’s complexity.
How to control bitrate explicitly if you need to?
If you want a fixed bitrate instead of quality-based encoding, use the -b:v parameter. For example:
ffmpeg.exe -i a.mp4 -c:v h264 -b:v 5M c.mp4
This forces an average bitrate of 5 Mbps. Alternatively, you can tweak the CRF value to adjust the quality/file size tradeoff: lower values (e.g., 18-20) mean higher quality and larger files, while higher values (e.g., 25-28) mean smaller files with subtle quality loss.
内容的提问来源于stack exchange,提问作者Rafael Lima

