[FFmpeg-devel] [PATCH 1/2] fftools/cmdutils: make the default swscale flags identical for simple and complex filter graph

Linjie Fu fulinjie at zju.edu.cn
Sun Aug 1 16:22:01 EEST 2021


From: Linjie Fu <linjie.justin.fu at gmail.com>

Currently the default swscale flags for simple filter graph is bicubic,
however for complex filter graph it uses bilinear as decleared in scale
filter.

$ffmpeg -v verbose -i input.mp4 -vf format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f86d2c160c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x4

$ffmpeg -v verbose -i input.mp4 -filter_complex format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f8779e046c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x2

Set the default swscale flags for simple filter graph to bilinear to match
the description in scale filter.

Signed-off-by: Linjie Fu <linjie.justin.fu at gmail.com>
---
 fftools/cmdutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 0b1ef03a25..56b8ada5b1 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -83,7 +83,7 @@ enum show_muxdemuxers {
 
 void init_opts(void)
 {
-    av_dict_set(&sws_dict, "flags", "bicubic", 0);
+    av_dict_set(&sws_dict, "flags", "bilinear", 0);
 }
 
 void uninit_opts(void)
-- 
2.31.1



More information about the ffmpeg-devel mailing list