mpv-scripts icon indicating copy to clipboard operation
mpv-scripts copied to clipboard

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

Open llyyr opened this issue 2 years ago • 3 comments

Depends on: https://github.com/mpv-player/mpv/pull/12246

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

llyyr avatar Aug 26 '23 23:08 llyyr

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

occivink avatar Aug 28 '23 10:08 occivink

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 avatar Sep 04 '23 15:09 dexeonify

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.

kasper93 avatar Oct 02 '23 16:10 kasper93