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.mp4deblock 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
- Install FFmpegUse your package manager or download a build from ffmpeg.org.
- Probe the sourceRun ffprobe -hide_banner input.mp4 to see resolution, bitrate and codecs.
- Run the recipe on a short clipAdd -t 10 to test only the first 10 seconds and tune values.
- Encode the full fileRemove -t, keep CRF 17 to 20 and preset slow.
- 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 videoFrequently 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
Upscale video to 1080p
Upscale video to 1080p properly: choose a resampling filter, clean artifacts first, keep the aspect ratio and sharpen lightly. Online and FFmpeg methods.
Fix grainy video
Grainy video comes from high ISO, low light and compression. Learn how to denoise video properly, what settings to avoid, and how to keep detail.
Repair corrupted pixelated video
Corrupted videos show green frames, gray smears and drifting blocks. What causes it, when repair works, and how to recover what you can.
Enhance video quality online
Enhance video quality online: what enhancement means, which steps matter (deblock, denoise, upscale, sharpen) and how to get a good result from weak clips.
More tips on the blog → · All guides · Fix a pixelated video now