Skip to main content

Simple video restoration for Python

Project description

revid

Tests Python versions License

Simple video restoration for Python. Load a video, chain restoration filters, export. That's it.

Built for restoring VHS tapes, old camcorder footage, digitized film, and any degraded video. Uses FFmpeg for fast classic filters, with optional AI-powered models for superior quality.

Installation

pip install revid

With optional extras:

pip install revid[ai]   # AI-powered restoration (Real-ESRGAN, GFPGAN, Demucs, etc.)
pip install revid[all]  # everything

Requires FFmpeg installed and available in your system PATH.

Usage

import revid as vr

video = vr.read("family_tape_1994.mp4")

# Chain restoration steps and export
video.deinterlace() \
     .denoise(strength=0.5) \
     .color_correct(saturation=1.2, brightness=0.05) \
     .sharpen() \
     .upscale(factor=2) \
     .to_mp4("restored.mp4")

# Inspect intermediate steps
deinterlaced = video.deinterlace()
deinterlaced.to_mp4("step1_deinterlaced.mp4")

denoised = deinterlaced.denoise()
denoised.to_mp4("step2_denoised.mp4")

# Preview a frame without rendering the full video
video.deinterlace().denoise().preview(at=5.0, output="preview.png")

# Use presets
video.preset("vhs_standard").to_mp4("restored.mp4")
video.preset("vhs_ai").to_mp4("restored_ai.mp4")

# GPU-accelerated encoding (NVIDIA NVENC)
video.preset("vhs_standard").to_mp4("restored.mp4", gpu=True)

# AI-powered upscaling
video.upscale(factor=4, engine="realesrgan").to_mp4("upscaled.mp4")

# AI face restoration
video.upscale(factor=2, engine="realesrgan") \
     .face_restore(engine="gfpgan") \
     .to_mp4("faces_restored.mp4")

# AI audio enhancement
video.audio_denoise(engine="demucs").to_mp4("clean_audio.mp4")
video.audio_separate(engine="demucs", stem="vocals").to_mp4("vocals_only.mp4")

# Video metadata
info = video.info()
print(info)

Each transformation returns a new object. The original is never modified.

Presets

FFmpeg (fast, no dependencies)

Preset Description
vhs_standard Fast VHS restoration (deinterlace, denoise, color correct, sharpen, upscale 2x)
vhs_quality Higher quality VHS restoration (bwdif, nlmeans, deflicker, normalize, upscale 2x)
dvd_cleanup Clean up DVD rips (deblock, deband, light denoise)
camcorder Restore old camcorder footage (Hi8, MiniDV)
film_8mm Restore digitized 8mm / Super 8 film

AI-powered (require revid[ai])

Preset Description
vhs_ai VHS restoration + Real-ESRGAN 4x + GFPGAN face restore
vhs_ai_full Maximum quality: NAFNet denoise + Real-ESRGAN 4x + GFPGAN + RIFE 60fps
camcorder_ai Camcorder restoration + Real-ESRGAN 4x + GFPGAN
film_8mm_ai 8mm restoration + scratch removal + NAFNet + Real-ESRGAN 4x
bw_restore Black & white restoration + colorization + face restore

Engine Pattern

Every filter method defaults to FFmpeg. Use the engine parameter to switch to an AI model:

# FFmpeg (default, fast)
video.upscale(factor=2)
video.upscale(factor=2, engine="ffmpeg", algorithm="lanczos")

# AI (slower, higher quality)
video.upscale(factor=4, engine="realesrgan")

# Same pattern for all methods
video.denoise(strength=0.5)                      # FFmpeg hqdn3d
video.denoise(strength=0.5, algorithm="nlmeans")  # FFmpeg nlmeans
video.denoise(engine="nafnet")                    # AI

video.stabilize()                                 # FFmpeg vidstab
video.stabilize(engine="raft")                    # AI optical flow

video.face_restore(engine="gfpgan")               # AI only
video.colorize(engine="deoldify")                  # AI only

Features

Video Filters (FFmpeg)

Feature Description
Deinterlace Remove combing artifacts (yadif, bwdif, estdif)
Denoise Spatial and temporal denoising (hqdn3d, nlmeans)
Sharpen Unsharp mask and contrast adaptive sharpening (unsharp, cas)
Upscale Resolution upscaling (lanczos, bicubic, spline)
Color correct Brightness, contrast, saturation, gamma (eq)
Color curves Fine-grained tonal adjustments (curves)
White balance Fix color temperature drift (colortemperature)
Color levels Per-channel adjustment (colorlevels)
Color normalize Auto-stretch color range (normalize)
Chroma fix Fix incorrect color space metadata (colorspace)
Deflicker Remove brightness fluctuations (deflicker)
Stabilize 2-pass video stabilization (vidstab)
Crop / Auto crop Remove borders and head switching artifacts
Pad Add borders for aspect ratio correction
Rotate / Flip Fix orientation
Deblock Remove compression artifacts (deblock)
Deband Remove color banding (deband)
Decimate Remove duplicate frames
FPS convert Change framerate
Speed adjust Speed correction for PAL/NTSC mismatch
Trim Cut segments
Field order fix Fix TFF/BFF field order
Inverse telecine Restore 24fps from 3:2 pulldown
Concat Join multiple tapes or segments
Grayscale / Sepia Visual effects
Fade in / out Video and audio fades
Reverse Reverse video and audio
Overlay Watermark or logo overlay
Subtitles Burn subtitles into video
Draw text Burn text onto video
Preview Extract single frame at any point
Histogram / Scopes Visual analysis (histogram, waveform, vectorscope)

Audio Filters (FFmpeg)

Feature Description
Audio denoise FFT-based noise removal (afftdn)
Hum removal Remove 50/60Hz electrical hum + harmonics
Hiss removal Band-pass filtering for tape hiss
Audio normalize Volume normalization, EBU R128 (loudnorm)
Audio equalizer Bass and treble adjustment
Stereo fix Fix mono/stereo channel issues
Audio tempo Fix audio speed drift
Wow & flutter fix Pitch wobble correction (experimental)
Audio fade in / out Audio fades

AI Engines (optional)

Category Engines Description
Upscale Real-ESRGAN, SwinIR, ESPCN, EDSR, BasicVSR++ Image and video super resolution
Denoise NAFNet, SCUNet, Restormer Learned denoising for real-world noise
Deblur NAFNet, MPRNet, HINet Motion and focus blur removal
Face restore GFPGAN, CodeFormer, RestoreFormer Facial detail recovery
Interpolate RIFE, IFRNet, AMT, FILM Frame interpolation (30fps to 60fps)
Colorize DeOldify, DDColor, BigColor Add color to B&W footage
Stabilize RAFT, FlowFormer Deep optical flow stabilization
Inpaint LaMa, MAT Fill damaged regions
Object remove ProPainter, E2FGVI Remove watermarks and overlays
Scratch remove RTN, Old Photo Restore Tape damage and scratch removal
Audio denoise Demucs, Silero, RNNoise AI speech enhancement
Audio separate Demucs, Open-Unmix Source separation (vocals, music, noise)
Audio upscale AudioSR, AERO Audio bandwidth upscaling
Scene detect PySceneDetect, TransNetV2 Automatic scene boundary detection

Utility

Feature Description
vr.read() Read any video format
vr.read_mp4(), vr.read_avi(), ... Format-specific readers
.info() Video metadata (codec, resolution, fps, audio)
.preview() Extract single frame
.extract_audio() Extract audio track
.mute() Remove audio
.concat() Join multiple videos
.to_mp4(), .to_avi(), ... Export to format
.render() Render with custom options

Supported Formats

Type Formats
Video mp4, avi, mov, mkv, webm, flv, ogv, wmv, 3gp, ts, mpeg, mpg

License

BSD 3-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revid-0.1.1.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revid-0.1.1-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file revid-0.1.1.tar.gz.

File metadata

  • Download URL: revid-0.1.1.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for revid-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c571e3b37bc26372ed11f343a9d0a026701e45562c12c39f0f17326485445cf1
MD5 93d65c53e016aa4d1aeae115a175368e
BLAKE2b-256 966c4cb9e904ba274f4343cec3854c6e62f0b2cde89c1f20723a05ddd0d1ad6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for revid-0.1.1.tar.gz:

Publisher: publish.yml on jmfeck/revid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file revid-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: revid-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for revid-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fca14627a1fd68e0ab42798b23fd6aa3502f63d2b96b17bf390ca2a7cacab3eb
MD5 e56907fb0078ed6af2c2a5b4d98bb449
BLAKE2b-256 6dddb361339d1b98ee1ef7332deb92abf981addd1044c600ec5d345b89f1ba2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for revid-0.1.1-py3-none-any.whl:

Publisher: publish.yml on jmfeck/revid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page