跳到正文
Skillpedia
视频剪辑75k · #3074

video-optimization

它能做什么

这个技能检查网站上的视频文件,并建议如何使其更小。它面向因视频而导致页面加载缓慢的网站所有者和开发者。

适用场景

  • ✓页面加载了一个大视频,拖慢了首屏显示的时候。
  • ✓网站把 4K 视频提供给小尺寸的手机屏幕的时候。
  • ✓无声背景视频包含不需要的音轨的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/video-optimization/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/video-optimization/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的首页有一个背景视频,体积非常大。请帮我让它加载得更快吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会根据视频出现的位置,检查每个视频的分辨率、编解码器、音频和文件大小。然后它会建议为较小的屏幕重新编码并提供更小的版本。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Optimize and compress web videos

Unoptimized video is frequently the single heaviest asset on a page—an uncompressed or oversized video can dwarf every image and script combined, delaying Largest Contentful Paint and burning mobile data budgets.

Quick Reference

  • Re-encode source video instead of shipping raw camera/screen-recorder output
  • Serve multiple resolutions so mobile doesn't download a 4K file
  • Prefer modern codecs: AV1/VP9/HEVC over baseline H.264 where supported
  • Strip audio tracks from silent background/looping videos

Check

Scan this codebase for <video> elements and video asset references. For each one, verify: 1) The served resolution is appropriate for the rendered player size and device (no 4K video in a 400px player). 2) The codec/container is efficient (H.264 baseline is acceptable but VP9/AV1/HEVC is preferred when available). 3) Audio is stripped from silent background/looping videos. 4) A poster attribute or lightweight thumbnail is present. 5) File size is reasonable for its duration and placement (hero/background videos under a few MB). Report issues grouped by severity with file paths.

Fix

For each video optimization issue found: 1) Re-encode to multiple resolutions (e.g. 480p/720p/1080p) and serve the smallest one that fits the player via <source> or JS-based selection. 2) Convert to an efficient codec (VP9 or AV1 in WebM, or HEVC/H.264 in MP4) with a reasonable CRF/ quality setting rather than default encoder settings. 3) Remove the audio track from muted background/looping videos. 4) Add a poster attribute pointing to a compressed thumbnail. 5) Add preload="metadata" (or "none") instead of "auto" for below-the-fold videos. Show the corrected <video> markup and encoding command.

Explain

Explain why video is often the largest asset on a page and how it affects Largest Contentful Paint and mobile data usage. Cover the tradeoffs between H.264, HEVC, VP9, and AV1 (compression efficiency vs browser/ device support and encode time), how resolution and bitrate should scale to the rendered player size and viewport, and why muted background video should have its audio track stripped entirely rather than just muted in markup.

Code Review

Review video assets, <video>/<source> markup, and any encoding or CDN transform pipeline related to Optimize and compress web videos. Flag exact files or components where resolution, codec, bitrate, or loading behavior violates the rule, and describe how to confirm the fix in DevTools' Network and Media panels.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/video-optimization

常见问题

哪种视频格式更好?

在支持的情况下,这个技能更倾向于 VP9、AV1 或 HEVC 等现代编解码器,而不是基础的 H.264。

为什么要提供多种分辨率?

这样手机就不必下载为大屏幕准备的大文件。页面会提供适合播放器的最小版本。

无声视频需要保留音频吗?

不需要。这个技能说,应去掉无声背景或循环视频中的音频。

详情

作者的原始描述

Use when reviewing <video> elements, background/hero video, or embedded media assets. Check encoded bitrate, resolution relative to the rendered player size, codec/container choice, and whether a poster/thumbnail avoids blocking on the first frame.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#3074
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能