mpv-player / mpv-player/mpv

Interactive Pre-Filter Zoom (VLC-style) with Script Control

Open
#17,799 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Expected behavior of the wanted feature

Summary

Request for a true source-region zoom mechanism in mpv that operates before the video filter chain, enabling interactive zoom/pan that behaves like VLC’s “interactive zoom” while remaining fully compatible with mpv’s advanced rendering pipeline (HDR, shaders, VPP, etc.).


Problem

Current mpv zoom mechanisms:

  • video-zoom
  • video-pan-x/y
  • video-crop

all operate at the VO/display stage, not on the source frame before filtering.

This leads to:

  • zoom being applied after scaling, filtering, and shader processing
  • effectively magnifying an already processed frame
  • visible quality degradation compared to crop + resample approaches

Desired Behavior

Introduce a zoom system that behaves as:

decode
→ select source region (interactive crop)
→ apply video filters (e.g. d3d11vpp, scaling)
→ apply shaders (libplacebo)
→ display

Instead of current behavior:

decode
→ filters
→ shaders
→ display
→ then zoom/pan (display transform)

Key Requirements

1. Pre-filter crop/zoom stage
  • Ability to define a dynamic crop region of the source frame
  • This crop should occur before vf filters, including:
    • d3d11vpp
    • scaling filters
    • tone mapping / HDR processing
2. Interactive control (scriptable)

Expose the crop/zoom region via properties accessible from Lua.

Example (conceptual):

video-source-crop-x
video-source-crop-y
video-source-crop-w
video-source-crop-h

or normalized:

video-source-center-x
video-source-center-y
video-source-zoom

These should be:

  • writable at runtime
  • fast enough for continuous updates (mouse drag)
3. GPU-friendly implementation
  • Should integrate cleanly with hardware paths:

    • d3d11vpp
    • vaapi
    • nvdec / CUDA
    • vo=gpu-next / libplacebo
  • Must avoid:

    • full filter graph rebuilds per frame
    • expensive CPU-side reconfiguration
4. Maintain full pipeline compatibility

Must work correctly with:

  • HDR tone mapping
  • custom shaders (glsl-shaders)
  • scaling algorithms
  • existing vf chains

Motivation / Use Case

Modern mpv setups often include:

  • hardware scaling (e.g. Intel VPP)
  • multi-pass shader pipelines
  • HDR processing
  • advanced playback (streams, URLs, capture)

In these setups, current zoom:

  • breaks visual fidelity
  • feels inferior to VLC’s interactive zoom
  • cannot leverage the existing high-quality pipeline

VLC’s zoom works because it:

  • crops source region
  • resamples it through its pipeline
  • keeps interaction smooth and visually consistent

mpv currently lacks an equivalent mechanism.


Why existing solutions are insufficient

video-zoom
  • display-space scaling only
  • does not re-run filters on the selected region
video-crop
  • VO-side crop, not pre-filter
  • not suitable for interactive updates
dynamic vf=crop
  • requires filter chain updates
  • too heavy for real-time interaction
shaders
  • operate post-filter
  • cannot move processing earlier in the pipeline

Proposed Direction (non-binding)

Any of the following would satisfy the requirement:

  • a dedicated pre-filter crop stage
  • a hardware-accelerated crop region selection
  • a libplacebo-integrated source-region sampling control

As long as:

  • it happens before filters
  • it is scriptable
  • it supports real-time interaction

Additional Notes

This feature would enable:

  • true VLC-style zoom in mpv
  • higher-quality inspection workflows
  • better usability for high-resolution content
  • improved integration with advanced pipelines already present in mpv

Conclusion

mpv already provides one of the most powerful playback pipelines available.

This feature would fill a key gap by enabling interactive source-region zoom that fully leverages that pipeline instead of bypassing it.

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or concrete entry points are named. Start by tracing the existing video-zoom, video-pan-x/y, video-crop, and vf paths, then determine where a runtime source-region stage could fit; done means Lua-controllable interactive cropping before filters while preserving the listed hardware, HDR, shader, and scaling paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
desktop, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.