Skip to content

avutil/log: Add log flag to control printing of memory addresses #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

softworkz
Copy link
Collaborator

@softworkz softworkz commented Mar 5, 2025

--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!)

V9

  • Rename 'memaddress' to 'mem' for CLI
    (as suggested by Gyan)

V10

  • Print 'mem' flag in help outrput
    (thanks, Gyan)

V11

  • Reversed logic again and renamed flag back to AV_LOG_PRINT_MEMADDRESS
  • Default behavior: Memory addresses are not printed

.

@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v1

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v1:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v1

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

softworkz (HE12025-03-05):
> +static int nb_class_ids;

We want less mutable global state, not more.

Regards,

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

User Nicolas George <[email protected]> has been added to the cc: list.

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: softworkz <[email protected]>
> Sent: Mittwoch, 5. März 2025 16:38
> To: [email protected]
> Cc: softworkz <[email protected]>; softworkz <[email protected]>
> Subject: [PATCH] avutil/log: Replace addresses in log output with simple
> ids
> 
> From: softworkz <[email protected]>
> 
> ..and individual numbering. The benefits are:
> 
> - Smaller log file sizes
> - The disambiguation is much easier to recognize and to follow
> - It eventually allows comparing and viewing log file diffs
>   without almost every line being different due to those addresses


The comparison lines have gotten a somewhat mangled. This should 
look better on the ML:


### Before

[hevc @ 0000018e72a89cc0] nal_unit_type: 34(PPS), nuh_layer_id: 0, tempora..
[hevc @ 0000018e72a89cc0] Decoding PPS
[hevc @ 0000018e72a89cc0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0,
[hevc @ 0000018e72a89cc0] Decoding SEI
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018e72a8e240] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018e72a8e240] After avformat_find_stream_in..
[hevc @ 0000018e742f6b40] Decoded frame with POC 2.
detected 16 logical cores
[Parsed_scale_0 @ 0000018e74382f40] Setting 'w' to value '320'
[Parsed_scale_0 @ 0000018e74382f40] Setting 'h' to value '180'
[Parsed_scale_1 @ 0000018e74382440] Setting 'w' to value '320'
[mjpeg @ 0000018e743210c0] Forcing thread count to 1 for MJPEG encoding, u..
[mjpeg @ 0000018e743210c0] intra_quant_bias = 96 inter_quant_bias = 0


### After

[hevc #0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc #0] Decoding PPS
[hevc #0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc #0] Decoding SEI
[mov,mp4,m4a,3gp,3g2,mj2 #0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 #0] After avformat_find_stream_info() pos: 310096..
[hevc #1] Decoded frame with POC 2.
[Parsed_scale_0 #0] Setting 'w' to value '320'
[Parsed_scale_0 #0] Setting 'h' to value '180'
[Parsed_scale_2 #2] w:320 h:180 fmt:yuv420p10le sar:0/1 -> w:320 h:180 fmt..
[mjpeg #2] Forcing thread count to 1 for MJPEG encoding, use -thread_type
[mjpeg #2] intra_quant_bias = 96 inter_quant_bias = 0
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

User Soft Works <[email protected]> has been added to the cc: list.

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Nicolas George
> Sent: Mittwoch, 5. März 2025 16:40
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> softworkz (HE12025-03-05):
> > +static int nb_class_ids;
> 
> We want less mutable global state, not more.


And I want peace on earth and better logs 😊

sw
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Nicolas George
> Sent: Mittwoch, 5. M�rz 2025 16:40
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> softworkz (HE12025-03-05):
> > +static int nb_class_ids;
> 
> We want less mutable global state, not more.
> 
> Regards,

Sorry. So - seriously: what would be your recipe then?

Thank you,
sw
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Gyan Doshi wrote (reply to this):



On 2025-03-05 09:08 pm, softworkz wrote:
> From: softworkz <[email protected]>
>
> ..and individual numbering. The benefits are:
>
> - Smaller log file sizes
> - The disambiguation is much easier to recognize and to follow
> - It eventually allows comparing and viewing log file diffs
>    without almost every line being different due to those addresses

I like being able to get rid of the addresses, but it should be 
user-selectable via a flag.

Regards,
Gyan


>
> Signed-off-by: softworkz <[email protected]>
> ---
>      avutil/log: Replace addresses in log output with simple ids
>      
>      ..and individual numbering. The benefits are:
>      
>       * Smaller log file sizes
>       * The disambiguation is much easier to recognize and to follow
>       * It eventually allows comparing and viewing log file diffs without
>         almost every line being different due to those addresses
>      
>      
>      Before
>      ======
>      
>      [hevc @ 0000018e72a89cc0] nal_unit_type: 34(PPS), nuh_layer_id: 0,
>      tempora.. [hevc @ 0000018e72a89cc0] Decoding PPS [hevc @
>      0000018e72a89cc0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, [hevc
>      @ 0000018e72a89cc0] Decoding SEI [mov,mp4,m4a,3gp,3g2,mj2 @
>      0000018e72a8e240] All info found [mov,mp4,m4a,3gp,3g2,mj2 @
>      0000018e72a8e240] After avformat_find_stream_in.. [hevc @
>      0000018e742f6b40] Decoded frame with POC 2. detected 16 logical cores
>      [Parsed_scale_0 @ 0000018e74382f40] Setting 'w' to value '320'
>      [Parsed_scale_0 @ 0000018e74382f40] Setting 'h' to value '180'
>      [Parsed_scale_1 @ 0000018e74382440] Setting 'w' to value '320' [mjpeg @
>      0000018e743210c0] Forcing thread count to 1 for MJPEG encoding, u..
>      [mjpeg @ 0000018e743210c0] intra_quant_bias = 96 inter_quant_bias = 0
>      
>      
>      After
>      =====
>      
>      [hevc #0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0 [hevc
>      #0] Decoding PPS [hevc #0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id:
>      0, temporal_id: 0 [hevc #0] Decoding SEI [mov,mp4,m4a,3gp,3g2,mj2 #0]
>      All info found [mov,mp4,m4a,3gp,3g2,mj2 #0] After
>      avformat_find_stream_info() pos: 310096.. [hevc #1] Decoded frame with
>      POC 2. [Parsed_scale_0 #0] Setting 'w' to value '320' [Parsed_scale_0
>      #0] Setting 'h' to value '180' [Parsed_scale_2 #2] w:320 h:180
>      fmt:yuv420p10le sar:0/1 -> w:320 h:180 fmt.. [mjpeg #2] Forcing thread
>      count to 1 for MJPEG encoding, use -thread_type [mjpeg #2]
>      intra_quant_bias = 96 inter_quant_bias = 0
>
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-59%2Fsoftworkz%2Fsubmit_logaddresses-v1
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v1
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/59
>
>   libavutil/log.c | 57 +++++++++++++++++++++++++++++++++++++++++++++----
>   1 file changed, 53 insertions(+), 4 deletions(-)
>
> diff --git a/libavutil/log.c b/libavutil/log.c
> index c5ee876a88..50c8c41ef8 100644
> --- a/libavutil/log.c
> +++ b/libavutil/log.c
> @@ -57,6 +57,55 @@ static AVMutex mutex = AV_MUTEX_INITIALIZER;
>   
>   static int av_log_level = AV_LOG_INFO;
>   static int flags;
> +static int nb_class_ids;
> +
> +#define NB_CLASS_IDS 1000
> +static struct class_ids {
> +    void *avcl;
> +    uint64_t class_hash;
> +    unsigned id;
> +} class_ids[NB_CLASS_IDS];
> +
> +static uint64_t fnv_hash(const char *str)
> +{
> +    // FNV-1a 64-bit hash algorithm
> +    uint64_t hash = 0xcbf29ce484222325ULL;
> +    while (*str) {
> +        hash ^= (unsigned char)*str++;
> +        hash *= 0x100000001b3ULL;
> +    }
> +    return hash;
> +}
> +
> +static unsigned get_class_id(void* avcl)
> +{
> +    AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
> +    const char* class_name = avc->item_name(avcl);
> +    unsigned i, nb_ids = 0;
> +    uint64_t class_hash;
> +
> +    for (i = 0; i < NB_CLASS_IDS && class_ids[i].avcl; i++) {
> +        if (class_ids[i].avcl == avcl)
> +            return class_ids[i].id;
> +    }
> +
> +    class_hash = fnv_hash(avc->class_name);
> +
> +    for (i = 0; i < NB_CLASS_IDS; i++) {
> +        if (class_ids[i].class_hash == class_hash)
> +            nb_ids++;
> +
> +        if (!class_ids[i].avcl) {
> +            class_ids[i].avcl = avcl;
> +            class_ids[i].class_hash = class_hash;
> +            class_ids[i].id = nb_ids;
> +            return class_ids[i].id;
> +        }
> +    }
> +
> +    // exceeded NB_CLASS_IDS entries in class_ids[]
> +    return 0;
> +}
>   
>   #define NB_LEVELS 8
>   #if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
> @@ -331,13 +380,13 @@ static void format_line(void *avcl, int level, const char *fmt, va_list vl,
>               AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
>                                      avc->parent_log_context_offset);
>               if (parent && *parent) {
> -                av_bprintf(part+0, "[%s @ %p] ",
> -                           item_name(parent, *parent), parent);
> +                av_bprintf(part+0, "[%s #%u] ",
> +                           item_name(parent, *parent), get_class_id(parent));
>                   if(type) type[0] = get_category(parent);
>               }
>           }
> -        av_bprintf(part+1, "[%s @ %p] ",
> -                   item_name(avcl, avc), avcl);
> +        av_bprintf(part+1, "[%s #%u] ",
> +                   item_name(avcl, avc), get_class_id(avcl));
>           if(type) type[1] = get_category(avcl);
>       }
>   
>
> base-commit: 5c5be37daff4f4ecbe0c20d6a9f0fdad6eadc9c8

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

User Gyan Doshi <[email protected]> has been added to the cc: list.

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Gyan
> Doshi
> Sent: Mittwoch, 5. M�rz 2025 17:23
> To: [email protected]
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> 
> 
> On 2025-03-05 09:08 pm, softworkz wrote:
> > From: softworkz <[email protected]>
> >
> > ..and individual numbering. The benefits are:
> >
> > - Smaller log file sizes
> > - The disambiguation is much easier to recognize and to follow
> > - It eventually allows comparing and viewing log file diffs
> >    without almost every line being different due to those addresses
> 
> I like being able to get rid of the addresses, but it should be
> user-selectable via a flag.
> 
> Regards,
> Gyan

Yea sure. A runtime option (log flag) or preprocessor variable? I'm not sure whether the actual numbers have any value unless you're debugging?
But either way is fine from my pov..

Thanks,
sw





_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

On the FFmpeg mailing list, Gyan Doshi wrote (reply to this):



On 2025-03-05 10:00 pm, Soft Works wrote:
>
>> -----Original Message-----
>> From: ffmpeg-devel <[email protected]> On Behalf Of Gyan
>> Doshi
>> Sent: Mittwoch, 5. März 2025 17:23
>> To: [email protected]
>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
>> output with simple ids
>>
>>
>>
>> On 2025-03-05 09:08 pm, softworkz wrote:
>>> From: softworkz <[email protected]>
>>>
>>> ..and individual numbering. The benefits are:
>>>
>>> - Smaller log file sizes
>>> - The disambiguation is much easier to recognize and to follow
>>> - It eventually allows comparing and viewing log file diffs
>>>     without almost every line being different due to those addresses
>> I like being able to get rid of the addresses, but it should be
>> user-selectable via a flag.
>>
>> Regards,
>> Gyan
> Yea sure. A runtime option (log flag) or preprocessor variable? I'm not sure whether the actual numbers have any value unless you're debugging?
> But either way is fine from my pov..

Runtime, please

Regards,
Gyan



>
> Thanks,
> sw
>
>
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@softworkz softworkz force-pushed the submit_logaddresses branch from e686825 to 411c77b Compare March 5, 2025 17:49
@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Mar 5, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v2

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v2:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v2

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

ffmpegagent (HE12025-03-05):
> Cc: softworkz <[email protected]>, Soft Works
>  <[email protected]>, Nicolas George <[email protected]>,
>  Gyan Doshi <[email protected]>

Please do not Cc people who did not ask for it. Especially when headers
say not to.

> Date: Wed, 05 Mar 2025 18:19:40 +0000
> From: ffmpegagent <[email protected]>
> To: [email protected]
> Subject: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses in log
>  output with simple ids

Sending a new version so soon when comments are still pending is a waste
of everybody's time.

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

Soft Works (HE12025-03-05):
> Sorry. So - seriously: what would be your recipe then?

I see not just a little of non-trivial code for a very minor feature,
that might be a hint that it would be best to let it go.

Also, if somebody is debugging a program using the libraries, the
pointers are relevant for that program. For that reason, I think the
change is a bad idea in the library.

On the other hand, you could do that change in the fftools. The point
about pointers being relevant does not apply for them, and they can have
as much global state as they want.

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Nicolas George
> Sent: Donnerstag, 6. M�rz 2025 11:04
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses
> in log output with simple ids
> 
> ffmpegagent (HE12025-03-05):
> > Cc: softworkz <[email protected]>, Soft Works
> >  <[email protected]>, Nicolas George
> <[email protected]>,
> >  Gyan Doshi <[email protected]>
> 
> Please do not Cc people who did not ask for it. Especially when headers
> say not to.

It is the GitGitGadget system which does this this automatically.
Each time when somebody replies, GGG adds the person to the CC list.
But I have removed you now and try to remove you again each time when you reply. 

> 
> > Date: Wed, 05 Mar 2025 18:19:40 +0000
> > From: ffmpegagent <[email protected]>
> > To: [email protected]
> > Subject: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses
> in log
> >  output with simple ids
> 
> Sending a new version so soon when comments are still pending is a waste
> of everybody's time.

Gyan had asked to provide the ability for controlling this via a log flag. This was a substantial change to the patchset (1 => 3 commits, 1 => 6 changed files).

Isn't it rather wasting people's time when letting them review the first patchset even when knowing that V2 is substantially different?

Thanks
sw






_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

Soft Works (HE12025-03-06):
> It is the GitGitGadget system which does this this automatically.

Your choice to use that thing, your responsibility to not let it
misbehave.

> But I have removed you now and try to remove you again each time when you reply. 

Do not Cc other people either if they did not ask for it.

> Isn't it rather wasting people's time when letting them review the
> first patchset even when knowing that V2 is substantially different?

When you already know a V3 is coming, yes, of course it is wasting
people's time.

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

User Nicolas George <[email protected]> has been added to the cc: list.

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Nicolas George
> Sent: Donnerstag, 6. M�rz 2025 11:09
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> Soft Works (HE12025-03-05):
> > Sorry. So - seriously: what would be your recipe then?
> 
> I see not just a little of non-trivial code for a very minor feature,

Whether trivial or non-trivial, it's definitely just very little code.

> that might be a hint that it would be best to let it go.

This is not a helpful comment. I'm trying hard to be friendly and productive and I think it's not asked too much to at least try doing as well. 


> Also, if somebody is debugging a program using the libraries, the
> pointers are relevant for that program. For that reason, I think the
> change is a bad idea in the library.

It's a valid point, I have acknowledged that already and added a log flag in V2 which allows to control it.

As a further compromise, we could also enable it by default in case when DEBUG is defined, how about that?

Generally, debugging is important without doubt, but it doesn't mean that Millions of users need to see something in the output which is only ever relevant to developers - that's the premise of this patchset. 

And even as a developer, those addresses are interesting only in a very narrow range of cases. 
These addresses have been a major pain point for myself and many others over years when comparing logfiles. Even the best diffing algorithms are getting confused by these addresses and I think this patchset provides a huge benefit for both, users and developers in the future, making their work a lot easier.


> On the other hand, you could do that change in the fftools. The point
> about pointers being relevant does not apply for them, and they can have
> as much global state as they want.

You know that it's not easily possible to do it from within fftools because all libs are logging directly to avutil, so it's not quite clear to me what you are up to. 
Do you mean something like a int(* av_log_format_prefix)(...) callback that fftools could register to?


Thanks
sw






_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Nicolas George
> Sent: Donnerstag, 6. M�rz 2025 17:43
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses
> in log output with simple ids
> 
> Soft Works (HE12025-03-06):
> > It is the GitGitGadget system which does this this automatically.
> 
> Your choice to use that thing, your responsibility to not let it
> misbehave.
> 
> > But I have removed you now and try to remove you again each time when
> you reply.
> 
> Do not Cc other people either if they did not ask for it.

Ok, I'll try to disable that behavior altogether.


> When you already know a V3 is coming, yes, of course it is wasting
> people's time.

We're not talking about V3. Your criticism was about V2. I submitted it because I knew it was coming, so thanks for acknowledging that my submission of V2 was not wasting people's time.

sw

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

User Soft Works <[email protected]> has been added to the cc: list.

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Soft
> Works
> Sent: Donnerstag, 6. M�rz 2025 18:05
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace addresses
> in log output with simple ids
> 
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel <[email protected]> On Behalf Of
> > Nicolas George
> > Sent: Donnerstag, 6. M�rz 2025 17:43
> > To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> > Subject: Re: [FFmpeg-devel] [PATCH v2 0/3] avutil/log: Replace
> addresses
> > in log output with simple ids
> >
> > Soft Works (HE12025-03-06):
> > > It is the GitGitGadget system which does this this automatically.
> >
> > Your choice to use that thing, your responsibility to not let it
> > misbehave.
> >
> > > But I have removed you now and try to remove you again each time
> when
> > you reply.
> >
> > Do not Cc other people either if they did not ask for it.
> 
> Ok, I'll try to disable that behavior altogether.

About 60 patchsets have been submitted via this path already (not counting versions) and you are the first one complaining, that's why I haven't paid much attention on that part before.

The auto-cc feature is disabled now. Thanks for the feedback and apologies for the inconvenience.

sw





_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Marvin Scholz wrote (reply to this):



On 6 Mar 2025, at 18:02, Soft Works wrote:

>> -----Original Message-----
>> From: ffmpeg-devel <[email protected]> On Behalf Of
>> Nicolas George
>> Sent: Donnerstag, 6. März 2025 11:09
>> To: FFmpeg development discussions and patches <[email protected]>
>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
>> output with simple ids
>>
>> Soft Works (HE12025-03-05):
>>> Sorry. So - seriously: what would be your recipe then?
>>
>> I see not just a little of non-trivial code for a very minor feature,
>
> Whether trivial or non-trivial, it's definitely just very little code.
>
>> that might be a hint that it would be best to let it go.
>
> This is not a helpful comment. I'm trying hard to be friendly and productive and I think it's not asked too much to at least try doing as well.
>
>
>> Also, if somebody is debugging a program using the libraries, the
>> pointers are relevant for that program. For that reason, I think the
>> change is a bad idea in the library.
>
> It's a valid point, I have acknowledged that already and added a log flag in V2 which allows to control it.
>
> As a further compromise, we could also enable it by default in case when DEBUG is defined, how about that?
>
> Generally, debugging is important without doubt, but it doesn't mean that Millions of users need to see something in the output which is only ever relevant to developers - that's the premise of this patchset.
>
> And even as a developer, those addresses are interesting only in a very narrow range of cases.
> These addresses have been a major pain point for myself and many others over years when comparing logfiles. Even the best diffing algorithms are getting confused by these addresses and I think this patchset provides a huge benefit for both, users and developers in the future, making their work a lot easier.
>
>
>> On the other hand, you could do that change in the fftools. The point
>> about pointers being relevant does not apply for them, and they can have
>> as much global state as they want.
>
> You know that it's not easily possible to do it from within fftools because all libs are logging directly to avutil, so it's not quite clear to me what you are up to.
> Do you mean something like a int(* av_log_format_prefix)(...) callback that fftools could register to?
>

First of all I want to say I like the idea of having cleaner logs, but...

IMHO "complex" logging formatting should be handled by fftools especially if
they need global state. Even though thats not the case right now, but just
like Nicolas I also would prefer to not add even more global state for logging
to the library...

All the fancy log formatting should be done in a log callback in the
fftools and the default library logging callback should just be a very basic
one, is my opinion on this.

>
> Thanks
> sw
>
>
>
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Marvin
> Scholz
> Sent: Donnerstag, 6. März 2025 18:38
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> 
> 
> On 6 Mar 2025, at 18:02, Soft Works wrote:
> 
> >> -----Original Message-----
> >> From: ffmpeg-devel <[email protected]> On Behalf Of
> >> Nicolas George
> >> Sent: Donnerstag, 6. März 2025 11:09
> >> To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> >> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in
> log
> >> output with simple ids
> >>
> >> Soft Works (HE12025-03-05):
> >>> Sorry. So - seriously: what would be your recipe then?
> >>
> >> I see not just a little of non-trivial code for a very minor feature,
> >
> > Whether trivial or non-trivial, it's definitely just very little code.
> >
> >> that might be a hint that it would be best to let it go.
> >
> > This is not a helpful comment. I'm trying hard to be friendly and
> productive and I think it's not asked too much to at least try doing as
> well.
> >
> >
> >> Also, if somebody is debugging a program using the libraries, the
> >> pointers are relevant for that program. For that reason, I think the
> >> change is a bad idea in the library.
> >
> > It's a valid point, I have acknowledged that already and added a log
> flag in V2 which allows to control it.
> >
> > As a further compromise, we could also enable it by default in case
> when DEBUG is defined, how about that?
> >
> > Generally, debugging is important without doubt, but it doesn't mean
> that Millions of users need to see something in the output which is only
> ever relevant to developers - that's the premise of this patchset.
> >
> > And even as a developer, those addresses are interesting only in a
> very narrow range of cases.
> > These addresses have been a major pain point for myself and many
> others over years when comparing logfiles. Even the best diffing
> algorithms are getting confused by these addresses and I think this
> patchset provides a huge benefit for both, users and developers in the
> future, making their work a lot easier.
> >
> >
> >> On the other hand, you could do that change in the fftools. The point
> >> about pointers being relevant does not apply for them, and they can
> have
> >> as much global state as they want.
> >
> > You know that it's not easily possible to do it from within fftools
> because all libs are logging directly to avutil, so it's not quite clear
> to me what you are up to.
> > Do you mean something like a int(* av_log_format_prefix)(...) callback
> that fftools could register to?
> >
> 
> First of all I want to say I like the idea of having cleaner logs,
> but...
> 
> IMHO "complex" logging formatting should be handled by fftools
> especially if
> they need global state. Even though thats not the case right now, but
> just
> like Nicolas I also would prefer to not add even more global state for
> logging
> to the library...
> 
> All the fancy log formatting should be done in a log callback in the
> fftools and the default library logging callback should just be a very
> basic
> one, is my opinion on this.

That's all fine and probably reasonable. But is it fair to block a small change because some major rework would be desired at some point?

When that change will be made, it will of course move out this little change as well.

But are you really saying that this small change cannot be made because you don't like the general way of the current implementation?

Thanks
sw


_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Marvin Scholz wrote (reply to this):



On 6 Mar 2025, at 18:44, Soft Works wrote:

>> -----Original Message-----
>> From: ffmpeg-devel <[email protected]> On Behalf Of Marvin
>> Scholz
>> Sent: Donnerstag, 6. März 2025 18:38
>> To: FFmpeg development discussions and patches <[email protected]>
>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
>> output with simple ids
>>
>>
>>
>> On 6 Mar 2025, at 18:02, Soft Works wrote:
>>
>>>> -----Original Message-----
>>>> From: ffmpeg-devel <[email protected]> On Behalf Of
>>>> Nicolas George
>>>> Sent: Donnerstag, 6. März 2025 11:09
>>>> To: FFmpeg development discussions and patches <ffmpeg-
>> [email protected]>
>>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in
>> log
>>>> output with simple ids
>>>>
>>>> Soft Works (HE12025-03-05):
>>>>> Sorry. So - seriously: what would be your recipe then?
>>>>
>>>> I see not just a little of non-trivial code for a very minor feature,
>>>
>>> Whether trivial or non-trivial, it's definitely just very little code.
>>>
>>>> that might be a hint that it would be best to let it go.
>>>
>>> This is not a helpful comment. I'm trying hard to be friendly and
>> productive and I think it's not asked too much to at least try doing as
>> well.
>>>
>>>
>>>> Also, if somebody is debugging a program using the libraries, the
>>>> pointers are relevant for that program. For that reason, I think the
>>>> change is a bad idea in the library.
>>>
>>> It's a valid point, I have acknowledged that already and added a log
>> flag in V2 which allows to control it.
>>>
>>> As a further compromise, we could also enable it by default in case
>> when DEBUG is defined, how about that?
>>>
>>> Generally, debugging is important without doubt, but it doesn't mean
>> that Millions of users need to see something in the output which is only
>> ever relevant to developers - that's the premise of this patchset.
>>>
>>> And even as a developer, those addresses are interesting only in a
>> very narrow range of cases.
>>> These addresses have been a major pain point for myself and many
>> others over years when comparing logfiles. Even the best diffing
>> algorithms are getting confused by these addresses and I think this
>> patchset provides a huge benefit for both, users and developers in the
>> future, making their work a lot easier.
>>>
>>>
>>>> On the other hand, you could do that change in the fftools. The point
>>>> about pointers being relevant does not apply for them, and they can
>> have
>>>> as much global state as they want.
>>>
>>> You know that it's not easily possible to do it from within fftools
>> because all libs are logging directly to avutil, so it's not quite clear
>> to me what you are up to.
>>> Do you mean something like a int(* av_log_format_prefix)(...) callback
>> that fftools could register to?
>>>
>>
>> First of all I want to say I like the idea of having cleaner logs,
>> but...
>>
>> IMHO "complex" logging formatting should be handled by fftools
>> especially if
>> they need global state. Even though thats not the case right now, but
>> just
>> like Nicolas I also would prefer to not add even more global state for
>> logging
>> to the library...
>>
>> All the fancy log formatting should be done in a log callback in the
>> fftools and the default library logging callback should just be a very
>> basic
>> one, is my opinion on this.
>
> That's all fine and probably reasonable. But is it fair to block a small change because some major rework would be desired at some point?
>
> When that change will be made, it will of course move out this little change as well.
>
> But are you really saying that this small change cannot be made because you don't like the general way of the current implementation?
>

Just to be clear, I am not blocking this, just wanted to give my perspective on the topic.
So if others think its fine and want it, lets go for it.

> Thanks
> sw
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Marvin
> Scholz
> Sent: Donnerstag, 6. März 2025 18:49
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> 
> 
> On 6 Mar 2025, at 18:44, Soft Works wrote:
> 
> >> -----Original Message-----
> >> From: ffmpeg-devel <[email protected]> On Behalf Of
> Marvin
> >> Scholz
> >> Sent: Donnerstag, 6. März 2025 18:38
> >> To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> >> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in
> log
> >> output with simple ids
> >>
> >>
> >>
> >> On 6 Mar 2025, at 18:02, Soft Works wrote:
> >>
> >>>> -----Original Message-----
> >>>> From: ffmpeg-devel <[email protected]> On Behalf Of
> >>>> Nicolas George
> >>>> Sent: Donnerstag, 6. März 2025 11:09
> >>>> To: FFmpeg development discussions and patches <ffmpeg-
> >> [email protected]>
> >>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses
> in
> >> log
> >>>> output with simple ids
> >>>>
> >>>> Soft Works (HE12025-03-05):
> >>>>> Sorry. So - seriously: what would be your recipe then?
> >>>>
> >>>> I see not just a little of non-trivial code for a very minor
> feature,
> >>>
> >>> Whether trivial or non-trivial, it's definitely just very little
> code.
> >>>
> >>>> that might be a hint that it would be best to let it go.
> >>>
> >>> This is not a helpful comment. I'm trying hard to be friendly and
> >> productive and I think it's not asked too much to at least try doing
> as
> >> well.
> >>>
> >>>
> >>>> Also, if somebody is debugging a program using the libraries, the
> >>>> pointers are relevant for that program. For that reason, I think
> the
> >>>> change is a bad idea in the library.
> >>>
> >>> It's a valid point, I have acknowledged that already and added a log
> >> flag in V2 which allows to control it.
> >>>
> >>> As a further compromise, we could also enable it by default in case
> >> when DEBUG is defined, how about that?
> >>>
> >>> Generally, debugging is important without doubt, but it doesn't mean
> >> that Millions of users need to see something in the output which is
> only
> >> ever relevant to developers - that's the premise of this patchset.
> >>>
> >>> And even as a developer, those addresses are interesting only in a
> >> very narrow range of cases.
> >>> These addresses have been a major pain point for myself and many
> >> others over years when comparing logfiles. Even the best diffing
> >> algorithms are getting confused by these addresses and I think this
> >> patchset provides a huge benefit for both, users and developers in
> the
> >> future, making their work a lot easier.
> >>>
> >>>
> >>>> On the other hand, you could do that change in the fftools. The
> point
> >>>> about pointers being relevant does not apply for them, and they can
> >> have
> >>>> as much global state as they want.
> >>>
> >>> You know that it's not easily possible to do it from within fftools
> >> because all libs are logging directly to avutil, so it's not quite
> clear
> >> to me what you are up to.
> >>> Do you mean something like a int(* av_log_format_prefix)(...)
> callback
> >> that fftools could register to?
> >>>
> >>
> >> First of all I want to say I like the idea of having cleaner logs,
> >> but...
> >>
> >> IMHO "complex" logging formatting should be handled by fftools
> >> especially if
> >> they need global state. Even though thats not the case right now, but
> >> just
> >> like Nicolas I also would prefer to not add even more global state
> for
> >> logging
> >> to the library...
> >>
> >> All the fancy log formatting should be done in a log callback in the
> >> fftools and the default library logging callback should just be a
> very
> >> basic
> >> one, is my opinion on this.
> >
> > That's all fine and probably reasonable. But is it fair to block a
> small change because some major rework would be desired at some point?
> >
> > When that change will be made, it will of course move out this little
> change as well.
> >
> > But are you really saying that this small change cannot be made
> because you don't like the general way of the current implementation?
> >
> 
> Just to be clear, I am not blocking this, just wanted to give my
> perspective on the topic.
> So if others think its fine and want it, lets go for it.

Thanks - and sorry for my retardation, I just realized why it's bad to do it this way with regards to library usage. I'll add a callback so that fftools can do the prefix formatting.

For the idea of moving all the formatting to fftools, wouldn't this be a major breakage for library consumers who are used to getting the log output formatted like now?


Thanks,
sw

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Marvin Scholz wrote (reply to this):



On 6 Mar 2025, at 19:16, Soft Works wrote:

>> -----Original Message-----
>> From: ffmpeg-devel <[email protected]> On Behalf Of Marvin
>> Scholz
>> Sent: Donnerstag, 6. März 2025 18:49
>> To: FFmpeg development discussions and patches <[email protected]>
>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
>> output with simple ids
>>
>>
>>
>> On 6 Mar 2025, at 18:44, Soft Works wrote:
>>
>>>> -----Original Message-----
>>>> From: ffmpeg-devel <[email protected]> On Behalf Of
>> Marvin
>>>> Scholz
>>>> Sent: Donnerstag, 6. März 2025 18:38
>>>> To: FFmpeg development discussions and patches <ffmpeg-
>> [email protected]>
>>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in
>> log
>>>> output with simple ids
>>>>
>>>>
>>>>
>>>> On 6 Mar 2025, at 18:02, Soft Works wrote:
>>>>
>>>>>> -----Original Message-----
>>>>>> From: ffmpeg-devel <[email protected]> On Behalf Of
>>>>>> Nicolas George
>>>>>> Sent: Donnerstag, 6. März 2025 11:09
>>>>>> To: FFmpeg development discussions and patches <ffmpeg-
>>>> [email protected]>
>>>>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses
>> in
>>>> log
>>>>>> output with simple ids
>>>>>>
>>>>>> Soft Works (HE12025-03-05):
>>>>>>> Sorry. So - seriously: what would be your recipe then?
>>>>>>
>>>>>> I see not just a little of non-trivial code for a very minor
>> feature,
>>>>>
>>>>> Whether trivial or non-trivial, it's definitely just very little
>> code.
>>>>>
>>>>>> that might be a hint that it would be best to let it go.
>>>>>
>>>>> This is not a helpful comment. I'm trying hard to be friendly and
>>>> productive and I think it's not asked too much to at least try doing
>> as
>>>> well.
>>>>>
>>>>>
>>>>>> Also, if somebody is debugging a program using the libraries, the
>>>>>> pointers are relevant for that program. For that reason, I think
>> the
>>>>>> change is a bad idea in the library.
>>>>>
>>>>> It's a valid point, I have acknowledged that already and added a log
>>>> flag in V2 which allows to control it.
>>>>>
>>>>> As a further compromise, we could also enable it by default in case
>>>> when DEBUG is defined, how about that?
>>>>>
>>>>> Generally, debugging is important without doubt, but it doesn't mean
>>>> that Millions of users need to see something in the output which is
>> only
>>>> ever relevant to developers - that's the premise of this patchset.
>>>>>
>>>>> And even as a developer, those addresses are interesting only in a
>>>> very narrow range of cases.
>>>>> These addresses have been a major pain point for myself and many
>>>> others over years when comparing logfiles. Even the best diffing
>>>> algorithms are getting confused by these addresses and I think this
>>>> patchset provides a huge benefit for both, users and developers in
>> the
>>>> future, making their work a lot easier.
>>>>>
>>>>>
>>>>>> On the other hand, you could do that change in the fftools. The
>> point
>>>>>> about pointers being relevant does not apply for them, and they can
>>>> have
>>>>>> as much global state as they want.
>>>>>
>>>>> You know that it's not easily possible to do it from within fftools
>>>> because all libs are logging directly to avutil, so it's not quite
>> clear
>>>> to me what you are up to.
>>>>> Do you mean something like a int(* av_log_format_prefix)(...)
>> callback
>>>> that fftools could register to?
>>>>>
>>>>
>>>> First of all I want to say I like the idea of having cleaner logs,
>>>> but...
>>>>
>>>> IMHO "complex" logging formatting should be handled by fftools
>>>> especially if
>>>> they need global state. Even though thats not the case right now, but
>>>> just
>>>> like Nicolas I also would prefer to not add even more global state
>> for
>>>> logging
>>>> to the library...
>>>>
>>>> All the fancy log formatting should be done in a log callback in the
>>>> fftools and the default library logging callback should just be a
>> very
>>>> basic
>>>> one, is my opinion on this.
>>>
>>> That's all fine and probably reasonable. But is it fair to block a
>> small change because some major rework would be desired at some point?
>>>
>>> When that change will be made, it will of course move out this little
>> change as well.
>>>
>>> But are you really saying that this small change cannot be made
>> because you don't like the general way of the current implementation?
>>>
>>
>> Just to be clear, I am not blocking this, just wanted to give my
>> perspective on the topic.
>> So if others think its fine and want it, lets go for it.
>
> Thanks - and sorry for my retardation, I just realized why it's bad to do it this way with regards to library usage. I'll add a callback so that fftools can do the prefix formatting.
>
> For the idea of moving all the formatting to fftools, wouldn't this be a major breakage for library consumers who are used to getting the log output formatted like now?
>

Yeah, one of the reasons why I did not really do any work on this yet as I am really
not sure whats the best way to go about this to not be too surprising for existing
library users...

>
> Thanks,
> sw
>
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Mar 6, 2025

On the FFmpeg mailing list, Soft Works wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Marvin
> Scholz
> Sent: Donnerstag, 6. März 2025 19:59
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in log
> output with simple ids
> 
> 
> 
> On 6 Mar 2025, at 19:16, Soft Works wrote:
> 
> >> -----Original Message-----
> >> From: ffmpeg-devel <[email protected]> On Behalf Of
> Marvin
> >> Scholz
> >> Sent: Donnerstag, 6. März 2025 18:49
> >> To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> >> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses in
> log
> >> output with simple ids
> >>
> >>
> >>
> >> On 6 Mar 2025, at 18:44, Soft Works wrote:
> >>
> >>>> -----Original Message-----
> >>>> From: ffmpeg-devel <[email protected]> On Behalf Of
> >> Marvin
> >>>> Scholz
> >>>> Sent: Donnerstag, 6. März 2025 18:38
> >>>> To: FFmpeg development discussions and patches <ffmpeg-
> >> [email protected]>
> >>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses
> in
> >> log
> >>>> output with simple ids
> >>>>
> >>>>
> >>>>
> >>>> On 6 Mar 2025, at 18:02, Soft Works wrote:
> >>>>
> >>>>>> -----Original Message-----
> >>>>>> From: ffmpeg-devel <[email protected]> On Behalf Of
> >>>>>> Nicolas George
> >>>>>> Sent: Donnerstag, 6. März 2025 11:09
> >>>>>> To: FFmpeg development discussions and patches <ffmpeg-
> >>>> [email protected]>
> >>>>>> Subject: Re: [FFmpeg-devel] [PATCH] avutil/log: Replace addresses

[..]

> >>>>
> >>>> First of all I want to say I like the idea of having cleaner logs,
> >>>> but...
> >>>>
> >>>> IMHO "complex" logging formatting should be handled by fftools
> >>>> especially if
> >>>> they need global state. Even though thats not the case right now,
> but
> >>>> just
> >>>> like Nicolas I also would prefer to not add even more global state
> >> for
> >>>> logging
> >>>> to the library...
> >>>>
> >>>> All the fancy log formatting should be done in a log callback in
> the
> >>>> fftools and the default library logging callback should just be a
> >> very
> >>>> basic
> >>>> one, is my opinion on this.
> >>>
> >>> That's all fine and probably reasonable. But is it fair to block a
> >> small change because some major rework would be desired at some
> point?
> >>>
> >>> When that change will be made, it will of course move out this
> little
> >> change as well.
> >>>
> >>> But are you really saying that this small change cannot be made
> >> because you don't like the general way of the current implementation?
> >>>
> >>
> >> Just to be clear, I am not blocking this, just wanted to give my
> >> perspective on the topic.
> >> So if others think its fine and want it, lets go for it.
> >
> > Thanks - and sorry for my retardation, I just realized why it's bad to
> do it this way with regards to library usage. I'll add a callback so
> that fftools can do the prefix formatting.
> >
> > For the idea of moving all the formatting to fftools, wouldn't this be
> a major breakage for library consumers who are used to getting the log
> output formatted like now?
> >
> 
> Yeah, one of the reasons why I did not really do any work on this yet as
> I am really
> not sure whats the best way to go about this to not be too surprising
> for existing
> library users...

I think, people _do_ want the formatting even when using the libs directly, so while separating formatting from the plain logging might make sense, it would probably still need to be in avutil - otherwise most consumers would probably be annoyed and have to copy the formatting code from fftools to their own code base (or similar) - which wouldn't be a win for anybody.
I see why the global state is bad with regards to this patchset's feature (and V3 will remedy), but avoidance of global state would be much easier and also make more sense if there was some kind of "local state" as a replacement, so that people could for example have separate log outputs when performing separate and independent operations.
I suppose that's not easy to achieve with the current architecture?

sw








_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v6

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v6:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v6

@softworkz softworkz force-pushed the submit_logaddresses branch from ea2a970 to 6d3f305 Compare April 9, 2025 05:28
@softworkz softworkz changed the title avutil/log: Replace addresses in log output with simple ids avutil/log: Add log flag to control printing of memory addresses Apr 9, 2025
@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Apr 9, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v7

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v7:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v7

@softworkz softworkz force-pushed the submit_logaddresses branch from 6d3f305 to 22c5189 Compare April 9, 2025 08:49
@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Apr 9, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v8

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v8:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v8

@softworkz softworkz force-pushed the submit_logaddresses branch 2 times, most recently from 60ceab0 to bfe2e51 Compare April 9, 2025 18:16
@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Apr 9, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v9

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v9:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v9

@softworkz softworkz force-pushed the submit_logaddresses branch from bfe2e51 to dc334f3 Compare April 10, 2025 00:06
@softworkz
Copy link
Collaborator Author

/submit

Copy link

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v10

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v10:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v10

fftools/ffmpeg.c Outdated
@@ -954,7 +954,7 @@ int main(int argc, char **argv)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

softworkz (HE12025-04-10):
> From: softworkz <[email protected]>
> 
> This commit adds the mem log flag.
> When specifying this flag at the command line, context prefixes will
> be printed with memory addresses like in earlier ffmpeg versions.
> 
> Example with mem flag:
> 
> [hevc @ 0000018e72a89cc0] .....

As explained recently, strong opposition to this being the default.

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: Nicolas George <[email protected]>
> Sent: Donnerstag, 10. April 2025 08:51
> To: FFmpeg development discussions and patches <[email protected]>
> Cc: softworkz <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v10 2/3] fftools: add mem log flag
> and disable printing addresses by default
> 
> softworkz (HE12025-04-10):
> > From: softworkz <[email protected]>
> >
> > This commit adds the mem log flag.
> > When specifying this flag at the command line, context prefixes will
> > be printed with memory addresses like in earlier ffmpeg versions.
> >
> > Example with mem flag:
> >
> > [hevc @ 0000018e72a89cc0] .....
> 
> As explained recently, strong opposition to this being the default.
> 
> --
>   Nicolas George

Hi Nicolas,

other than your previous comments, questioning the default behavior is an acceptable concern.


I think in this case it makes sense to just put it up for a vote.

It's a significant change which should be backed by a majority opinion.


Best,
sw
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, Michael Niedermayer wrote (reply to this):


--===============1685350178670096472==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="KLWx2LEuultqqEB2"
Content-Disposition: inline


--KLWx2LEuultqqEB2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi

On Thu, Apr 10, 2025 at 08:51:04AM +0200, Nicolas George wrote:
> softworkz (HE12025-04-10):
> > From: softworkz <[email protected]>
> >=20
> > This commit adds the mem log flag.
> > When specifying this flag at the command line, context prefixes will
> > be printed with memory addresses like in earlier ffmpeg versions.
> >=20
> > Example with mem flag:
> >=20
> > [hevc @ 0000018e72a89cc0] .....
>=20
> As explained recently, strong opposition to this being the default.

just some random comments:

I think some way to distingish two different "hevc" instances
with high probability should remain.

About the addresses. Iam curious how frequently do people use them ?
and for what exactly ?

I do think *item_name() should be used more often. The "hevc" is a
quite bland identifcation of the instance.

in absence of a item_name(), that is *av_default_item_name()
which prints just the class name. I think printing the address by default
is reasonable otherwsie instances would be always indistingishable

beyond that, i dont remember using the addresses and would not
mind if it gets replaced by something more usefull more repeatable
with maybe some mem flag that could force them to be printed in all
cases

but i dont know, really depends on what the community prefers

thx

[...]
--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway

--KLWx2LEuultqqEB2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ/+z8wAKCRBhHseHBAsP
q8QrAJ9qIm0dnTwuFQ6y+TTVYtSFbagwJQCeNnoKY0DFYf/rLZb4VJ3c0szwEpU=
=ineg
-----END PGP SIGNATURE-----

--KLWx2LEuultqqEB2--

--===============1685350178670096472==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

--===============1685350178670096472==--

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, Nicolas George wrote (reply to this):

Michael Niedermayer (HE12025-04-16):
> I think some way to distingish two different "hevc" instances
> with high probability should remain.

This is exactly my point. The address is meaningless�, but it is a sure
way to distinguish instances of the same components without tons of
fragile code.

1: In a debugger, the address would be available without printing.

> I do think *item_name() should be used more often.

Making sure it returns something different for different instances
without the code getting complex and/or the name getting long is quite a
challenge.

This fruit is neither low-hanging nor tasty. My position on this: leave
the address alone unless one has a very good idea to achieve the goal.

Regards,

-- 
  Nicolas George
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, Gyan Doshi wrote (reply to this):



On 2025-04-16 07:20 pm, Nicolas George wrote:
> Michael Niedermayer (HE12025-04-16):
>> I think some way to distingish two different "hevc" instances
>> with high probability should remain.
> This is exactly my point. The address is meaningless¹, but it is a sure
> way to distinguish instances of the same components without tons of
> fragile code.

For CLI users, the fftool log prefixes already identify the input file 
and the stream in many msgs, e.g.

e.g. [vist#0:0/h264 @ 000002485a204540] [dec:h264 @ 000002485a36e900] 
Decoder thread received EOF packet

So, an opt-in flag should be added even if it's not made the default, or 
no UUID replacement is found for the memaddr.

Regards,
Gyan

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Michael Niedermayer
> Sent: Mittwoch, 16. April 2025 15:43
> To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v10 2/3] fftools: add mem log flag
> and disable printing addresses by default
> 
> Hi
> 
> On Thu, Apr 10, 2025 at 08:51:04AM +0200, Nicolas George wrote:
> > softworkz (HE12025-04-10):
> > > From: softworkz <[email protected]>
> > >
> > > This commit adds the mem log flag.
> > > When specifying this flag at the command line, context prefixes
> will
> > > be printed with memory addresses like in earlier ffmpeg versions.
> > >
> > > Example with mem flag:
> > >
> > > [hevc @ 0000018e72a89cc0] .....
> >
> > As explained recently, strong opposition to this being the default.
> 
> just some random comments:
> 
> I think some way to distingish two different "hevc" instances
> with high probability should remain.
> 
> About the addresses. Iam curious how frequently do people use them ?
> and for what exactly ?
> 
> I do think *item_name() should be used more often. The "hevc" is a
> quite bland identifcation of the instance.
> 
> in absence of a item_name(), that is *av_default_item_name()
> which prints just the class name. I think printing the address by
> default
> is reasonable otherwsie instances would be always indistingishable
> 
> beyond that, i dont remember using the addresses and would not
> mind if it gets replaced by something more usefull more repeatable
> with maybe some mem flag that could force them to be printed in all
> cases
> 
> but i dont know, really depends on what the community prefers


Thanks Michael,

I'm gonna keep myself out of arguing, I believe that this is a decision
that should be based on what the community (majority) will prefer.

I just want to summarize the different implementations that are available
already while the patchset has walked its way through the various comments 
that were made.

-----------------------------------------

1. Implementation in avutil with replacement Ids
   The replacement Ids are a direct projection of the mem addresses, which
   means that they are equally evident - yet subject to the same limitations
   as the mem-addresses.
   But other than the mem-addresses, this creates the identical log output
   when repeating the same command.

Reviews:

- It has been criticized that this introduces global state which is 
  undesired in case of library use
- It has been suggested to implement this in fftools only, in a way that
  fftools has its own and independent logging implementation, no longer
  using the one in avutil. It was also based on the idea that this would 
  allow to do other things in the future which cannot reasonably be 
  implemented in avutil

This has led to the second variant:

-----------------------------------------

2. Implementation in fftools with replacement Ids
   Replacement Id behavior is the same as in (1).
   Obviously, there's no point in writing this from scratch, so the starting
   point was the logging code from avutil

Reviews:

- This has raised criticism due to the copied logging code
- It was suggested to drop the replacement Ids and then it could be
  implemented in avutil only

This has led to the third version:

-----------------------------------------

3. Implementation back in avutil without Ids

   Means you switch the mem addresses on or off, when off, no Ids are printed

-----------------------------------------


Best regards,
softworkz
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@@ -1,5 +1,8 @@
The last version increases of all libraries were on 2025-03-28

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, Andreas Rheinhardt wrote (reply to this):

softworkz:
> From: softworkz <[email protected]>
> 
> which is controls prefix formatting. With this flag set, the prefix is
> printed without the memory address, otherwise it is included.
> 
> Signed-off-by: softworkz <[email protected]>
> ---
>  doc/APIchanges      | 3 +++
>  libavutil/log.c     | 6 ++++--
>  libavutil/log.h     | 5 +++++
>  libavutil/version.h | 2 +-
>  4 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 65bf5a9419..db832f8b19 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -1,5 +1,8 @@
>  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_NO_PRINT_MEMADDRESS
> +
>  API changes, most recent first:
>  
>  2025-04-07 - 19e9a203b7 - lavu 60.01.100 - dict.h
> diff --git a/libavutil/log.c b/libavutil/log.c
> index c5ee876a88..1949a797e7 100644
> --- a/libavutil/log.c
> +++ b/libavutil/log.c
> @@ -327,16 +327,18 @@ 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_NO_PRINT_MEMADDRESS ? "[%s] " : "[%s @ %p] ";
> +
>          if (avc->parent_log_context_offset) {
>              AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
>                                     avc->parent_log_context_offset);
>              if (parent && *parent) {
> -                av_bprintf(part+0, "[%s @ %p] ",
> +                av_bprintf(part+0, p_fmt,
>                             item_name(parent, *parent), parent);
>                  if(type) type[0] = get_category(parent);
>              }
>          }
> -        av_bprintf(part+1, "[%s @ %p] ",
> +        av_bprintf(part+1, p_fmt,
>                     item_name(avcl, avc), avcl);
>          if(type) type[1] = get_category(avcl);
>      }
> diff --git a/libavutil/log.h b/libavutil/log.h
> index dd094307ce..499c5d71ab 100644
> --- a/libavutil/log.h
> +++ b/libavutil/log.h
> @@ -416,6 +416,11 @@ int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
>   */
>  #define AV_LOG_PRINT_DATETIME 8
>  
> +/**
> + * Do not print memory addresses of context instances.
> + */
> +#define AV_LOG_NO_PRINT_MEMADDRESS 16
> +
>  void av_log_set_flags(int arg);
>  int av_log_get_flags(void);
>  
> diff --git a/libavutil/version.h b/libavutil/version.h
> index 5139883569..4717cd562b 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -79,7 +79,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR  60
> -#define LIBAVUTIL_VERSION_MINOR   1
> +#define LIBAVUTIL_VERSION_MINOR   2
>  #define LIBAVUTIL_VERSION_MICRO 100
>  
>  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

The commit message needs an update.

- Andreas

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of
> Andreas Rheinhardt
> Sent: Donnerstag, 10. April 2025 09:39
> To: [email protected]
> Subject: Re: [FFmpeg-devel] [PATCH v10 1/3] avutil/log: Add log flag
> AV_LOG_PRINT_MEMADDRESSES
> 
> softworkz:
> > From: softworkz <[email protected]>
> >
> > which is controls prefix formatting. With this flag set, the prefix is
> > printed without the memory address, otherwise it is included.
> >
> > Signed-off-by: softworkz <[email protected]>
> > ---
> >  doc/APIchanges      | 3 +++
> >  libavutil/log.c     | 6 ++++--
> >  libavutil/log.h     | 5 +++++
> >  libavutil/version.h | 2 +-
> >  4 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 65bf5a9419..db832f8b19 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -1,5 +1,8 @@
> >  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_NO_PRINT_MEMADDRESS
> > +
> >  API changes, most recent first:
> >
> >  2025-04-07 - 19e9a203b7 - lavu 60.01.100 - dict.h
> > diff --git a/libavutil/log.c b/libavutil/log.c
> > index c5ee876a88..1949a797e7 100644
> > --- a/libavutil/log.c
> > +++ b/libavutil/log.c
> > @@ -327,16 +327,18 @@ 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_NO_PRINT_MEMADDRESS ?
> "[%s] " : "[%s @ %p] ";
> > +
> >          if (avc->parent_log_context_offset) {
> >              AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
> >                                     avc->parent_log_context_offset);
> >              if (parent && *parent) {
> > -                av_bprintf(part+0, "[%s @ %p] ",
> > +                av_bprintf(part+0, p_fmt,
> >                             item_name(parent, *parent), parent);
> >                  if(type) type[0] = get_category(parent);
> >              }
> >          }
> > -        av_bprintf(part+1, "[%s @ %p] ",
> > +        av_bprintf(part+1, p_fmt,
> >                     item_name(avcl, avc), avcl);
> >          if(type) type[1] = get_category(avcl);
> >      }
> > diff --git a/libavutil/log.h b/libavutil/log.h
> > index dd094307ce..499c5d71ab 100644
> > --- a/libavutil/log.h
> > +++ b/libavutil/log.h
> > @@ -416,6 +416,11 @@ int av_log_format_line2(void *ptr, int level,
> const char *fmt, va_list vl,
> >   */
> >  #define AV_LOG_PRINT_DATETIME 8
> >
> > +/**
> > + * Do not print memory addresses of context instances.
> > + */
> > +#define AV_LOG_NO_PRINT_MEMADDRESS 16
> > +
> >  void av_log_set_flags(int arg);
> >  int av_log_get_flags(void);
> >
> > diff --git a/libavutil/version.h b/libavutil/version.h
> > index 5139883569..4717cd562b 100644
> > --- a/libavutil/version.h
> > +++ b/libavutil/version.h
> > @@ -79,7 +79,7 @@
> >   */
> >
> >  #define LIBAVUTIL_VERSION_MAJOR  60
> > -#define LIBAVUTIL_VERSION_MINOR   1
> > +#define LIBAVUTIL_VERSION_MINOR   2
> >  #define LIBAVUTIL_VERSION_MICRO 100
> >
> >  #define LIBAVUTIL_VERSION_INT
> AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
> 
> The commit message needs an update.
> 
> - Andreas
> 
> _______________________________________________

Thanks! Fixed locally.


_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@softworkz softworkz force-pushed the submit_logaddresses branch 2 times, most recently from 298e9ea to 0651d3b Compare June 6, 2025 17:11
softworkz added 3 commits June 6, 2025 19:28
…y default

Memory addresses are no longer printed by default.
With this flag set, memory addresses are included like
in earlier versions.

Signed-off-by: softworkz <[email protected]>
This commit adds the mem log flag.
When specifying this flag at the command line, context prefixes will
be printed with memory addresses like in earlier ffmpeg versions.

Example with mem flag:

[hevc @ 0000018e72a89cc0] .....

without (new behavior):

[hevc] .....

Signed-off-by: softworkz <[email protected]>
@softworkz softworkz force-pushed the submit_logaddresses branch from 0651d3b to fd233fb Compare June 6, 2025 17:34
@softworkz
Copy link
Collaborator Author

/submit

Copy link

ffmpeg-codebot bot commented Jun 6, 2025

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-59/softworkz/submit_logaddresses-v11

To fetch this version to local tag pr-ffstaging-59/softworkz/submit_logaddresses-v11:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-59/softworkz/submit_logaddresses-v11

Copy link

ffmpeg-codebot bot commented Jun 6, 2025

On the FFmpeg mailing list, Kieran Kunhya via ffmpeg-devel wrote (reply to this):

>
>
>       #define LIBAVUTIL_VERSION_MAJOR  60
>      --#define LIBAVUTIL_VERSION_MINOR   1
>      -+#define LIBAVUTIL_VERSION_MINOR   2
>      +-#define LIBAVUTIL_VERSION_MINOR   3
>      ++#define LIBAVUTIL_VERSION_MINOR   4
>        #define LIBAVUTIL_VERSION_MICRO


Are you seriously expecting people to be able to review diffs of diffs like
this?

Kieran
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Copy link

ffmpeg-codebot bot commented Jun 6, 2025

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



From: Kieran Kunhya <[email protected]>
Sent: Samstag, 7. Juni 2025 01:24
To: FFmpeg development discussions and patches <[email protected]>
Cc: softworkz <[email protected]>
Subject: Re: [FFmpeg-devel] [PATCH v11 0/3] avutil/log: Add log flag to control printing of memory addresses


      #define LIBAVUTIL_VERSION_MAJOR  60
     --#define LIBAVUTIL_VERSION_MINOR   1
     -+#define LIBAVUTIL_VERSION_MINOR   2
     +-#define LIBAVUTIL_VERSION_MINOR   3
     ++#define LIBAVUTIL_VERSION_MINOR   4
       #define LIBAVUTIL_VERSION_MICRO

Are you seriously expecting people to be able to review diffs of diffs like this?

Kieran




Hi Kieran,

this is just the „range diff” which shows the changes to the previous revision in the
cover-letter  [0/x] message.

The actual code is in the patch e-mails which are exactly the same like any others.

Thanks
sw
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant