{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-video-optimization-d1db041a0065","title":"Optimize and Compress Web Videos","summary":"Reduce video file size and improve performance by re-encoding, selecting efficient codecs, and optimizing resolution and bitrate. Deliverables include optimized video files and corrected <video> markup with appropriate resolutions, codecs, and loading behaviors.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-optimization-d1db041a0065","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-video-optimization-d1db041a0065","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-optimization-d1db041a0065.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-optimization-d1db041a0065\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before starting, validate that the video files are accessible and that the target environment supports modern codecs like AV1 or VP9. Prepare a compressed thumbnail for the poster attribute and ensure the video is re-encoded to multiple resolutions (e.g., 480p, 720p, 1080p) based on the rendered player size.","instructions":"---\nname: video-optimization\ndescription: \"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.\"\nmetadata:\n  category: performance\n  priority: high\n  difficulty: intermediate\n  estimatedTime: \"20\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/performance\/video-optimization\n---\n\n# Optimize and compress web videos\n\nUnoptimized video is frequently the single heaviest asset on a page\u2014an uncompressed or oversized video can dwarf every image and script combined, delaying Largest Contentful Paint and burning mobile data budgets.\n\n## Quick Reference\n\n- Re-encode source video instead of shipping raw camera\/screen-recorder output\n- Serve multiple resolutions so mobile doesn't download a 4K file\n- Prefer modern codecs: AV1\/VP9\/HEVC over baseline H.264 where supported\n- Strip audio tracks from silent background\/looping videos\n\n## Check\n\nScan 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.\n\n## Fix\n\nFor 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.\n\n## Explain\n\nExplain 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.\n\n## Code Review\n\nReview 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.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/performance\/video-optimization\n","use_cases":["Optimize background\/hero videos for mobile performance","Reduce the size of embedded video assets","Improve Largest Contentful Paint for video-heavy pages"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/video-optimization\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T06:07:23.000000Z","updated_at":"2026-11-24T07:12:47.000000Z","seo_title":"Optimize and compress web videos for performance","seo_description":"Improve website performance by optimizing video files, reducing file size, and enhancing user experience with efficient codecs and resolutions.","seo_keywords":["optimize web videos","compress video files","reduce video file size","improve video performance","optimize video for mobile"]}}