player/command: add video-params/crop-[w,h,x,y]

This commit is contained in:
Kacper Michajłow 2023-08-25 19:29:33 +02:00 committed by Dudemanguy
parent 817845645f
commit c9c9822289
3 changed files with 11 additions and 0 deletions

View File

@ -55,6 +55,7 @@ Interface changes
- change `--directory-mode` default to `lazy`
- remove deprecated `video-aspect` property
- add `--video-crop`
- add `video-params/crop-[w,h,x,y]`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -2410,6 +2410,12 @@ Property list
``video-params/dw``, ``video-params/dh``
Video size as integers, scaled for correct aspect ratio.
``video-params/crop-x``, ``video-params/crop-y``
Crop offset of the source video frame.
``video-params/crop-w``, ``video-params/crop-h``
Video size after cropping.
``video-params/aspect``
Display aspect ratio as float.

View File

@ -2291,6 +2291,10 @@ static int property_imgparams(struct mp_image_params p, int action, void *arg)
{"h", SUB_PROP_INT(p.h)},
{"dw", SUB_PROP_INT(d_w)},
{"dh", SUB_PROP_INT(d_h)},
{"crop-x", SUB_PROP_INT(p.crop.x0)},
{"crop-y", SUB_PROP_INT(p.crop.y0)},
{"crop-w", SUB_PROP_INT(mp_rect_w(p.crop))},
{"crop-h", SUB_PROP_INT(mp_rect_h(p.crop))},
{"aspect", SUB_PROP_FLOAT(d_w / (double)d_h)},
{"aspect-name", SUB_PROP_STR(aspect_name), .unavailable = !aspect_name},
{"par", SUB_PROP_FLOAT(p.p_w / (double)p.p_h)},