Opened 9 years ago
Closed 7 years ago
#5392 closed defect (fixed)
A bug in the scale2ref filter
Reported by: | Mulvya | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avfilter |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
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 "[1][0]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.
Change History (2)
comment:1 by , 8 years ago
Component: | undetermined → avfilter |
---|---|
Status: | new → open |
Version: | unspecified → git-master |
comment:2 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed in 3385989b98be7940044e4f0a6b431a0a00abf2fa.