• Niklas Haas's avatar
    avfilter/vf_libplacebo: add flexible crop exprs · b80e43bf
    Niklas Haas authored
    Motivated by a desire to use vf_libplacebo as a GPU-accelerated
    cropping/padding/zooming filter. This commit adds support for setting
    the `input/target.crop` fields as dynamic expressions.
    
    Re-use the same generic variables available to other scale and crop type
    filters, and also add some more that we can afford as a result of being
    able to set these properties dynamically.
    
    It's worth pointing out that `out_t/ot` is currently redundant with
    `in_t/t` since it will always contain the same PTS values, but I plan on
    changing this in the near future.
    
    I decided to also expose `crop_w/crop_h` and `pos_w/pos_h` as variables
    in the expression parser itself, since this enables the fairly common
    use case of determining dimensions first and then placing the image
    appropriately, such as is done in the default behavior (which centers
    the cropped/placed region by default).
    b80e43bf
vf_libplacebo.c 47.9 KB