post(tutorials): does re-encoding to HEVC actually shrink your files? I measured it (EN+ZH) + og/banner
Deploy / build (push) Successful in 19s

Measured on real files with quality held fixed (SSIM vs the source, harness self-tested at 1.0000):
hevc_nvenc cq27 produced 115% and 119% of the source video bitrate on two of three files while cq30/31
landed 51-84%; libx265 crf26 landed 33.7/56.7/67.0% at min SSIM 0.988-0.993, i.e. 10-22% smaller than
NVENC at matched quality. Two sources with identical bpp (0.0437) shrank 49% vs 17%, so bpp classifies
files but does not predict the ratio. Notes the audio floor (a 33.7% video stream still yields a 53%
file because AAC dominates what is left) and why VP9/AV1 sources have no headroom (copy the video).
This commit is contained in:
2026-10-08 05:19:27 +08:00
parent 0b523f40d6
commit 541b00c958
6 changed files with 261 additions and 0 deletions
+18
View File
@@ -1185,6 +1185,24 @@ BANNERS['it-reported-success-nothing-had-changed'] = {
],
};
BANNERS['does-hevc-actually-shrink-your-files'] = {
titlebar: "root@media - does HEVC shrink it?",
lines: [
{ t: 'prompt', text: "$" }, { t: 'cmd', text: "measure.sh --source h264-a.mp4" },
{ t: 'dim', text: "nvenc cq27 -> 72.4% of source bitrate" }, { t: 'err', text: "nvenc cq27 -> 115.2% on the 720p file" },
{ t: 'prompt', text: "$" }, { t: 'cmd', text: "libx265 -crf 26 -preset medium" },
{ t: 'ok', text: "33.7% / 56.7% / 67.0% at min SSIM 0.99" }, { t: 'hl', text: "same quality, or the comparison is noise" },
{ t: 'dim', text: "software beats hardware by 10-22%" }, { t: 'dim', text: "VP9/AV1 sources: no headroom, copy" },
],
flow: [
{ n: '1', label: "classify bpp" },
{ n: '2', label: "encode" },
{ n: '3', label: "ssim" },
{ n: '4', label: "compare" },
{ n: '5', label: "cap size" },
],
};
// ---------- read frontmatter ----------
const postPath = join(ROOT, 'src', 'content', 'posts', `${slug}.md`);
let category = 'devops';
+6
View File
@@ -361,6 +361,12 @@ TERMINALS['it-reported-success-nothing-had-changed'] = `
<div class="line"><span class="prompt">$</span><span class="cmd">read-back hash -> mismatch</span></div>
<div class="line"><span class="prompt">&nbsp;</span><span class="cmd">re-upload -> hash match</span><span class="fix">-> verified</span></div>`;
TERMINALS['does-hevc-actually-shrink-your-files'] = `
<div class="line"><span class="prompt">$</span><span class="cmd">hevc_nvenc -cq 27 -> 115% of source bitrate</span></div>
<div class="line"><span class="prompt">&nbsp;</span><span class="err">the "high quality" default made it BIGGER</span></div>
<div class="line"><span class="prompt">$</span><span class="cmd">libx265 -crf 26 -> 56.7%</span></div>
<div class="line"><span class="prompt">&nbsp;</span><span class="cmd">min SSIM 0.988 · 22% smaller than NVENC</span><span class="fix">-> measured</span></div>`;
// ---------- read frontmatter ----------
const postPath = join(ROOT, 'src', 'content', 'posts', `${slug}.md`);
if (!existsSync(postPath)) {