From patchwork Wed Apr 24 10:52:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 48251 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:2d06:b0:1a9:af23:56c1 with SMTP id tw6csp571457pzb; Wed, 24 Apr 2024 04:04:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW7MTExgiV3d+n8pG4QGuI0P8cO845ZQPmqfhoQjKLZ9+iLzMMLDd3pOwz1E/AgjgJA+e1AtjymhHQOOs9cTYGDgvrpbmOU9zdkkg== X-Google-Smtp-Source: AGHT+IG5Qij/kyc6XSbCRnhhSgiuJVp5mal6TEmFEZDd5O75Vb0QvI61YJ76ycvg6umdIK72BZFt X-Received: by 2002:a50:9542:0:b0:570:5b6b:9d58 with SMTP id v2-20020a509542000000b005705b6b9d58mr1454037eda.0.1713956655518; Wed, 24 Apr 2024 04:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713956655; cv=none; d=google.com; s=arc-20160816; b=JWoG5uY7fcqOErqxN0pdXwPuqv/h5s8GjFr/xWo5RlZ1OVBd1dppEc8keY8U8ZO3pi 4LGgbLnJlH6n/ZsDtx5rWjp+1B9vFX2fd60Yt9dRrR1HEly2BSOPs6/d6wui5thmBiFx HAdFfvoG5ZLXdHy2w5S+6z7nsyXbZVZWviDHo8oW+s12dvxsjR2Ihjx96bdzRo0pimwp 2WpcYSsEcMvVuJRZfHg/eghk4g9c/sPjOAvUMef5vmOnv4VsXfEqvxlaxvObM+LTxBIX rv/UtLdQRT99KOAune0wBNjyB557r5j7t7qcg14ca201AcjIuLunIjt2Cin5eV6mqEhC aLPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=iLAKlM7vIEl+2T+hMKyglJZywZZ0jY8nSjLz9yQaEj8=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=KEk5kl9HAnJPbQeJ2XxmonBP28LrZFbjgO8R5mM86dkFd9h0C+9W5jBkIRmMf1Ib08 a3MU1cgWvaWTJ/bPyzylFySTIHFWTq/ETmChhChOWlkkyWLPlNh/5u+K3ZqNNyjPjlcY Q0Sl5ZGSN2HpJYruAxEcjFWbYXiW/uhuMdXMs/hYRS/56hxAb022VAuybnZaZLr5y/6w B/zDySXxP/eel6i9KqSuoycL2ybO14AKSZxksgBrfvdfeIpgDv8zoDw+ZMXa1t8SHGhH r3YxWWttfwInB4yCID/85FXtemJ5Ql4cctmFujEaZMt2R7dNixVfZPk09s0QgxW0jSgT Iy6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=sbWfM4TO; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f1-20020aa7d841000000b00570241f6321si8387090eds.611.2024.04.24.04.04.15; Wed, 24 Apr 2024 04:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=sbWfM4TO; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D289A68D40C; Wed, 24 Apr 2024 14:03:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6EFBB68D3C1 for ; Wed, 24 Apr 2024 14:03:10 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1713956586; bh=QOXEJtu7fdWNk8MxkE6hf7NydiXKEAEviuyBpk6MCTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbWfM4TO9nVH5T9TyLb/OWw/Cy5j2YAymmud7J2NAgIMQM5EU9xLFmZfz5iZxxlzl X+cFfddysLp8/11Gyctzdx9wwA+RFqbw4F3lpIfNO52VF7lhVZg9BUGLOjy9qTL69V AOjJNcR5XsrqwBWthoyFm7oWcLgwFv7QFpWqJH+I= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 18294429D1; Wed, 24 Apr 2024 13:03:06 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Apr 2024 12:52:00 +0200 Message-ID: <20240424110257.38715-6-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424110257.38715-1-ffmpeg@haasn.xyz> References: <20240424110257.38715-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avfilter/scale2ref: deprecate in favor of scale=rw:rh X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Qdy2zQWdrmfa From: Niklas Haas And remove it from the documentation. --- Changelog | 1 + doc/filters.texi | 73 ------------------------------------------ libavfilter/vf_scale.c | 3 ++ 3 files changed, 4 insertions(+), 73 deletions(-) diff --git a/Changelog b/Changelog index e821e5ac74..e827208439 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,7 @@ version : - LC3/LC3plus demuxer and muxer - pad_vaapi, drawbox_vaapi filters - vf_scale supports secondary ref input and framesync options +- vf_scale2ref deprecated version 7.0: diff --git a/doc/filters.texi b/doc/filters.texi index cf884568b0..5198f14f28 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -21590,79 +21590,6 @@ Scale a logo to 1/10th the height of a video, while preserving its display aspec @end example @end itemize -@section scale2ref - -Scale (resize) the input video, based on a reference video. - -See the scale filter for available options, scale2ref supports the same but -uses the reference video instead of the main input as basis. scale2ref also -supports the following additional constants for the @option{w} and -@option{h} options: - -@table @var -@item main_w -@item main_h -The main input video's width and height - -@item main_a -The same as @var{main_w} / @var{main_h} - -@item main_sar -The main input video's sample aspect ratio - -@item main_dar, mdar -The main input video's display aspect ratio. Calculated from -@code{(main_w / main_h) * main_sar}. - -@item main_hsub -@item main_vsub -The main input video's horizontal and vertical chroma subsample values. -For example for the pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} -is 1. - -@item main_n -The (sequential) number of the main input frame, starting from 0. -Only available with @code{eval=frame}. - -@item main_t -The presentation timestamp of the main input frame, expressed as a number of -seconds. Only available with @code{eval=frame}. - -@item main_pos -The position (byte offset) of the frame in the main input stream, or NaN if -this information is unavailable and/or meaningless (for example in case of synthetic video). -Only available with @code{eval=frame}. -@end table - -@subsection Examples - -@itemize -@item -Scale a subtitle stream (b) to match the main video (a) in size before overlaying -@example -'scale2ref[b][a];[a][b]overlay' -@end example - -@item -Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. -@example -[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out] -@end example -@end itemize - -@subsection Commands - -This filter supports the following commands: -@table @option -@item width, w -@item height, h -Set the output video dimension expression. -The command accepts the same syntax of the corresponding option. - -If the specified expression is not valid, it is kept at its current -value. -@end table - @section scale2ref_npp Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index f174651333..bc53571c1c 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -368,6 +368,9 @@ static av_cold int init(AVFilterContext *ctx) int64_t threads; int ret; + if (ctx->filter == &ff_vf_scale2ref) + av_log(ctx, AV_LOG_WARNING, "scale2ref is deprecated, use scale=rw:rh instead\n"); + if (scale->size_str && (scale->w_expr || scale->h_expr)) { av_log(ctx, AV_LOG_ERROR, "Size and width/height expressions cannot be set at the same time.\n");