Pixelated Videos: Improve Quality using FFmpeg

Abstract: Resolve pixelated MP4 videos by converting to WebM with VP9 and applying FFmpeg sharpening filters.

Created: 2026-09-19 by

FFmpeg can significantly reduce pixelation in MP4 videos by converting them to the WebM container using the VP9 codec and applying sharpening filters. This process re-encodes the video with higher fidelity settings, addressing artifacts caused by aggressive compression or low source quality while maintaining visual clarity.

Understanding the Source of Pixelation

Before applying any fixes, it is crucial to understand why your video appears pixelated. Pixelation usually stems from two main causes: excessive compression during the initial encoding or a mismatch between the video resolution and the display size. When a video is compressed too heavily, the encoder discards data to save space, resulting in blocky artifacts known as macroblocks. These blocks become visible when you zoom in or view the video on a high-definition screen. Another common cause is upscaling. If you take a low-resolution video (such as 480p) and play it on a 1080p monitor, the player must stretch the image. Without proper interpolation, this stretching creates jagged edges and blurred details. While FFmpeg cannot magically create detail that does not exist in the original file, it can optimize the existing data and apply filters to make the image appear smoother and sharper. For related troubleshooting on dimension issues, see Fixing Video Width and Height with ffmpeg: A Tech Support Guide.

Converting to WebM with VP9

The most effective way to improve perceived quality is often to change the container and codec. The MP4 format typically uses H.264, which is efficient but can struggle with complex scenes if the bitrate is low. The WebM container paired with the VP9 codec offers superior compression efficiency and better handling of high-dynamic-range content. VP9 retains more detail at lower bitrates compared to older standards, making it an excellent choice for reducing visible pixelation. To begin the conversion, open your terminal or command prompt and navigate to the directory containing your video file. You will need to identify the input file path and choose an output filename. The basic command structure involves specifying the input with -i, setting the codec with -c:v, and defining the output format.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 output.webm
In this command, libvpx-vp9 selects the VP9 encoder. The -crf flag stands for Constant Rate Factor, which controls quality. Lower values mean higher quality and larger file sizes. A value of 30 is generally a good balance for standard definition, while 20-25 is recommended for high-quality preservation. The -b:v 0 tells FFmpeg to ignore the bitrate limit and rely solely on the CRF value for quality control. This ensures that the encoder uses whatever bits are necessary to maintain the desired visual fidelity.

Applying Sharpening Filters

Once the video is converted to a more efficient codec, you can further enhance the visual quality by applying filters. FFmpeg has a powerful filter graph system that allows you to manipulate video frames before they are written to disk. To combat softness and residual pixelation, the unsharp filter is highly effective. It works by adjusting the contrast between adjacent pixels, making edges appear crisper. You can integrate the filter directly into your conversion command. The syntax requires you to specify the luma and chroma sharpness levels. Luma refers to the brightness information, which carries most of the structural detail in a video. Chroma refers to color information. Typically, sharpening the luma is more important than the chroma.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 25 -vf "unsharp=lmax=3:lmin=1:cmax=1:cmin=1" output_sharp.webm
The -vf flag indicates a video filter. Inside the quotes, lmax=3 sets the maximum sharpening radius for luma, while lmin=1 sets the minimum. Adjusting these values too high can introduce halos or noise around edges, so start with conservative numbers. If the video still looks soft, you can increase the lmax value slightly. For users interested in other modifications, such as adding text overlays, check out Adding Hindi Text to MP4 Video File using FFmpeg.

Adjusting Bitrate and Resolution

Sometimes, the best solution is simply to provide more data for the video to use. If your original MP4 was encoded at a very low bitrate, no amount of filtering will fully restore lost detail. In such cases, increasing the target bitrate during re-encoding can help. However, simply raising the bitrate without changing the codec may not yield significant improvements due to inefficiencies in the H.264 encoder settings. If you decide to stay within the MP4 container, ensure you are using a high-quality preset. Use -preset slow or -preset medium instead of fast or ultrafast. Slower presets allow the encoder to analyze the video more thoroughly, resulting in better compression efficiency and fewer artifacts. Additionally, verify that your output resolution matches the native resolution of the source. Downscaling a high-resolution video and then upscaling it again can degrade quality, so aim to preserve the original dimensions unless there is a specific reason to change them.

Verifying the Output

After processing, always compare the original and the new file side-by-side. Look for areas that were previously blurry or blocky. Check if the colors remain accurate and if there are no new artifacts introduced by the sharpening filter. Play the video at different speeds and resolutions to ensure stability. If the file size becomes excessively large, you may need to adjust the CRF value upward or reduce the sharpness parameters. Finding the right balance between quality, file size, and processing time is key to mastering FFmpeg workflows.

Frequently Asked Questions

Will converting to WebM increase my file size?

Yes, WebM files are often larger than similarly compressed MP4s because VP9 prioritizes quality over extreme compression ratios. However, the visual improvement usually justifies the extra storage space, especially for archival purposes or high-quality streaming.

Can I fix pixelation without re-encoding the video?

No, you cannot remove compression artifacts without re-encoding. Filters can only enhance existing pixels; they cannot reconstruct data that was permanently discarded during the initial compression process.

What is the best CRF value for high-quality output?

A CRF value between 18 and 23 is considered visually lossless for most viewers. Values below 18 offer diminishing returns and significantly larger file sizes, while values above 23 may start to show noticeable degradation.

Does the unsharp filter work on audio tracks?

No, the unsharp filter applies only to video frames. Audio quality issues require separate audio filters such as equalization or noise reduction, which are handled using the -af flag instead of -vf.

Is FFmpeg available for Windows users?

Yes, FFmpeg is cross-platform and works on Windows, macOS, and Linux. Windows users can download pre-built binaries from the official website or use package managers like Chocolatey to install it easily.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More