occivink / mpv-scripts

Various scripts for mpv
The Unlicense
417 stars 38 forks source link

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

Open llyyr opened 1 year ago

llyyr commented 1 year ago

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

occivink commented 1 year ago

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

dexeonify commented 11 months ago

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.

kasper93 commented 11 months ago

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.