2021年3月12日星期五

FFmpeg: Using st(var, expr) to calculate dynamic sizing

I'm looking for some advice on how to dynamically size an image using the scale filter. I'd like to scale the height of my input from 1080 to ~400 and back. The command below achieves a nice scale up after 15 seconds, but I can't figure out how to store the starting height outside of the if block. Ideally I'd like to pass in a variable for height and dynamically increment/decrement using ld(0)+[some value].

  • The original size of this inout is 1920x1080.
  • OS: MacOS Big Sur
  • ffmpeg version: ffmpeg version 4.3.2
[0:v] scale=-1:'if(between(t,0, 15), st(0, ih/2.71), if(between(ld(0), 2.71, 1080-1), st(0, ld(0)+50), 1080))':eval=frame [left];  
https://stackoverflow.com/questions/66609139/ffmpeg-using-stvar-expr-to-calculate-dynamic-sizing March 13, 2021 at 09:03AM

没有评论:

发表评论