From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id CF1FE459E0 for ; Tue, 2 May 2023 13:44:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D478168C148; Tue, 2 May 2023 16:44:04 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B81F68C11E for ; Tue, 2 May 2023 16:43:58 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 3F5C02404F8; Tue, 2 May 2023 15:43:58 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id sICgQk3q-0vm; Tue, 2 May 2023 15:43:57 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 79A552404F5; Tue, 2 May 2023 15:43:57 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1F4293A11DB; Tue, 2 May 2023 15:43:57 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 May 2023 15:43:16 +0200 Message-Id: <20230502134316.10496-4-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230502134316.10496-1-anton@khirnov.net> References: <20230502134316.10496-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg: deprecate -re 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: ddurham@davyandbeth.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: It is exactly equivalent to -readrate 1.0 --- Changelog | 1 + doc/ffmpeg.texi | 2 +- fftools/ffmpeg.h | 3 +++ fftools/ffmpeg_demux.c | 5 +++++ fftools/ffmpeg_opt.c | 4 +++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 2061aaf462..5feb4fd24e 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,7 @@ version : - afireqsrc audio source filter - arls filter - ffmpeg CLI new option: -readrate_initial_burst +- ffmpeg CLI option -re deprecated in favor of -readrate 1.0 version 6.0: - Radiance HDR image support diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index a12700e2f3..01fd2ae0fe 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1707,7 +1707,7 @@ it may cause packet loss. It is useful for when flow speed of output packets is important, such as live streaming. @item -re (@emph{input}) -Read input at native frame rate. This is equivalent to setting @code{-readrate 1}. +This option is deprecated and equivalent to setting @code{-readrate 1}. @item -readrate_initial_burst @var{seconds} Set an initial read burst time, in seconds, after which @option{-re/-readrate} will be enforced. diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index b30f0758ec..ec4c580b91 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -56,6 +56,7 @@ #define FFMPEG_ROTATION_METADATA 1 #define FFMPEG_OPT_QPHIST 1 #define FFMPEG_OPT_ADRIFT_THRESHOLD 1 +#define FFMPEG_OPT_RE 1 enum VideoSyncMethod { VSYNC_AUTO = -1, @@ -124,7 +125,9 @@ typedef struct OptionsContext { /* input options */ int64_t input_ts_offset; int loop; +#if FFMPEG_OPT_RE int rate_emu; +#endif float readrate; double readrate_initial_burst; int accurate_seek; diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 9eea5a4eec..6727193697 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1232,12 +1232,17 @@ int ifile_open(const OptionsContext *o, const char *filename) av_log(d, AV_LOG_ERROR, "Option -readrate is %0.3f; it must be non-negative.\n", f->readrate); exit_program(1); } +#if FFMPEG_OPT_RE if (o->rate_emu) { + av_log(d, AV_LOG_WARNING, "Option -re is deprecated and will be removed. " + "Use -readrate 1.0 instead\n"); + if (f->readrate) { av_log(d, AV_LOG_WARNING, "Both -readrate and -re set. Using -readrate %0.3f.\n", f->readrate); } else f->readrate = 1.0f; } +#endif if (f->readrate) { d->readrate_initial_burst = o->readrate_initial_burst ? o->readrate_initial_burst : 0.5; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 7f22b22604..9670b65a96 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1448,9 +1448,11 @@ const OptionDef options[] = { "dump each input packet" }, { "hex", OPT_BOOL | OPT_EXPERT, { &do_hex_dump }, "when dumping packets, also dump the payload" }, +#if FFMPEG_OPT_RE { "re", OPT_BOOL | OPT_EXPERT | OPT_OFFSET | OPT_INPUT, { .off = OFFSET(rate_emu) }, - "read input at native frame rate; equivalent to -readrate 1", "" }, + "deprecated, equivalent to -readrate 1.0", "" }, +#endif { "readrate", HAS_ARG | OPT_FLOAT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT, { .off = OFFSET(readrate) }, "read input at specified rate", "speed" }, -- 2.39.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".