From: ffmpegagent <ffmpegagent@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: softworkz <softworkz@hotmail.com>
Subject: [FFmpeg-devel] [PATCH v8 0/3] avutil/log: Add log flag to control printing of memory addresses
Date: Wed, 09 Apr 2025 09:25:13 +0000
Message-ID: <pull.59.v8.ffstaging.FFmpeg.1744190716.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.59.v7.ffstaging.FFmpeg.1744178102.ffmpegagent@gmail.com>
--and disable by default in fftools. The benefits are:
* Smaller log file sizes
* Makes log files better readable
* Allows comparing and viewing log file diffs without almost every line
being different due to those addresses
Before
======
[hevc @ 0000018e72a89cc0] nal_unit_type:
[hevc @ 0000018e72a89cc0] Decoding PPS
[hevc @ 0000018e72a89cc0] nal_unit_type: 39(SEI_P.. [hevc @
0000018e72a89cc0] Decoding SEI
[mp4 @ 0000018e72a8e240] All [mp4 @ 0000018e72a8e240] Afte [hevc @
0000018e742f6b40] Decoded frame with POC .. detected 16 logical cores
[Parsed_scale_0 @ 0000018e74382f40] Setting 'w' t.. [Parsed_scale_0 @
0000018e74382f40] Setting 'h' t.. [Parsed_scale_1 @ 0000018e74382440]
Setting 'w' t.. [mjpeg @ 0000018e743210c0] Forcing thread count t.. [mjpeg @
0000018e743210c0] intra_quant_bias = 96
After
=====
[hevc] nal_unit_type: [hevc] Decoding PPS
[hevc] nal_unit_type: 39(SEI_P.. [hevc] Decoding SEI
[mp4] All info found
[mp4] After avformat_find_ [hevc] Decoded frame with POC 2.
[Parsed_scale_0] Setting 'w' t.. [Parsed_scale_0] Setting 'h' t..
[Parsed_scale_1] Setting 'w' t.. [mjpeg] Forcing thread count t.. [mjpeg]
intra_quant_bias = 96
Versions
========
V2
==
* Added log flag for optionally restoring the previous behavior (as
requested by Gyan)
V3
==
* Externalize the prefix formatting with a prefix_format callback
V4
==
* Implement a custom logging callback function for fftools instead of the
prefix formatting callback (as suggested by Hendrik Leppkes)
V5
==
* Remove unused var
* Add missing include to fix build error on PPC (thanks, Michael)
V6
==
* No more changes to avutil involved
* Let fftools have its own management of log level and flags (as figured to
be most likely what Nicolas George was alluding to)
V7
==
* Minimal version without "simple id" substitution
* Defaults for printing mem addresses:
* fftools: off
* avutil: on
V8
==
* Negated flag logic
* Use singular naming
* Fix flag doc text (thanks, Andreas!)
softworkz (3):
avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES
fftools: add memaddress log flag and disable printing addresses by
default
doc/fftools-common-opts: document memaddress log flag
doc/APIchanges | 3 +++
doc/fftools-common-opts.texi | 2 ++
fftools/ffmpeg.c | 2 +-
fftools/ffplay.c | 2 +-
fftools/ffprobe.c | 2 +-
fftools/opt_common.c | 6 ++++++
libavutil/log.c | 6 ++++--
libavutil/log.h | 5 +++++
libavutil/version.h | 2 +-
9 files changed, 24 insertions(+), 6 deletions(-)
base-commit: 02eda84bf2fcf0db7793872204b0f564a6557232
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-59%2Fsoftworkz%2Fsubmit_logaddresses-v8
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v8
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/59
Range-diff vs v7:
1: 6c2d6f1e97 ! 1: 0ce5bd11d7 avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES
@@ Commit message
avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES
which is controls prefix formatting. With this flag set, the prefix is
- printed including the memory address, otherwise it is omitted.
- In libavutil, the flag is set by default, retaining the previous
- behavior. fftools remove the flag as default.
+ printed without the memory address, otherwise it is included.
Signed-off-by: softworkz <softworkz@hotmail.com>
@@ doc/APIchanges
The last version increases of all libraries were on 2025-03-28
+2025-03-xx - xxxxxxxxxx - lavu 60.2.100 - log.h
-+ Add flag AV_LOG_PRINT_MEMADDRESSES
++ Add flag AV_LOG_NO_PRINT_MEMADDRESS
+
API changes, most recent first:
2025-04-07 - 19e9a203b7 - lavu 60.01.100 - dict.h
## libavutil/log.c ##
-@@ libavutil/log.c: static AVMutex mutex = AV_MUTEX_INITIALIZER;
- #endif
-
- static int av_log_level = AV_LOG_INFO;
--static int flags;
-+static int flags = AV_LOG_PRINT_MEMADDRESSES;
-
- #define NB_LEVELS 8
- #if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
@@ libavutil/log.c: static void format_line(void *avcl, int level, const char *fmt, va_list vl,
if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
if (*print_prefix && avc) {
-+ const char *p_fmt = flags & AV_LOG_PRINT_MEMADDRESSES ? "[%s @ %p] " : "[%s] ";
++ const char *p_fmt = flags & AV_LOG_NO_PRINT_MEMADDRESS ? "[%s] " : "[%s @ %p] ";
+
if (avc->parent_log_context_offset) {
AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
@@ libavutil/log.h: int av_log_format_line2(void *ptr, int level, const char *fmt,
#define AV_LOG_PRINT_DATETIME 8
+/**
-+ * Print memory addresses instead of logical ids in the AVClass prefix.
++ * Do not print memory addresses of context instances.
+ */
-+#define AV_LOG_PRINT_MEMADDRESSES 16
++#define AV_LOG_NO_PRINT_MEMADDRESS 16
+
void av_log_set_flags(int arg);
int av_log_get_flags(void);
2: 7c4cfd5f67 ! 2: 527cf5fa56 fftools/opt_common: add memaddresses log flag
@@ Metadata
Author: softworkz <softworkz@hotmail.com>
## Commit message ##
- fftools/opt_common: add memaddresses log flag
+ fftools: add memaddress log flag and disable printing addresses by default
- This commit adds the memaddresses log flag.
+ This commit adds the memaddress log flag.
When specifying this flag at the command line, context prefixes will
be printed with memory addresses like in earlier ffmpeg versions.
@@ Commit message
Signed-off-by: softworkz <softworkz@hotmail.com>
+ ## fftools/ffmpeg.c ##
+@@ fftools/ffmpeg.c: int main(int argc, char **argv)
+
+ setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
+
+- av_log_set_flags(AV_LOG_SKIP_REPEATED);
++ av_log_set_flags(AV_LOG_SKIP_REPEATED | AV_LOG_NO_PRINT_MEMADDRESS);
+ parse_loglevel(argc, argv, options);
+
+ #if CONFIG_AVDEVICE
+
+ ## fftools/ffplay.c ##
+@@ fftools/ffplay.c: int main(int argc, char **argv)
+
+ init_dynload();
+
+- av_log_set_flags(AV_LOG_SKIP_REPEATED);
++ av_log_set_flags(AV_LOG_SKIP_REPEATED | AV_LOG_NO_PRINT_MEMADDRESS);
+ parse_loglevel(argc, argv, options);
+
+ /* register all codecs, demux and protocols */
+
+ ## fftools/ffprobe.c ##
+@@ fftools/ffprobe.c: int main(int argc, char **argv)
+
+ init_dynload();
+
+- av_log_set_flags(AV_LOG_SKIP_REPEATED);
++ av_log_set_flags(AV_LOG_SKIP_REPEATED | AV_LOG_NO_PRINT_MEMADDRESS);
+
+ options = real_options;
+ parse_loglevel(argc, argv, options);
+
## fftools/opt_common.c ##
-@@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, const char *arg)
- int level = av_log_get_level();
- int cmd, i = 0;
-
-+ // libavutil has this enabled by default, fftools sets this off by default
-+ flags &= ~AV_LOG_PRINT_MEMADDRESSES;
-+
- av_assert0(arg);
- while (*arg) {
- token = arg;
@@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, const char *arg)
} else {
flags |= AV_LOG_PRINT_DATETIME;
}
-+ } else if (av_strstart(token, "memaddresses", &arg)) {
++ } else if (av_strstart(token, "memaddress", &arg)) {
+ if (cmd == '-') {
-+ flags &= ~AV_LOG_PRINT_MEMADDRESSES;
++ flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+ } else {
-+ flags |= AV_LOG_PRINT_MEMADDRESSES;
++ flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+ }
} else {
break;
}
-@@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, const char *arg)
- arg++;
- } else if (!i) {
- flags = av_log_get_flags(); /* level value without prefix, reset flags */
-+ flags &= ~AV_LOG_PRINT_MEMADDRESSES;
- }
-
- for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
3: 6d3f305d0f ! 3: 22c51897c1 doc/fftools-common-opts: document memaddresses log flag
@@ Metadata
Author: softworkz <softworkz@hotmail.com>
## Commit message ##
- doc/fftools-common-opts: document memaddresses log flag
+ doc/fftools-common-opts: document memaddress log flag
Signed-off-by: softworkz <softworkz@hotmail.com>
@@ doc/fftools-common-opts.texi: log to file.
Indicates that log lines should be prefixed with time information.
@item datetime
Indicates that log lines should be prefixed with date and time information.
-+@item memaddresses
-+Indicates that context prefixes should be printed with memory addresses rather than logical ids.
++@item memaddress
++Indicates that context prefixes should be printed with memory address.
@end table
Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
flag without affecting other @var{flags} or changing @var{loglevel}. When
--
ffmpeg-codebot
_______________________________________________
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:[~2025-04-09 9:25 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 15:38 [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log output with simple ids softworkz
2025-03-05 15:40 ` Nicolas George
2025-03-05 15:45 ` Soft Works
2025-03-05 15:48 ` Soft Works
2025-03-06 10:08 ` Nicolas George
2025-03-06 17:02 ` Soft Works
2025-03-06 17:38 ` Marvin Scholz
2025-03-06 17:44 ` Soft Works
2025-03-06 17:49 ` Marvin Scholz
2025-03-06 18:16 ` Soft Works
2025-03-06 18:58 ` Marvin Scholz
2025-03-06 19:27 ` Soft Works
2025-03-06 20:01 ` Marvin Scholz
2025-03-06 20:48 ` Soft Works
2025-03-06 20:56 ` Soft Works
2025-03-05 15:42 ` Soft Works
2025-03-05 16:23 ` Gyan Doshi
2025-03-05 16:30 ` Soft Works
2025-03-05 17:14 ` Gyan Doshi
2025-03-05 18:19 ` [FFmpeg-devel] [PATCH v2 0/3] " ffmpegagent
2025-03-05 18:19 ` [FFmpeg-devel] [PATCH v2 1/3] " softworkz
2025-03-05 18:19 ` [FFmpeg-devel] [PATCH v2 2/3] fftools/opt_common: add memaddresses log flag softworkz
2025-03-05 18:19 ` [FFmpeg-devel] [PATCH v2 3/3] doc/fftools-common-opts: document " softworkz
2025-03-06 10:04 ` [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses in log output with simple ids Nicolas George
2025-03-06 16:38 ` Soft Works
2025-03-06 16:43 ` Nicolas George
2025-03-06 17:05 ` Soft Works
2025-03-06 17:38 ` Soft Works
2025-03-06 20:59 ` [FFmpeg-devel] [PATCH v3 0/4] " ffmpegagent
2025-03-06 20:59 ` [FFmpeg-devel] [PATCH v3 1/4] avutil/log: Add callback for context prefix formatting softworkz
2025-03-07 9:44 ` Nicolas George
2025-03-07 17:23 ` Soft Works
2025-03-07 17:30 ` Hendrik Leppkes
2025-03-07 18:02 ` Soft Works
2025-03-06 20:59 ` [FFmpeg-devel] [PATCH v3 2/4] fftools/opt_common: add memaddresses log flag softworkz
2025-03-06 20:59 ` [FFmpeg-devel] [PATCH v3 3/4] fftools: Provide a log formatting callback for context prefixes softworkz
2025-03-06 20:59 ` [FFmpeg-devel] [PATCH v3 4/4] doc/fftools-common-opts: document memaddresses log flag softworkz
2025-03-08 23:02 ` [FFmpeg-devel] [PATCH v4 0/4] avutil/log: Replace addresses in log output with simple ids ffmpegagent
2025-03-08 23:02 ` [FFmpeg-devel] [PATCH v4 1/4] avutil/log: Add AV_LOG_PRINT_MEMADDRESSES logging flag softworkz
2025-03-08 23:02 ` [FFmpeg-devel] [PATCH v4 2/4] fftools/opt_common: add memaddresses log flag softworkz
2025-03-08 23:02 ` [FFmpeg-devel] [PATCH v4 3/4] fftools: Provide a an fftools-specific logging callback function softworkz
2025-03-09 17:52 ` Michael Niedermayer
2025-03-09 18:59 ` Soft Works
2025-03-08 23:02 ` [FFmpeg-devel] [PATCH v4 4/4] doc/fftools-common-opts: document memaddresses log flag softworkz
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 0/5] avutil/log: Replace addresses in log output with simple ids ffmpegagent
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 1/5] avutil/log: Add AV_LOG_PRINT_MEMADDRESSES logging flag softworkz
2025-03-09 19:05 ` Nicolas George
2025-03-09 19:11 ` Soft Works
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 2/5] fftools/opt_common: add memaddresses log flag softworkz
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 3/5] fftools: Provide a an fftools-specific logging callback function softworkz
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 4/5] doc/fftools-common-opts: document memaddresses log flag softworkz
2025-03-09 19:01 ` [FFmpeg-devel] [PATCH v5 5/5] Remove commented lines softworkz
2025-03-13 9:30 ` [FFmpeg-devel] [PATCH v6 0/3] avutil/log: Replace addresses in log output with simple ids ffmpegagent
2025-03-13 9:30 ` [FFmpeg-devel] [PATCH v6 1/3] fftools: Add a local logging callback function softworkz
2025-03-13 9:30 ` [FFmpeg-devel] [PATCH v6 2/3] fftools/opt_common: add memaddresses log flag softworkz
2025-03-13 9:30 ` [FFmpeg-devel] [PATCH v6 3/3] doc/fftools-common-opts: document " softworkz
2025-04-09 5:54 ` [FFmpeg-devel] [PATCH v7 0/3] avutil/log: Add log flag to control printing of memory addresses ffmpegagent
2025-04-09 5:55 ` [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES softworkz
2025-04-09 7:27 ` Andreas Rheinhardt
2025-04-09 7:50 ` softworkz .
2025-04-09 8:02 ` softworkz .
2025-04-09 8:11 ` Andreas Rheinhardt
2025-04-09 8:24 ` softworkz .
2025-04-09 8:27 ` Andreas Rheinhardt
2025-04-09 9:56 ` softworkz .
2025-04-09 8:15 ` Andreas Rheinhardt
2025-04-09 5:55 ` [FFmpeg-devel] [PATCH v7 2/3] fftools/opt_common: add memaddresses log flag softworkz
2025-04-09 5:55 ` [FFmpeg-devel] [PATCH v7 3/3] doc/fftools-common-opts: document " softworkz
2025-04-09 9:25 ` ffmpegagent [this message]
2025-04-09 9:25 ` [FFmpeg-devel] [PATCH v8 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES softworkz
2025-04-09 9:25 ` [FFmpeg-devel] [PATCH v8 2/3] fftools: add memaddress log flag and disable printing addresses by default softworkz
2025-04-09 14:28 ` Gyan Doshi
2025-04-09 14:41 ` softworkz .
2025-04-09 9:25 ` [FFmpeg-devel] [PATCH v8 3/3] doc/fftools-common-opts: document memaddress log flag softworkz
2025-04-09 18:19 ` [FFmpeg-devel] [PATCH v9 0/3] avutil/log: Add log flag to control printing of memory addresses ffmpegagent
2025-04-09 18:19 ` [FFmpeg-devel] [PATCH v9 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES softworkz
2025-04-09 18:19 ` [FFmpeg-devel] [PATCH v9 2/3] fftools: add mem log flag and disable printing addresses by default softworkz
2025-04-09 18:26 ` Gyan Doshi
2025-04-09 18:40 ` softworkz .
2025-04-09 18:19 ` [FFmpeg-devel] [PATCH v9 3/3] doc/fftools-common-opts: document mem log flag softworkz
2025-04-10 0:38 ` [FFmpeg-devel] [PATCH v10 0/3] avutil/log: Add log flag to control printing of memory addresses ffmpegagent
2025-04-10 0:38 ` [FFmpeg-devel] [PATCH v10 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES softworkz
2025-04-10 7:38 ` Andreas Rheinhardt
2025-04-10 18:06 ` softworkz .
2025-04-10 0:38 ` [FFmpeg-devel] [PATCH v10 2/3] fftools: add mem log flag and disable printing addresses by default softworkz
2025-04-10 6:51 ` Nicolas George
2025-04-10 18:02 ` softworkz .
2025-04-16 13:43 ` Michael Niedermayer
2025-04-16 13:50 ` Nicolas George
2025-04-16 14:25 ` Gyan Doshi
2025-04-16 14:26 ` softworkz .
2025-04-10 0:38 ` [FFmpeg-devel] [PATCH v10 3/3] doc/fftools-common-opts: document mem log flag softworkz
2025-06-06 20:29 ` [FFmpeg-devel] [PATCH v11 0/3] avutil/log: Add log flag to control printing of memory addresses ffmpegagent
2025-06-06 20:29 ` [FFmpeg-devel] [PATCH v11 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESS and hide addresses by default softworkz
2025-06-06 20:29 ` [FFmpeg-devel] [PATCH v11 2/3] fftools: add mem log flag for printing memory addresses softworkz
2025-06-06 20:29 ` [FFmpeg-devel] [PATCH v11 3/3] doc/fftools-common-opts: document mem log flag softworkz
2025-06-06 23:23 ` [FFmpeg-devel] [PATCH v11 0/3] avutil/log: Add log flag to control printing of memory addresses Kieran Kunhya via ffmpeg-devel
2025-06-06 23:26 ` softworkz .
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=pull.59.v8.ffstaging.FFmpeg.1744190716.ffmpegagent@gmail.com \
--to=ffmpegagent@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=softworkz@hotmail.com \
/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