* [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF
@ 2022-11-25 18:00 Anton Khirnov
2022-11-25 18:00 ` [FFmpeg-devel] [PATCH 2/2] lavf: deprecate AVFMT_FLAG_AUTO_BSF Anton Khirnov
2022-11-26 14:22 ` [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Gyan Doshi
0 siblings, 2 replies; 3+ messages in thread
From: Anton Khirnov @ 2022-11-25 18:00 UTC (permalink / raw)
To: ffmpeg-devel
There should no longer be reason for the callers to disable this.
In-muxer bitstream filtering should be considered a part of the muxer
internals and invisible to the caller.
---
libavformat/internal.h | 5 +++++
libavformat/movenc.c | 5 +++--
libavformat/mux.c | 3 ++-
libavformat/options_table.h | 2 +-
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/libavformat/internal.h b/libavformat/internal.h
index ce837fefc76..e96bf4cc56d 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -186,6 +186,11 @@ typedef struct FFFormatContext {
* Contexts and child contexts do not contain a metadata option
*/
int metafree;
+
+ /**
+ * Disable muxer-level bitstream filtering.
+ */
+ int disable_bsf;
} FFFormatContext;
static av_always_inline FFFormatContext *ffformatcontext(AVFormatContext *s)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 064b5419721..a4dd8619dcc 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6829,6 +6829,7 @@ static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track,
static int mov_init(AVFormatContext *s)
{
+ FFFormatContext *const si = ffformatcontext(s);
MOVMuxContext *mov = s->priv_data;
int i, ret;
@@ -6875,9 +6876,9 @@ static int mov_init(AVFormatContext *s)
mov->flags |= FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_EMPTY_MOOV |
FF_MOV_FLAG_DEFAULT_BASE_MOOF | FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS;
- if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && s->flags & AVFMT_FLAG_AUTO_BSF) {
+ if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
av_log(s, AV_LOG_VERBOSE, "Empty MOOV enabled; disabling automatic bitstream filtering\n");
- s->flags &= ~AVFMT_FLAG_AUTO_BSF;
+ si->disable_bsf = 1;
}
if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX && mov->flags & FF_MOV_FLAG_SKIP_SIDX) {
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 37fe19358de..fff500dd554 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1072,9 +1072,10 @@ const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
{
+ FFFormatContext *const si = ffformatcontext(s);
int ret;
- if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
+ if (si->disable_bsf)
return 1;
if (s->oformat->check_bitstream) {
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 86d836cfebb..83e6c6fb3cb 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -39,7 +39,7 @@ static const AVOption avformat_options[] = {
{"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
{"formatprobesize", "number of bytes to probe file format", OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, INT_MAX-1, D},
{"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E},
-{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, "fflags"},
+{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, D|E, "fflags"},
{"flush_packets", "reduce the latency by flushing out packets immediately", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, "fflags"},
{"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"},
{"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"},
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] lavf: deprecate AVFMT_FLAG_AUTO_BSF
2022-11-25 18:00 [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Anton Khirnov
@ 2022-11-25 18:00 ` Anton Khirnov
2022-11-26 14:22 ` [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Gyan Doshi
1 sibling, 0 replies; 3+ messages in thread
From: Anton Khirnov @ 2022-11-25 18:00 UTC (permalink / raw)
To: ffmpeg-devel
---
doc/APIchanges | 3 +++
libavformat/avformat.h | 5 ++++-
libavformat/options_table.h | 4 +++-
libavformat/version_major.h | 1 +
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index ab7ce15faea..5611e012cc3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil: 2021-04-27
API changes, most recent first:
+2022-12-xx - xxxxxxxxxx - lavf 59 - avformat.h
+ Deprecate AVFMT_FLAG_AUTO_BSF without replacement.
+
2022-11-xx - xxxxxxxxxx - lavu 57.43.100 - tx.h
Add AV_TX_FLOAT_DCT, AV_TX_DOUBLE_DCT and AV_TX_INT32_DCT.
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1d97d56ac58..73628cdf2b7 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1357,7 +1357,10 @@ typedef struct AVFormatContext {
#endif
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
-#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
+
+#if FF_API_AUTO_BSF
+#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< deprecated, does nothing
+#endif
/**
* Maximum number of bytes read from input in order to determine stream
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 83e6c6fb3cb..2b6d1b79955 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -52,7 +52,9 @@ static const AVOption avformat_options[] = {
{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
{"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
{"shortest", "stop muxing with the shortest stream", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_SHORTEST }, 0, 0, E, "fflags" },
-{"autobsf", "add needed bsfs automatically", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF }, 0, 0, E, "fflags" },
+#if FF_API_AUTO_BSF
+{"autobsf", "deprecated, does nothing", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF }, 0, 0, E, "fflags" },
+#endif
{"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, D},
{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D},
{"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 86af3ee4a5a..02cbc2bbaa7 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -48,6 +48,7 @@
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)
+#define FF_API_AUTO_BSF (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_R_FRAME_RATE 1
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF
2022-11-25 18:00 [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Anton Khirnov
2022-11-25 18:00 ` [FFmpeg-devel] [PATCH 2/2] lavf: deprecate AVFMT_FLAG_AUTO_BSF Anton Khirnov
@ 2022-11-26 14:22 ` Gyan Doshi
1 sibling, 0 replies; 3+ messages in thread
From: Gyan Doshi @ 2022-11-26 14:22 UTC (permalink / raw)
To: ffmpeg-devel
On 2022-11-25 11:30 pm, Anton Khirnov wrote:
> There should no longer be reason for the callers to disable this.
> In-muxer bitstream filtering should be considered a part of the muxer
> internals and invisible to the caller.
> ---
> libavformat/internal.h | 5 +++++
> libavformat/movenc.c | 5 +++--
> libavformat/mux.c | 3 ++-
> libavformat/options_table.h | 2 +-
> 4 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index ce837fefc76..e96bf4cc56d 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -186,6 +186,11 @@ typedef struct FFFormatContext {
> * Contexts and child contexts do not contain a metadata option
> */
> int metafree;
> +
> + /**
> + * Disable muxer-level bitstream filtering.
> + */
> + int disable_bsf;
> } FFFormatContext;
>
> static av_always_inline FFFormatContext *ffformatcontext(AVFormatContext *s)
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 064b5419721..a4dd8619dcc 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -6829,6 +6829,7 @@ static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track,
>
> static int mov_init(AVFormatContext *s)
> {
> + FFFormatContext *const si = ffformatcontext(s);
> MOVMuxContext *mov = s->priv_data;
> int i, ret;
>
> @@ -6875,9 +6876,9 @@ static int mov_init(AVFormatContext *s)
> mov->flags |= FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_EMPTY_MOOV |
> FF_MOV_FLAG_DEFAULT_BASE_MOOF | FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS;
>
> - if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && s->flags & AVFMT_FLAG_AUTO_BSF) {
> + if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
> av_log(s, AV_LOG_VERBOSE, "Empty MOOV enabled; disabling automatic bitstream filtering\n");
> - s->flags &= ~AVFMT_FLAG_AUTO_BSF;
> + si->disable_bsf = 1;
> }
>
> if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX && mov->flags & FF_MOV_FLAG_SKIP_SIDX) {
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index 37fe19358de..fff500dd554 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -1072,9 +1072,10 @@ const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
>
> static int check_bitstream(AVFormatContext *s, FFStream *sti, AVPacket *pkt)
> {
> + FFFormatContext *const si = ffformatcontext(s);
> int ret;
>
> - if (!(s->flags & AVFMT_FLAG_AUTO_BSF))
> + if (si->disable_bsf)
> return 1;
>
> if (s->oformat->check_bitstream) {
> diff --git a/libavformat/options_table.h b/libavformat/options_table.h
> index 86d836cfebb..83e6c6fb3cb 100644
> --- a/libavformat/options_table.h
> +++ b/libavformat/options_table.h
> @@ -39,7 +39,7 @@ static const AVOption avformat_options[] = {
> {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D},
> {"formatprobesize", "number of bytes to probe file format", OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, INT_MAX-1, D},
> {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E},
> -{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, "fflags"},
> +{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, D|E, "fflags"},
> {"flush_packets", "reduce the latency by flushing out packets immediately", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, "fflags"},
> {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"},
> {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"},
The flag is set in hlsenc and segment.c. Does the original rationale no
longer apply?
Regards,
Gyan
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-26 14:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 18:00 [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Anton Khirnov
2022-11-25 18:00 ` [FFmpeg-devel] [PATCH 2/2] lavf: deprecate AVFMT_FLAG_AUTO_BSF Anton Khirnov
2022-11-26 14:22 ` [FFmpeg-devel] [PATCH 1/2] lavf: stop honoring AVFMT_FLAG_AUTO_BSF Gyan Doshi
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