Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crop] use video-crop instead of inserting lavf crop #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

llyyr
Copy link

@llyyr llyyr commented Aug 26, 2023

Depends on: mpv-player/mpv#12246

This will allow cropping while using hardware decoding. I'll clean this up a bit when the mpv PR is merged

@llyyr llyyr marked this pull request as draft August 26, 2023 23:25
@occivink
Copy link
Owner

That's a cool change, should also be much faster than applying a lavf filter. I think I will only merge the PR after the next mpv release though, since this is a breaking change. Ideally encode.lua should also be adapted in order to consider these video crop parameters

@llyyr llyyr marked this pull request as ready for review September 2, 2023 03:50
@dexeonify
Copy link

Beware that this breaks one of crop.lua's unique feature – recursive cropping.
After the first crop, any subsequent cropping appears to function on the original uncropped video, rather than the cropped video after the first crop is applied. Perhaps with some mathematical calculation, video-crop can support recursive cropping.
Also, since it's not a lavf filter, you can't remove the recursive crop individually through vf del -1.

dexeonify added a commit to dexeonify/mpv-config that referenced this pull request Sep 26, 2023
Merges occivink/mpv-scripts#70
This change will break some major features, notably recursive cropping
and thumbfast's preview. But for now, I think these are acceptable
trade-offs.
@kasper93
Copy link

kasper93 commented Oct 2, 2023

Perhaps with some mathematical calculation, video-crop can support recursive cropping.
Also, since it's not a lavf filter, you can't remove the recursive crop individually through vf del -1.

It is possible to support in script, but instead stacking vf one needs to maintain history stack of requested crops.

Sneakpeakcss added a commit to Sneakpeakcss/mpv-scripts that referenced this pull request Jan 22, 2024
Based on occivink#70

- Support recursive `video-crop` and `zoom-pan`
- zoom-pan (soft) can now be toggled
- Added remove-crop:
 - `remove-crop [{type}]`     - Removes all filters starting with delogo. If `{type}` is specified it removes only filters of that type (hard, delogo, soft).
 - `remove-crop all [{type}]` - Removes all filters starting with specified type. If no type is specified it removes all filters.
 - `remove-crop all order`    - Removes filters starting with the most recently added.
Sneakpeakcss added a commit to Sneakpeakcss/mpv-scripts that referenced this pull request Jan 24, 2024
Based on occivink#70

- Support recursive `video-crop` and `zoom-pan`
- zoom-pan (soft) can now be toggled
- Added remove-crop:
 - `remove-crop [{type}]`     - Removes all filters starting with delogo. If `{type}` is specified it removes only filters of that type (hard, delogo, soft).
 - `remove-crop all [{type}]` - Removes all filters starting with specified type. If no type is specified it removes all filters.
 - `remove-crop all order`    - Removes filters starting with the most recently added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants