[FFmpeg-devel] [PATCH v5 2/3] fftools/opt_common: add time and datetime log flags

Tobias Rapp t.rapp at noa-archive.com
Fri Feb 7 12:42:20 EET 2025


On 07/02/2025 08:57, softworkz wrote:

> From: softworkz <softworkz at hotmail.com>
>
> This commit adds two logging flags: 'time' and 'datetime'.
>
> Usage:
>
> ffmpeg -loglevel +time
>
> or
>
> ffmpeg -loglevel +datetime
>
> Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
> timing to be printed when exiting.
>
> Signed-off-by: softworkz <softworkz at hotmail.com>
> ---
>   fftools/ffmpeg.c     |  1 +
>   fftools/opt_common.c | 12 ++++++++++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index dc321fb4a2..f4c717afaa 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -130,6 +130,7 @@ static void term_exit_sigsafe(void)
>   
>   void term_exit(void)
>   {
> +    av_log_set_flags(0);
>       av_log(NULL, AV_LOG_QUIET, "%s", "");
>       term_exit_sigsafe();
>   }

If I understand the purpose of AV_LOG_QUIET correctly the correct way 
would be to skip writing time/datetime information in the log writer 
itself (part of patch #1 in this patch-set) if level is <= AV_LOG_QUIET, 
rather than clearing the flags here.

Regards,
Tobias



More information about the ffmpeg-devel mailing list