# Compressing Video with FFmpeg | Creght Visual Documentation

> Large video files are a common reason for slow web pages, especially on mobile. They increase bandwidth usage, delay page loading, hurt user experience, and may…

[![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)Help Center](/help)

[Changelog](/blogs)

[AI](/docs/ai/quick-create-first-website) [Visual](/docs/get-start)

Basic

- [Get to Know Creght in 2 Minutes](/docs/get-start)
- [How to Register for Creght](/docs/signup)
- [Creating a Project in Creght](/docs/create-site)
- [Templates](/docs/tpls)

Design

- [Using the Editor](/docs/editor)
- [Basic Operations](/docs/operating)
- [Layouts in Creght](/docs/layout)
- [Position in Creght](/docs/position)
- [Size in Creght](/docs/size)
- [Breakpoints in Creght](/docs/breakpoint)
- [Overlays](/docs/popover)
- [Components in Creght](/docs/components)
- [Adding Third-Party Fonts](/docs/tp-font)
- [Duplicate and Deep Copy](/docs/deep-copy)

CMS

- [CMS (Content Management System)](/docs/cms)
- [Importing WeChat Official Account Articles into CMS](/docs/wxmp)

Site Setting

- [Page Settings](/docs/page-setting)
- [How to Upgrade a Plan](/docs/manage-plan)
- [SEO Settings](/docs/seo-setting)
- [Small Files (Site Verification)](/docs/verification-file)
- [Adding a Custom Domain in Creght](/docs/custom-domain)
- [How to Complete ICP Filing](/docs/beian)
- [Server Nodes](/docs/website-node)
- [How to Switch Sites](/docs/pxrp79jqtnyq)
- [Localization](/docs/localization)

AI

- [About Creght AI](/docs/creght-ai)
- [AI Text Processing](/docs/ai-text)
- [AI - Page Generation](/docs/ai-generate)

Tool

- [Convert Figma Designs into Live Websites](/docs/figma-to-creght)
- [3 Guidelines for Responsive Figma Layouts](/docs/figma-autolayout)
- [Covert Figma to live website](/docs/response-site)
- [Figma to Responsive Website: Interactions](/docs/figma03)
- [Compressing Video with FFmpeg](/docs/ffmpeg)
- [How to Add Clarity to Your Website](/docs/clarity)
- [Creating a Button Hover Effect](/docs/button)
- [How to Build a Reusable Collapsible FAQ Panel](/docs/collapse)
- [Responsive Navigation Tutorial](/docs/nav)

Tool/

# Compressing Video with FFmpeg

Large video files are a common reason for slow web pages, especially on mobile. They increase bandwidth usage, delay page loading, hurt user experience, and may cause users to leave.

Using FFmpeg to compress video can significantly reduce file size while keeping acceptable visual quality. This improves loading speed, lowers bandwidth costs, supports mobile playback, and works in mainstream browsers without plugins.

## What Is FFmpeg?

FFmpeg is an open-source cross-platform audio and video toolkit. It supports recording, converting, streaming, and compressing almost all common audio and video formats.

## Install FFmpeg

On Windows, download a static build from [ffmpeg.org](https://ffmpeg.org/download.html), unzip it, and add the bin directory to your PATH.

On macOS, install with Homebrew: `brew install ffmpeg`.

On Debian or Ubuntu, run `sudo apt update` and `sudo apt install ffmpeg`. On RHEL or CentOS, run `sudo yum install ffmpeg ffmpeg-devel`.

## Basic Compression

Compress while keeping the original resolution:

```
ffmpeg -i input.mp4 -vcodec libx264 -crf 23 -preset medium output.mp4
```

`crf` controls quality. Lower values mean higher quality. `preset` balances speed and quality.

Resize to 1080p:

```
ffmpeg -i input.mp4 -vf "scale=1920:1080" -vcodec libx264 -crf 23 output.mp4
```

For stronger compression, use a higher CRF and slower preset:

```
ffmpeg -i input.mp4 -vcodec libx264 -crf 28 -preset slow -tune film output.mp4
```

## Best Practices

For most web videos, 1080p with CRF 24 provides a good balance between quality and file size:

```
ffmpeg -i input.mp4 -vf "scale=1920:1080" -vcodec libx264 -crf 24 output.mp4
```

Test with a short clip before processing the full video. If file size is critical, try CRF 28. Prefer 1080p with a tuned CRF over reducing resolution too far, because very low resolution can look blurry.

## FAQ

If quality drops too much, lower the CRF value or use a slower preset. To batch-compress files on Linux or macOS, use a shell loop. If compression is too slow, use a faster preset or hardware acceleration.

On this page

- [What Is FFmpeg?](#what-is-ffmpeg)
- [Install FFmpeg](#install-ffmpeg)
- [Basic Compression](#basic-compression)
- [Best Practices](#best-practices)
- [FAQ](#faq)

![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)

This website is built with [Creght](/)

[Discord](https://discord.gg/Qvq2nmZNnb)

## Links

- [Pricing](/price)
- [Help Center](/help)
- [Contact Us](/contact)
- [Blog](/blogs)
- [Refund Policy](/tuikuan)

## Resources

- [All Resources](/resources)
- [Templates](/templates)
- [Components](https://creghtlib.site.creght.com)
- [Animations](/effects)
- [Figma to Creght](/figma2creght)
- [API for AI](/api)

## Terms

- [Terms of Service](/legal/terms)
- [Privacy Policy](/legal/privacy)
- [Acceptable Use Policy](/legal/acceptable-use)

## Social Media

- [Twitter](https://twitter.com)
- [Facebook](https://www.facebook.com)
- [LinkedIn](https://www.linkedin.com)

[蜀ICP备2023038192号-2](https://beian.miit.gov.cn)
