From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Cc: ddurham@davyandbeth.com
Subject: [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg: deprecate -re
Date: Tue, 2 May 2023 15:43:16 +0200
Message-ID: <20230502134316.10496-4-anton@khirnov.net> (raw)
In-Reply-To: <20230502134316.10496-1-anton@khirnov.net>
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 <next>:
- 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".
next prev parent reply other threads:[~2023-05-02 13:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 13:43 [FFmpeg-devel] [PATCH 1/4] fftools/ffmpeg: add ability to set a input burst time before readrate is enforced Anton Khirnov
2023-05-02 13:43 ` [FFmpeg-devel] [PATCH 2/4] fftools/ffmpeg: use a non-zero default for -readrate_initial_burst Anton Khirnov
2023-05-02 13:43 ` [FFmpeg-devel] [PATCH 3/4] fftools/ffmpeg: reduce -re to -readrate 1 Anton Khirnov
2023-05-02 13:43 ` Anton Khirnov [this message]
2023-05-02 15:36 ` [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg: deprecate -re Timo Rothenpieler
2023-05-02 15:40 ` Devin Heitmueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230502134316.10496-4-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ddurham@davyandbeth.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git