video-optimization
Skill này làm gì
Skill này rà soát các file video trên website và gợi ý cách làm chúng nhỏ hơn. Nó dành cho chủ website và lập trình viên có trang tải chậm vì video.
Khi nào nên dùng
- ✓Khi một trang tải video lớn làm chậm lần xem đầu tiên.
- ✓Khi website phục vụ video 4K cho màn hình điện thoại nhỏ.
- ✓Khi video nền không có tiếng lại có một track âm thanh không cần thiết.
Liên kết skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/video-optimization/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Trang chủ của tôi có video nền và nó rất nặng. Làm sao để nó tải nhanh hơn?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra độ phân giải, codec, âm thanh và dung lượng của từng video theo nơi nó xuất hiện. Sau đó nó gợi ý mã hóa lại và phục vụ các phiên bản nhỏ hơn cho màn hình nhỏ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Định dạng video nào tốt hơn?
Skill ưu tiên các codec hiện đại như VP9, AV1 hoặc HEVC khi được hỗ trợ, thay vì H.264 cơ bản khi có thể.
Tại sao nên cung cấp nhiều độ phân giải?
Để điện thoại không phải tải file lớn dành cho màn hình lớn. Trang phục vụ phiên bản nhỏ nhất vừa với trình phát.
Video không tiếng có nên giữ âm thanh không?
Không. Skill cho biết nên loại bỏ âm thanh khỏi video nền hoặc video lặp không có tiếng.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 75k
- Vị trí xếp hạng
- #3074
- Giấy phép
- MIT
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
frontendchecklist
75kKiểm tra mã frontend và trang trực tiếp theo hơn 380 quy tắc về khả năng tiếp cận, tốc độ, SEO và bảo mật, bằng một công cụ dòng lệnh.
frontend-checklist-global
75kKiểm toán một dự án frontend theo đủ 386 quy tắc của Front-End Checklist, và đưa cách sửa cụ thể cho từng vấn đề tìm thấy.
404-page
75kKiểm tra xem trang báo thiếu của bạn có đưa ra các liên kết hữu ích và trả về mã trạng thái 404 thật hay không, để giúp khách bị lạc tìm đường.
about-page
75kKiểm tra xem trang web có trang Giới thiệu rõ ràng giải thích ai điều hành nó hay không, để xây dựng niềm tin với khách và công cụ tìm kiếm.
Skill tương tự
taste-application
280kGiúp agent tạo video theo phong cách cụ thể: sao chép nhịp dựng từ video mẫu, tạo cảnh mới, chỉnh màu và ghép với các đoạn có sẵn.
taste-distillation
280kGiúp agent phân tích video để tạo style pack gồm màu sắc, nhịp cắt và yếu tố hình ảnh, tái sử dụng để tạo video mới cùng phong cách.
ui-demo
280kGiúp agent ghi lại video demo giao diện chỉn chu. Hữu ích để tạo hướng dẫn hoặc cho thấy một ứng dụng web hoạt động ra sao.