A bug in the scale2ref filter
|Reported by:||Mulvya||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
The scale2ref filter allows one to resize an input with reference to a secondary input. However, this can lead to an undesired outcome when the frame aspect ratios of the two inputs are not the same.
Consider the case where a square-pixel 2:1 watermark logo needs to be resized with reference to a square-pixel 4:3 base video. With the scale2ref filter, an expression of scale2ref=-1:ih/2 will lead to the resized watermark having a ratio of 4:3. Not what most users would desire or expect.
A demo command to show the behaviour:
ffmpeg -f lavfi -i "color=black:600x600" -f lavfi -i "color=white:1200x600" -filter_complex "scale2ref=-1:ih/2[1v][0v];[0v][1v]overlay[v]" -map "[v]" -t 1 scale2ref-ar-bug.mp4
There should be a way to flag ffmpeg to preserve the operand's aspect ratio with the scale2ref filter.