Fix pixelated video with FFmpeg: the commands I actually use

FFmpeg is free, scriptable and does everything this site does, if you are comfortable in a terminal. This is the same filter chain the online tool is built on, with the reasoning behind each piece so you can tune it.

  • Free preview, no signup
  • Files auto-deleted after 24 hours
  • Corrupted files are repaired automatically

The basic recipe

Deblock first, then denoise, then scale, then sharpen. Here is a good starting command for a blocky 480p or 720p clip:

ffmpeg -i input.mp4 -vf "deblock=filter=strong:block=8,hqdn3d=4:3:6:4.5,scale=1920:-2:flags=lanczos,cas=0.5" -c:v libx264 -crf 17 -preset slow -c:a copy output.mp4

deblock smooths block edges. hqdn3d is a fast 3D denoiser: the four numbers control spatial and temporal luma and chroma strength. scale with Lanczos enlarges the picture to 1920 wide and keeps the aspect ratio with -2. cas is contrast adaptive sharpening. CRF 17 is near visually lossless; raise it to 20 for smaller files.

Choosing strength

For mild noise, hqdn3d=2:1.5:3:3 is enough. For severely damaged video, increase to 5:4:8:6, but expect a softer picture. Lower sharpen values, such as cas=0.3, for already sharp footage.

If you enlarge by more than 2x, add a second light denoise pass after scaling, or use an AI upscaler for texture. nlmeans is a stronger but much slower denoiser worth trying on short clips.

Repairing a damaged file

First try a remux that ignores errors: ffmpeg -err_detect ignore_err -i broken.mp4 -c copy fixed.mp4. If that fails, re-encode with the same flag and drop the audio if it breaks: ffmpeg -err_detect ignore_err -i broken.mp4 -c:v libx264 -crf 18 -an fixed.mp4. A MP4 file with no moov atom cannot be repaired this way, because the index is missing.

Use the command, step by step

  1. Install FFmpegUse your package manager or download a build from ffmpeg.org.
  2. Probe the sourceRun ffprobe -hide_banner input.mp4 to see resolution, bitrate and codecs.
  3. Run the recipe on a short clipAdd -t 10 to test only the first 10 seconds and tune values.
  4. Encode the full fileRemove -t, keep CRF 17 to 20 and preset slow.
  5. ComparePlay the output next to the input at 100 percent zoom.

Try it on your own video

Free watermarked preview, no signup. Files are deleted after 24 hours.

Upload a video

Frequently asked questions

What is the best FFmpeg filter for pixelated video?

Deblock plus hqdn3d for cleaning, lanczos scaling for enlarging and cas or unsharp for final sharpening.

Is the online tool the same as FFmpeg?

It is built on FFmpeg with automatic tuning, queueing, repair and preview. If you like commands, you can run it yourself.

Why is my FFmpeg output bigger than the input?

You raised the resolution and used a low CRF. Raise CRF to 20 to 23 for smaller files.

Does FFmpeg support AI upscaling?

Not natively. You can use external models such as Real-ESRGAN, and then reassemble the frames and audio with FFmpeg.

Related guides

More tips on the blog → · All guides · Fix a pixelated video now