Interactive Pre-Filter Zoom (VLC-style) with Script Control
Nobody has claimed this yet.
- 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-zoomvideo-pan-x/yvideo-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
vffilters, 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:
d3d11vppvaapinvdec/ CUDAvo=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
vfchains
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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