[FFmpeg-devel] [PATCH v10 3/3] doc/fftools-common-opts: document mem log flag

2025-04-09 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/fftools-common-opts.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index f6d452c40e..5d66af6b02 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -230,6 +230,8 @@ 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 mem
+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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v11 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame with the same PTS.

2025-04-09 Thread Romain Beauxis
Le mer. 9 avr. 2025 à 20:12, Michael Niedermayer
 a écrit :
>
> On Fri, Apr 04, 2025 at 04:14:44PM -0500, Romain Beauxis wrote:
> > ---
> >  libavcodec/decode.c | 130 
> >  1 file changed, 130 insertions(+)
> >
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index fca0c7ff58..39d054bdea 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> [...]
> > @@ -702,6 +809,8 @@ int attribute_align_arg 
> > avcodec_send_packet(AVCodecContext *avctx, const AVPacke
> >  {
> >  AVCodecInternal *avci = avctx->internal;
> >  DecodeContext *dc = decode_ctx(avci);
> > +const uint8_t *side_metadata;
> > +size_t size;
> >  int ret;
> >
> >  if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
> > @@ -719,6 +828,14 @@ int attribute_align_arg 
> > avcodec_send_packet(AVCodecContext *avctx, const AVPacke
> >  ret = av_packet_ref(avci->buffer_pkt, avpkt);
> >  if (ret < 0)
> >  return ret;
> > +
> > +side_metadata = av_packet_get_side_data(avpkt, 
> > AV_PKT_DATA_METADATA_UPDATE, &size);
>
>
> > +if (avpkt->pts != AV_NOPTS_VALUE && side_metadata) {
> > +ret = insert_pending_metadata(&dc->pending_metadata, 
> > avpkt->pts,
> > +  side_metadata, size);
> > +if (ret < 0)
> > +return ret;
>
> Is the tree needed and a FIFO not enough ?

I believe so.

There could be scenarios where the DTS are submitted out of order and
we'd still want the metadata to be attached to the frame it was
intended for.

In fact, I did this change after you suggested such a scenario:

>> Can you describe a scenario that you're thinking about?

> The users feeds several packets into a multi threaded decoder
> and then depending on the threads and luck sooner or later
> one frame comes out.
>
> Passing some data in a way that disregards this, feels wrong
> Hypothetically there also could be a 2nd AV_PKT_DATA_METADATA_UPDATE
> going in before the frame corresponding to the first comes out
> but i may be missing something

Source: https://ffmpeg.org/pipermail/ffmpeg-devel/2025-March/340948.html

> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Its not that you shouldnt use gotos but rather that you should write
> readable code and code with gotos often but not always is less readable
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libpostproc: remove big-endian AltiVec acceleration

2025-04-09 Thread Sean McGovern
Hi,

On Wed, Apr 9, 2025 at 2:55 PM Michael Niedermayer
 wrote:
>
> Hi Sean
>
> On Sun, Apr 06, 2025 at 12:42:30PM -0400, Sean McGovern wrote:
> > While POWER & PowerPC systems have technically
> > supported little-endian from inception,
> > it did not come into proper usage until the
> > introducion of the POWER8 in 2013.
> >
> > The AltiVec acceleration present here has not
> > had meaningful change since before then.
> >
> > refs: Trac/11120
> > ---
> >  libpostproc/postprocess.c  |   13 -
> >  libpostproc/postprocess.h  |1 -
> >  libpostproc/postprocess_altivec_template.c | 1211 
> >  libpostproc/postprocess_template.c |   31 -
> >  4 files changed, 1256 deletions(-)
> >  delete mode 100644 libpostproc/postprocess_altivec_template.c
>
> What exactly are you fixing here / what is the problem?
> You say the code hasnt been changed and you link to a ticket
> where people cant decide if they talk about big or little endian
> and that links to seemingly unrelated tickets
>
> Please clearly explain what the issue is and why this is
> the correct fix
>

We already discovered a few months back that we have no real
maintainers for these ppc pieces, so as noted in the ticket I am
working on removing them.
Is this what you want in the patch notes?

> Also you are changing public API without version bump
>

Oops, yeah OK I can do that.
Is a minor bump enough or should this be a major?

> [...]
> > index 5decb7e8a9..a88fd5a5cb 100644
> > --- a/libpostproc/postprocess.h
> > +++ b/libpostproc/postprocess.h
> > @@ -88,7 +88,6 @@ void pp_free_context(pp_context *ppContext);
> >  #define PP_CPU_CAPS_MMX   0x8000
> >  #define PP_CPU_CAPS_MMX2  0x2000
> >  #define PP_CPU_CAPS_3DNOW 0x4000
> > -#define PP_CPU_CAPS_ALTIVEC 0x1000
> >  #define PP_CPU_CAPS_AUTO  0x0008
> >
> >  #define PP_FORMAT 0x0008
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
> questions about the command line tools should be sent to the ffmpeg-user ML.
> And questions about how to use libav* should be sent to the libav-user ML.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

-- Sean McGovern
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] doc/encoders: Document compression_level for PNG

2025-04-09 Thread Michael Niedermayer
On Thu, Feb 06, 2025 at 02:47:41PM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  doc/encoders.texi | 7 +++
>  1 file changed, 7 insertions(+)

will apply patchset

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

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/avcodec: Remove always-false check

2025-04-09 Thread Andreas Rheinhardt
Patch attached.

- Andreas
From 3c24d5628ff39af7f6c6d8b9484e4fc0be791ab9 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Wed, 9 Apr 2025 14:47:35 +0200
Subject: [PATCH] avcodec/avcodec: Remove always-false check

avcodec_free_context() only calls ff_codec_close() if there
is an AVCodecContext and avcodec_open2() unconditionally
dereferences the AVCodecContext*.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index c7f75b3e89..7bcb0295e5 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -429,9 +429,6 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
 {
 int i;
 
-if (!avctx)
-return;
-
 if (avcodec_is_open(avctx)) {
 AVCodecInternal *avci = avctx->internal;
 
-- 
2.45.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2] avformat/fifo: Check for keyframe video type before stop dropping

2025-04-09 Thread Michael Niedermayer
On Sat, Apr 05, 2025 at 02:49:30PM -0300, Arthur Grillo wrote:
> The current behavior when using restart_with_keyframe is that it will
> recover if it also encounters any audio packet, as they are flagged as a
> keyframe.
> 
> The expectation is that packets are dropped until the next _video_
> keyframe.
> 
> To fix that, check if exists a video stream, if it exists check the
> packet stream codec type, only letting it recover when it is a video
> one. If there is no video stream, resume to the original behavior, not
> checking the codec type.
> 
> Fixes ticket: #11467
> 
> Signed-off-by: Arthur Grillo 
> ---
> Changes in v2:
> - Check for the presence of a video stream (Michael Niedermayer)
> - Link to v1: 
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20250312-video-only-kf-recover-v1-1-1e0e340da...@riseup.net

[...]

>  } FifoThreadContext;
>  
>  typedef enum FifoMessageType {
> @@ -185,14 +188,26 @@ static int fifo_thread_write_packet(FifoThreadContext 
> *ctx, AVPacket *pkt)
>  AVRational src_tb, dst_tb;
>  int ret, s_idx;
>  int64_t orig_pts, orig_dts, orig_duration;
> +enum AVMediaType stream_codec_type = 
> avf->streams[pkt->stream_index]->codecpar->codec_type;
>  
>  if (fifo->timeshift && pkt->dts != AV_NOPTS_VALUE)
>  atomic_fetch_sub_explicit(&fifo->queue_duration, next_duration(avf, 
> pkt, &ctx->last_received_dts), memory_order_relaxed);
>  
>  if (ctx->drop_until_keyframe) {
>  if (pkt->flags & AV_PKT_FLAG_KEY) {
> -ctx->drop_until_keyframe = 0;
> -av_log(avf, AV_LOG_VERBOSE, "Keyframe received, 
> recovering...\n");
> +if (!ctx->has_video_stream) {
> +ctx->drop_until_keyframe = 0;
> +av_log(avf, AV_LOG_VERBOSE, "Keyframe received, 
> recovering...\n");
> +} else {

> +if (stream_codec_type == AVMEDIA_TYPE_VIDEO) {
> +ctx->drop_until_keyframe = 0;
> +av_log(avf, AV_LOG_VERBOSE, "Video keyframe received, 
> recovering...\n");
> +} else {

The indention here is broken

thx

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v10 0/3] avutil/log: Add log flag to control printing of memory addresses

2025-04-09 Thread ffmpegagent
--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 @ 018e72a89cc0] nal_unit_type:
[hevc @ 018e72a89cc0] Decoding PPS
[hevc @ 018e72a89cc0] nal_unit_type: 39(SEI_P.. [hevc @
018e72a89cc0] Decoding SEI
[mp4 @ 018e72a8e240] All [mp4 @ 018e72a8e240] Afte [hevc @
018e742f6b40] Decoded frame with POC .. detected 16 logical cores
[Parsed_scale_0 @ 018e74382f40] Setting 'w' t.. [Parsed_scale_0 @
018e74382f40] Setting 'h' t.. [Parsed_scale_1 @ 018e74382440]
Setting 'w' t.. [mjpeg @ 018e743210c0] Forcing thread count t.. [mjpeg @
018e743210c0] 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)

softworkz (3):
  avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES
  fftools: add mem log flag and disable printing addresses by default
  doc/fftools-common-opts: document mem 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 | 7 +++
 libavutil/log.c  | 6 --
 libavutil/log.h  | 5 +
 libavutil/version.h  | 2 +-
 9 files changed, 25 insertions(+), 6 deletions(-)


base-commit: 02eda84bf2fcf0db7793872204b0f564a6557232
Published-As: 
https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-59%2Fsoftworkz%2Fsubmit_logaddresses-v10
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-59/softworkz/submit_logaddresses-v10
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/59

Range-diff vs v9:

 1:  0ce5bd11d7 = 1:  0ce5bd11d7 avutil/log: Add log flag 
AV_LOG_PRINT_MEMADDRESSES
 2:  0780dd080c ! 2:  207dedbff6 fftools: add mem log flag and disable printing 
addresses by default
 @@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, 
const char
   } else {
   break;
   }
 +@@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, 
const char *arg)
 + av_log(NULL, AV_LOG_FATAL, "\"level\"\n");
 + av_log(NULL, AV_LOG_FATAL, "\"time\"\n");
 + av_log(NULL, AV_LOG_FATAL, "\"datetime\"\n");
 ++av_log(NULL, AV_LOG_FATAL, "\"mem\"\n");
 + return AVERROR(EINVAL);
 + }
 + 
 3:  bfe2e51860 = 3:  dc334f3eeb doc/fftools-common-opts: document mem log flag

-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v10 2/3] fftools: add mem log flag and disable printing addresses by default

2025-04-09 Thread softworkz
From: softworkz 

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 @ 018e72a89cc0] .

without (new behavior):

[hevc] .

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c | 2 +-
 fftools/ffplay.c | 2 +-
 fftools/ffprobe.c| 2 +-
 fftools/opt_common.c | 7 +++
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..72887d6c5e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -954,7 +954,7 @@ 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
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 2a572fc3aa..9bd1fc2f22 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3761,7 +3761,7 @@ 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 */
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index abbd1dcf36..106435b827 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4672,7 +4672,7 @@ 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);
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 2ac3fd4fb3..570842b816 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_DATETIME;
 }
+} else if (av_strstart(token, "mem", &arg)) {
+if (cmd == '-') {
+flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+} else {
+flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+}
 } else {
 break;
 }
@@ -1335,6 +1341,7 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 av_log(NULL, AV_LOG_FATAL, "\"level\"\n");
 av_log(NULL, AV_LOG_FATAL, "\"time\"\n");
 av_log(NULL, AV_LOG_FATAL, "\"datetime\"\n");
+av_log(NULL, AV_LOG_FATAL, "\"mem\"\n");
 return AVERROR(EINVAL);
 }
 
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] ffmpeg.git test compile fail

2025-04-09 Thread Andrew Randrianasulu
ffmpeg shallow git copy

commit 890b8da1ce27fd365eaffefc7efcbadae9f01f2a

our patches 2 and 8 fail, but this is not really my point yet 


ffmpeg.C:313:42: error: 'avcodec_close' was not declared in this scope; did
you mean 'avio_close'?
ffmpeg.C:476:33: error: 'avcodec_close' was not declared in this scope; did
you mean 'avio_close'?
ffmpeg.C:1307:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1309:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1309:66: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:1311:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1311:67: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:1340:36: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'key_frame'
ffmpeg.C:1512:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1513:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:3847:29: error: 'av_stream_get_side_data' was not declared in this
scope; did you mean 'av_frame_get_side_data'?

mplayer switched for now to branch 7.1 until it get updates.

i see in doc/APIchanges


2023-05-04 - 0fc9c1f6828 - lavu 58.7.100 - frame.h
 Deprecate AVFrame.interlaced_frame,
AVFrame.top_field_first, and
  AVFrame.key_frame.
  Add AV_FRAME_FLAG_INTERLACED, AV_FRAME_FLAG_TOP_FIELD_FIRST, and
  AV_FRAME_FLAG_KEY flags as replacement.

but not sure how to use them yet.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libpostproc: remove big-endian AltiVec acceleration

2025-04-09 Thread Sean McGovern
On Sun, Apr 6, 2025, 12:42 Sean McGovern  wrote:

> While POWER & PowerPC systems have technically
> supported little-endian from inception,
> it did not come into proper usage until the
> introducion of the POWER8 in 2013.
>
> The AltiVec acceleration present here has not
> had meaningful change since before then.
>
> refs: Trac/11120
> ---
>  libpostproc/postprocess.c  |   13 -
>  libpostproc/postprocess.h  |1 -
>  libpostproc/postprocess_altivec_template.c | 1211 
>  libpostproc/postprocess_template.c |   31 -
>  4 files changed, 1256 deletions(-)
>  delete mode 100644 libpostproc/postprocess_altivec_template.c
>
> diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
> index 0223bab548..b28e172895 100644
> --- a/libpostproc/postprocess.c
> +++ b/libpostproc/postprocess.c
> @@ -495,14 +495,6 @@ static av_always_inline void do_a_deblock_C(uint8_t
> *src, int step,
>  #define TEMPLATE_PP_C 1
>  #include "postprocess_template.c"
>
> -#if HAVE_ALTIVEC
> -#include "libavutil/ppc/util_altivec.h"
> -
> -#   define TEMPLATE_PP_ALTIVEC 1
> -#   include "postprocess_altivec_template.c"
> -#   include "postprocess_template.c"
> -#endif
> -
>  #if ARCH_X86 && HAVE_INLINE_ASM
>  #if CONFIG_RUNTIME_CPUDETECT
>  #define TEMPLATE_PP_SSE2 1
> @@ -531,14 +523,10 @@ static inline void postProcess(const uint8_t src[],
> int srcStride, uint8_t dst[]
>  #if ARCH_X86 && HAVE_INLINE_ASM
>  // ordered per speed fastest first
>  if  (c->cpuCaps & AV_CPU_FLAG_SSE2) pp = postProcess_SSE2;
> -#elif HAVE_ALTIVEC
> -if  (c->cpuCaps & AV_CPU_FLAG_ALTIVEC)  pp =
> postProcess_altivec;
>  #endif
>  #else /* CONFIG_RUNTIME_CPUDETECT */
>  #if HAVE_SSE2_INLINE
>  pp = postProcess_SSE2;
> -#elif HAVE_ALTIVEC
> -pp = postProcess_altivec;
>  #endif
>  #endif /* !CONFIG_RUNTIME_CPUDETECT */
>  }
> @@ -850,7 +838,6 @@ av_cold pp_context *pp_get_context(int width, int
> height, int cpuCaps){
>  c->cpuCaps = av_get_cpu_flags();
>  } else {
>  c->cpuCaps = 0;
> -if (cpuCaps & PP_CPU_CAPS_ALTIVEC)  c->cpuCaps |=
> AV_CPU_FLAG_ALTIVEC;
>  }
>
>  reallocBuffers(c, width, height, stride, qpStride);
> diff --git a/libpostproc/postprocess.h b/libpostproc/postprocess.h
> index 5decb7e8a9..a88fd5a5cb 100644
> --- a/libpostproc/postprocess.h
> +++ b/libpostproc/postprocess.h
> @@ -88,7 +88,6 @@ void pp_free_context(pp_context *ppContext);
>  #define PP_CPU_CAPS_MMX   0x8000
>  #define PP_CPU_CAPS_MMX2  0x2000
>  #define PP_CPU_CAPS_3DNOW 0x4000
> -#define PP_CPU_CAPS_ALTIVEC 0x1000
>  #define PP_CPU_CAPS_AUTO  0x0008
>
>  #define PP_FORMAT 0x0008
> diff --git a/libpostproc/postprocess_altivec_template.c
> b/libpostproc/postprocess_altivec_template.c
> deleted file mode 100644
> index 827d6300e5..00
> --- a/libpostproc/postprocess_altivec_template.c
> +++ /dev/null
> @@ -1,1211 +0,0 @@
> -/*
> - * AltiVec optimizations (C) 2004 Romain Dolbeau 
> - *
> - * based on code by Copyright (C) 2001-2003 Michael Niedermayer (
> michae...@gmx.at)
> - *
> - * This file is part of FFmpeg.
> - *
> - * FFmpeg is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * FFmpeg is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with FFmpeg; if not, write to the Free Software
> - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> - */
> -
> -#include "libavutil/avutil.h"
> -#include "libavutil/mem_internal.h"
> -
> -#define
> ALTIVEC_TRANSPOSE_8x8_SHORT(src_a,src_b,src_c,src_d,src_e,src_f,src_g,src_h)
> \
> -do {  \
> -__typeof__(src_a) tempA1, tempB1, tempC1, tempD1; \
> -__typeof__(src_a) tempE1, tempF1, tempG1, tempH1; \
> -__typeof__(src_a) tempA2, tempB2, tempC2, tempD2; \
> -__typeof__(src_a) tempE2, tempF2, tempG2, tempH2; \
> -tempA1 = vec_mergeh (src_a, src_e);   \
> -tempB1 = vec_mergel (src_a, src_e);   \
> -tempC1 = vec_mergeh (src_b, src_f);   \
> -tempD1 = vec_mergel (src_b, src_f);   \
> -tempE1 = vec_mergeh (src_c, src_g);   \
> -tempF1 = vec_mergel (src_c, src_g);   \
> -tempG1 = vec_mergeh (src_d, src_h);   \
> -temp

[FFmpeg-devel] [PATCH v9 0/3] avutil/log: Add log flag to control printing of memory addresses

2025-04-09 Thread ffmpegagent
--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 @ 018e72a89cc0] nal_unit_type:
[hevc @ 018e72a89cc0] Decoding PPS
[hevc @ 018e72a89cc0] nal_unit_type: 39(SEI_P.. [hevc @
018e72a89cc0] Decoding SEI
[mp4 @ 018e72a8e240] All [mp4 @ 018e72a8e240] Afte [hevc @
018e742f6b40] Decoded frame with POC .. detected 16 logical cores
[Parsed_scale_0 @ 018e74382f40] Setting 'w' t.. [Parsed_scale_0 @
018e74382f40] Setting 'h' t.. [Parsed_scale_1 @ 018e74382440]
Setting 'w' t.. [mjpeg @ 018e743210c0] Forcing thread count t.. [mjpeg @
018e743210c0] 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)

softworkz (3):
  avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES
  fftools: add mem log flag and disable printing addresses by default
  doc/fftools-common-opts: document mem 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-v9
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-59/softworkz/submit_logaddresses-v9
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/59

Range-diff vs v8:

 1:  0ce5bd11d7 = 1:  0ce5bd11d7 avutil/log: Add log flag 
AV_LOG_PRINT_MEMADDRESSES
 2:  527cf5fa56 ! 2:  0780dd080c fftools: add memaddress log flag and disable 
printing addresses by default
 @@ Metadata
  Author: softworkz 
  
   ## Commit message ##
 -fftools: add memaddress log flag and disable printing addresses by 
default
 +fftools: add mem log flag and disable printing addresses by default
  
 -This commit adds the memaddress log flag.
 +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 memaddresses flag:
 +Example with mem flag:
  
  [hevc @ 018e72a89cc0] .
  
 @@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, 
const char
   } else {
   flags |= AV_LOG_PRINT_DATETIME;
   }
 -+} else if (av_strstart(token, "memaddress", &arg)) {
 ++} else if (av_strstart(token, "mem", &arg)) {
  +if (cmd == '-') {
  +flags |= AV_LOG_NO_PRINT_MEMADDRESS;
  +} else {
 3:  22c51897c1 ! 3:  bfe2e51860 doc/fftools-common-opts: document memaddress 
log flag
 @@ Metadata
  Author: softworkz 
  
   ## Commit message ##
 -doc/fftools-common-opts: document memaddress log flag
 +doc/fftools-common-opts: document mem log flag
  
  Signed-off-by: softworkz 
  
 @@ 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 memaddress
 ++@item mem
  +Indicates that context prefixes should be printed with memory address.

[FFmpeg-devel] [PATCH v9 2/3] fftools: add mem log flag and disable printing addresses by default

2025-04-09 Thread softworkz
From: softworkz 

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 @ 018e72a89cc0] .

without (new behavior):

[hevc] .

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c | 2 +-
 fftools/ffplay.c | 2 +-
 fftools/ffprobe.c| 2 +-
 fftools/opt_common.c | 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..72887d6c5e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -954,7 +954,7 @@ 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
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 2a572fc3aa..9bd1fc2f22 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3761,7 +3761,7 @@ 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 */
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index abbd1dcf36..106435b827 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4672,7 +4672,7 @@ 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);
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 2ac3fd4fb3..edf2f49d0b 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_DATETIME;
 }
+} else if (av_strstart(token, "mem", &arg)) {
+if (cmd == '-') {
+flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+} else {
+flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+}
 } else {
 break;
 }
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v9 3/3] doc/fftools-common-opts: document mem log flag

2025-04-09 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/fftools-common-opts.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index f6d452c40e..5d66af6b02 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -230,6 +230,8 @@ 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 mem
+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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] avcodec/ffv1enc: permit 1024 slices

2025-04-09 Thread Michael Niedermayer
Hi Jerome

On Tue, Apr 08, 2025 at 10:54:47PM +0200, Jerome Martinez wrote:
> The FFV1 decoder accepts 1024 slices but the encoder does not currently
> permit it.
> Let's permit 32x32 (which is the GPU encoder setting, by the way).

>  ffv1enc.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 25b58274f84a54ba238a8bcc7391b2517eebb131  
> 0001-avcodec-ffv1enc-permit-1024-slices.patch
> From 216f14a7bf0c4f71b7c8e15c7f2d91088818a20d Mon Sep 17 00:00:00 2001
> From: Jerome Martinez 
> Date: Tue, 8 Apr 2025 22:07:47 +0200
> Subject: [PATCH] avcodec/ffv1enc: permit 1024 slices
> 
> ---
>  libavcodec/ffv1enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v9 2/3] fftools: add mem log flag and disable printing addresses by default

2025-04-09 Thread softworkz .


> -Original Message-
> From: ffmpeg-devel  On Behalf Of Gyan
> Doshi
> Sent: Mittwoch, 9. April 2025 20:27
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v9 2/3] fftools: add mem log flag and
> disable printing addresses by default
> 
> 
> 
> On 2025-04-09 11:49 pm, softworkz wrote:
> > diff --git a/fftools/opt_common.c b/fftools/opt_common.c
> > index 2ac3fd4fb3..edf2f49d0b 100644
> > --- a/fftools/opt_common.c
> > +++ b/fftools/opt_common.c
> > @@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt,
> const char *arg)
> >   } else {
> >   flags |= AV_LOG_PRINT_DATETIME;
> >   }
> > +} else if (av_strstart(token, "mem", &arg)) {
> > +if (cmd == '-') {
> > +flags |= AV_LOG_NO_PRINT_MEMADDRESS;
> > +} else {
> > +flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
> > +}
> >   } else {
> >   break;
> >   }
> 
> You also need to update the block just before the end jump.
> 
> Regards,
> Gyan
> 
> ___

Oh, that's embarrassing - thanks 😊

sw
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libpostproc: remove big-endian AltiVec acceleration

2025-04-09 Thread Michael Niedermayer
Hi Sean

On Sun, Apr 06, 2025 at 12:42:30PM -0400, Sean McGovern wrote:
> While POWER & PowerPC systems have technically
> supported little-endian from inception,
> it did not come into proper usage until the
> introducion of the POWER8 in 2013.
> 
> The AltiVec acceleration present here has not
> had meaningful change since before then.
> 
> refs: Trac/11120
> ---
>  libpostproc/postprocess.c  |   13 -
>  libpostproc/postprocess.h  |1 -
>  libpostproc/postprocess_altivec_template.c | 1211 
>  libpostproc/postprocess_template.c |   31 -
>  4 files changed, 1256 deletions(-)
>  delete mode 100644 libpostproc/postprocess_altivec_template.c

What exactly are you fixing here / what is the problem?
You say the code hasnt been changed and you link to a ticket
where people cant decide if they talk about big or little endian
and that links to seemingly unrelated tickets

Please clearly explain what the issue is and why this is
the correct fix

Also you are changing public API without version bump

[...]
> index 5decb7e8a9..a88fd5a5cb 100644
> --- a/libpostproc/postprocess.h
> +++ b/libpostproc/postprocess.h
> @@ -88,7 +88,6 @@ void pp_free_context(pp_context *ppContext);
>  #define PP_CPU_CAPS_MMX   0x8000
>  #define PP_CPU_CAPS_MMX2  0x2000
>  #define PP_CPU_CAPS_3DNOW 0x4000
> -#define PP_CPU_CAPS_ALTIVEC 0x1000
>  #define PP_CPU_CAPS_AUTO  0x0008
>  
>  #define PP_FORMAT 0x0008

thx

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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v11 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame with the same PTS.

2025-04-09 Thread Michael Niedermayer
On Fri, Apr 04, 2025 at 04:14:44PM -0500, Romain Beauxis wrote:
> ---
>  libavcodec/decode.c | 130 
>  1 file changed, 130 insertions(+)
> 
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index fca0c7ff58..39d054bdea 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
[...]
> @@ -702,6 +809,8 @@ int attribute_align_arg 
> avcodec_send_packet(AVCodecContext *avctx, const AVPacke
>  {
>  AVCodecInternal *avci = avctx->internal;
>  DecodeContext *dc = decode_ctx(avci);
> +const uint8_t *side_metadata;
> +size_t size;
>  int ret;
>  
>  if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
> @@ -719,6 +828,14 @@ int attribute_align_arg 
> avcodec_send_packet(AVCodecContext *avctx, const AVPacke
>  ret = av_packet_ref(avci->buffer_pkt, avpkt);
>  if (ret < 0)
>  return ret;
> +
> +side_metadata = av_packet_get_side_data(avpkt, 
> AV_PKT_DATA_METADATA_UPDATE, &size);


> +if (avpkt->pts != AV_NOPTS_VALUE && side_metadata) {
> +ret = insert_pending_metadata(&dc->pending_metadata, avpkt->pts,
> +  side_metadata, size);
> +if (ret < 0)
> +return ret;

Is the tree needed and a FIFO not enough ?


thx

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [REFUND-REQUEST] Ryzen 9 CPU + Mainboard + RAM

2025-04-09 Thread Niklas Haas
Hi all,

I ordered the parts as discussed and approved in the previous thread:
https://ffmpeg.org//pipermail/ffmpeg-devel/2025-April/341873.html

The total cost was 1381.28 EUR.

Thanks,
Niklas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avformat/dashdec: just make seg->url in absolute path once

2025-04-09 Thread Jack Lau via ffmpeg-devel
Should fix ticket 11543

if input url is relative path, the seg-url would make absolute url twice in 
get_content_url and open_input function

but it doesn't need make absolute url in open_input since we set it already

Signed-off-by: Jack Lau 
---
 libavformat/dashdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index c3f3d7f3f8..2915f6eb82 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1700,7 +1700,7 @@ static int open_input(DASHContext *c, struct 
representation *pls, struct fragmen
 av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0);
 }
 
-ff_make_absolute_url(url, c->max_url_size, c->base_url, seg->url);
+ff_make_absolute_url(url, c->max_url_size, "", seg->url);
 av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset 
%"PRId64"\n",
url, seg->url_offset);
 ret = open_url(pls->parent, &pls->input, url, &c->avio_opts, opts, NULL);
-- 
2.49.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v8 2/3] fftools: add memaddress log flag and disable printing addresses by default

2025-04-09 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Gyan
> Doshi
> Sent: Mittwoch, 9. April 2025 16:28
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v8 2/3] fftools: add memaddress log
> flag and disable printing addresses by default
> 
> 
> 
> On 2025-04-09 02:55 pm, softworkz wrote:
> > From: softworkz 
> >
> > 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.
> >
> > Example with memaddresses flag:
> >
> > [hevc @ 018e72a89cc0] .
> >
> > without (new behavior):
> >
> > [hevc] .
> >
> > Signed-off-by: softworkz 
> > ---
> >   fftools/ffmpeg.c | 2 +-
> >   fftools/ffplay.c | 2 +-
> >   fftools/ffprobe.c| 2 +-
> >   fftools/opt_common.c | 6 ++
> >   4 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> > index dc321fb4a2..72887d6c5e 100644
> > --- a/fftools/ffmpeg.c
> > +++ b/fftools/ffmpeg.c
> > @@ -954,7 +954,7 @@ 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
> > diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> > index 2a572fc3aa..9bd1fc2f22 100644
> > --- a/fftools/ffplay.c
> > +++ b/fftools/ffplay.c
> > @@ -3761,7 +3761,7 @@ 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 */
> > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> > index abbd1dcf36..106435b827 100644
> > --- a/fftools/ffprobe.c
> > +++ b/fftools/ffprobe.c
> > @@ -4672,7 +4672,7 @@ 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);
> > diff --git a/fftools/opt_common.c b/fftools/opt_common.c
> > index 2ac3fd4fb3..73a591acd8 100644
> > --- a/fftools/opt_common.c
> > +++ b/fftools/opt_common.c
> > @@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt,
> const char *arg)
> >   } else {
> >   flags |= AV_LOG_PRINT_DATETIME;
> >   }
> > +} else if (av_strstart(token, "memaddress", &arg)) {
> 
> Too verbose a label. How about just 'mem'?
> 
> Regards,
> Gyan


Hi Gyan,

I'm fine with that, will update!

Thank you
sw



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v9 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread softworkz
From: softworkz 

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 
---
 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 - xx - 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, \
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v11 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams.

2025-04-09 Thread Romain Beauxis
Hi all,


Le ven. 4 avr. 2025 à 16:14, Romain Beauxis  a écrit :
>
> This is a series of patches to allow proper decoding of ogg metadata in 
> chained
> `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
>
> ## Changes since last version:
> * Fixed indentation and spaces.

Any update on this?

It would be nice if this could be looked at before it starts conflicting again.

Samples are here:
https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0

Thanks!
-- Romain

> Romain Beauxis (8):
>   libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet
> extra data, attach them to the next decoded frame with the same PTS.
>   tests: Add stream dump test API util.
>   tests: Add chained ogg/vorbis stream dump test.
>   libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis
> metadata update mechanism.
>   libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg
> packets, add them to ogg stream new_metadata.
>   tests: Add chained ogg/flac stream dump test.
>   libavformat/oggparseopus.c: Parse comments from secondary chained
> streams header packet.
>   tests: Add chained ogg/opus stream dump test.
>
>  libavcodec/decode.c| 130 +++
>  libavformat/oggdec.h   |  14 ++
>  libavformat/oggparseflac.c |  21 +++
>  libavformat/oggparseopus.c |  13 +-
>  libavformat/oggparsevorbis.c   |  25 ++-
>  tests/Makefile |   4 +
>  tests/api/Makefile |   2 +-
>  tests/api/api-dump-stream-meta-test.c  | 177 +
>  tests/fate/ogg-flac.mak|  11 ++
>  tests/fate/ogg-opus.mak|  11 ++
>  tests/fate/ogg-vorbis.mak  |  11 ++
>  tests/ref/fate/ogg-flac-chained-meta.txt   |  13 ++
>  tests/ref/fate/ogg-opus-chained-meta.txt   |  27 
>  tests/ref/fate/ogg-vorbis-chained-meta.txt |  17 ++
>  14 files changed, 466 insertions(+), 10 deletions(-)
>  create mode 100644 tests/api/api-dump-stream-meta-test.c
>  create mode 100644 tests/fate/ogg-flac.mak
>  create mode 100644 tests/fate/ogg-opus.mak
>  create mode 100644 tests/fate/ogg-vorbis.mak
>  create mode 100644 tests/ref/fate/ogg-flac-chained-meta.txt
>  create mode 100644 tests/ref/fate/ogg-opus-chained-meta.txt
>  create mode 100644 tests/ref/fate/ogg-vorbis-chained-meta.txt
>
> --
> 2.39.5 (Apple Git-154)
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] ffmpeg.git test compile fail

2025-04-09 Thread Andrew Randrianasulu
I think exact conditionals should be more like 61.0.100

but for single test it worked ...


for some reason our x264 failed to encode (segfault) on i686 with AVX ?

but x265 worked 

this is not yet for commiting, but more like for testing with ffmpeg git.

cc: ffmpeg-devel in case they have better suggestions on fixing our code
for upcoming ffmpeg.


cingg git URL: git://git.cinelerra-gg.org/goodguy/cinelerra

run ./autogen.sh

configure:
./configure --with-git-ffmpeg=https://git.ffmpeg.org/ffmpeg.git
--with-single-user

rm thirdparty/src/ffmpeg.git.patch2
rm thirdparty/src/ffmpeg.git.patch8

make
make install

run from build directory

bin/cin (with DISPLAY variable set)




ср, 9 апр. 2025 г., 14:49 Andrew Randrianasulu :

>
> ffmpeg shallow git copy
>
> commit 890b8da1ce27fd365eaffefc7efcbadae9f01f2a
>
> our patches 2 and 8 fail, but this is not really my point yet 
>
>
> ffmpeg.C:313:42: error: 'avcodec_close' was not declared in this scope;
> did you mean 'avio_close'?
> ffmpeg.C:476:33: error: 'avcodec_close' was not declared in this scope;
> did you mean 'avio_close'?
> ffmpeg.C:1307:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'interlaced_frame'
> ffmpeg.C:1309:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'interlaced_frame'
> ffmpeg.C:1309:66: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'top_field_first'
> ffmpeg.C:1311:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'interlaced_frame'
> ffmpeg.C:1311:67: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'top_field_first'
> ffmpeg.C:1340:36: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'key_frame'
> ffmpeg.C:1512:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'interlaced_frame'
> ffmpeg.C:1513:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
> named 'top_field_first'
> ffmpeg.C:3847:29: error: 'av_stream_get_side_data' was not declared in
> this scope; did you mean 'av_frame_get_side_data'?
>
> mplayer switched for now to branch 7.1 until it get updates.
>
> i see in doc/APIchanges
>
>
> 2023-05-04 - 0fc9c1f6828 - lavu 58.7.100 - frame.h
>Deprecate AVFrame.interlaced_frame,
> AVFrame.top_field_first, and
>   AVFrame.key_frame.
>   Add AV_FRAME_FLAG_INTERLACED, AV_FRAME_FLAG_TOP_FIELD_FIRST, and
>   AV_FRAME_FLAG_KEY flags as replacement.
>
> but not sure how to use them yet.
>
diff --git a/cinelerra-5.1/cinelerra/bdwrite.C 
b/cinelerra-5.1/cinelerra/bdwrite.C
index 1f7f027e..1b027a7f 100644
--- a/cinelerra-5.1/cinelerra/bdwrite.C
+++ b/cinelerra-5.1/cinelerra/bdwrite.C
@@ -2586,7 +2586,11 @@ static int field_probe(AVFormatContext *fmt_ctx, 
AVStream *st)
 }
 ret = avcodec_receive_frame(ctx, ipic);
 if( ret >= 0 ) {
+#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(59,16,100)
   ilaced = ipic->interlaced_frame ? 1 : 0;
+#else
+ilaced = ipic->flags & AV_FRAME_FLAG_INTERLACED  ? 1 : 0;
+#endif
   break;
 }
 if( ret != AVERROR(EAGAIN) )
@@ -2769,7 +2773,9 @@ int media_info::scan()
 ret = scan(fmt_ctx);
 
   for( int i=0; i<(int)streams.size(); ++i )
+#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(59,16,100)
 avcodec_close(streams[i]->ctx);
+#endif
   avformat_close_input(&fmt_ctx);
 
   return ret;
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 075ef4dd..8aee2c2a 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -310,7 +310,9 @@ FFStream::FFStream(FFMPEG *ffmpeg, AVStream *st, int fidx)
 FFStream::~FFStream()
 {
frm_lock->lock("FFStream::~FFStream");
+#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(59,16,100)
if( reading > 0 || writing > 0 ) avcodec_close(avctx);
+#endif 
if( avctx ) avcodec_free_context(&avctx);
if( fmt_ctx ) avformat_close_input(&fmt_ctx);
if( hw_device_ctx ) av_buffer_unref(&hw_device_ctx);
@@ -473,7 +475,9 @@ int FFStream::decode_activate()
if( ret < 0 && hw_type != AV_HWDEVICE_TYPE_NONE ) {
ff_err(ret, "HW device init failed, using SW 
decode.\nfile:%s\n",
ffmpeg->fmt_ctx->url);
+#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(59,16,100)
avcodec_close(avctx);
+#endif
avcodec_free_context(&avctx);
av_buffer_unref(&hw_device_ctx);
hw_device_ctx = 0;
@@ -1303,7 +1307,7 @@ int FFVideoStream::probe(int64_t pos)
if( ret > 0 ) {
//printf("codec interlace: %i 
\n",frame->interlaced_frame);
//printf("codec tff: %i \n",frame->top_field_first);
-
+#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(59,16,100)
if (!frame->interlaced_frame)
ffmpeg->interlace_from_codec = 
AV_FIELD_PROGRESSIVE;
  

Re: [FFmpeg-devel] [PATCH v8 2/3] fftools: add memaddress log flag and disable printing addresses by default

2025-04-09 Thread Gyan Doshi




On 2025-04-09 02:55 pm, softworkz wrote:

From: softworkz 

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.

Example with memaddresses flag:

[hevc @ 018e72a89cc0] .

without (new behavior):

[hevc] .

Signed-off-by: softworkz 
---
  fftools/ffmpeg.c | 2 +-
  fftools/ffplay.c | 2 +-
  fftools/ffprobe.c| 2 +-
  fftools/opt_common.c | 6 ++
  4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..72887d6c5e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -954,7 +954,7 @@ 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

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 2a572fc3aa..9bd1fc2f22 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3761,7 +3761,7 @@ 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 */

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index abbd1dcf36..106435b827 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4672,7 +4672,7 @@ 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);
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 2ac3fd4fb3..73a591acd8 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
  } else {
  flags |= AV_LOG_PRINT_DATETIME;
  }
+} else if (av_strstart(token, "memaddress", &arg)) {


Too verbose a label. How about just 'mem'?

Regards,
Gyan




+if (cmd == '-') {
+flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+} else {
+flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+}
  } else {
  break;
  }


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v10 1/4] fftools/textformat: Extract and generalize textformat api from ffprobe.c

2025-04-09 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.c  | 672 +
 fftools/textformat/avtextformat.h  | 171 
 fftools/textformat/avtextwriters.h |  68 +++
 fftools/textformat/tf_compact.c| 282 
 fftools/textformat/tf_default.c| 145 +++
 fftools/textformat/tf_flat.c   | 174 
 fftools/textformat/tf_ini.c| 160 +++
 fftools/textformat/tf_json.c   | 215 +
 fftools/textformat/tf_xml.c| 221 ++
 fftools/textformat/tw_avio.c   | 129 ++
 fftools/textformat/tw_buffer.c |  92 
 fftools/textformat/tw_stdout.c |  82 
 12 files changed, 2411 insertions(+)
 create mode 100644 fftools/textformat/avtextformat.c
 create mode 100644 fftools/textformat/avtextformat.h
 create mode 100644 fftools/textformat/avtextwriters.h
 create mode 100644 fftools/textformat/tf_compact.c
 create mode 100644 fftools/textformat/tf_default.c
 create mode 100644 fftools/textformat/tf_flat.c
 create mode 100644 fftools/textformat/tf_ini.c
 create mode 100644 fftools/textformat/tf_json.c
 create mode 100644 fftools/textformat/tf_xml.c
 create mode 100644 fftools/textformat/tw_avio.c
 create mode 100644 fftools/textformat/tw_buffer.c
 create mode 100644 fftools/textformat/tw_stdout.c

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
new file mode 100644
index 00..6c09f9d2cd
--- /dev/null
+++ b/fftools/textformat/avtextformat.c
@@ -0,0 +1,672 @@
+/*
+ * Copyright (c) The FFmpeg developers
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "libavutil/mem.h"
+#include "libavutil/avassert.h"
+#include "libavutil/bprint.h"
+#include "libavutil/error.h"
+#include "libavutil/hash.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/macros.h"
+#include "libavutil/opt.h"
+#include "avtextformat.h"
+
+#define SECTION_ID_NONE -1
+
+#define SHOW_OPTIONAL_FIELDS_AUTO   -1
+#define SHOW_OPTIONAL_FIELDS_NEVER   0
+#define SHOW_OPTIONAL_FIELDS_ALWAYS  1
+
+static const struct {
+double bin_val;
+double dec_val;
+const char *bin_str;
+const char *dec_str;
+} si_prefixes[] = {
+{ 1.0, 1.0, "", "" },
+{ 1.024e3, 1e3, "Ki", "K" },
+{ 1.048576e6, 1e6, "Mi", "M" },
+{ 1.073741824e9, 1e9, "Gi", "G" },
+{ 1.099511627776e12, 1e12, "Ti", "T" },
+{ 1.125899906842624e15, 1e15, "Pi", "P" },
+};
+
+static const char *textcontext_get_formatter_name(void *p)
+{
+AVTextFormatContext *tctx = p;
+return tctx->formatter->name;
+}
+
+#define OFFSET(x) offsetof(AVTextFormatContext, x)
+
+static const AVOption textcontext_options[] = {
+{ "string_validation", "set string validation mode",
+  OFFSET(string_validation), AV_OPT_TYPE_INT, 
{.i64=AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB-1, .unit = "sv" },
+{ "sv", "set string validation mode",
+  OFFSET(string_validation), AV_OPT_TYPE_INT, 
{.i64=AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB-1, .unit = "sv" },
+{ "ignore",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_IGNORE},  .unit = "sv" },
+{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, .unit = "sv" },
+{ "fail",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_FAIL},.unit = "sv" },
+{ "string_validation_replacement", "set string validation replacement 
string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
+{ "svr", "set string validation replacement string", 
OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, 
{.str="\xEF\xBF\xBD"}},
+{ NULL }
+};
+
+static void *textcontext_child_next(void *obj, void *prev)
+{
+AVTextFormatContext *ctx = obj;
+if (!prev && ctx->formatter && ctx->formatter->priv_class && ctx->priv)
+return ctx->priv;
+return NULL;
+}
+
+static const AVClass textcontext_class = {
+.class_name = "AVTextContext",
+.item_name  = textcontext_get_formatter_name,
+.option = textcontext_options,
+.version= LIBAVUTIL_VERSION_INT,
+   

[FFmpeg-devel] [PATCH v10 0/4] print_graphs: Complete Filtergraph Printing

2025-04-09 Thread ffmpegagent
Due to the additional work on graph visualization (see
https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2025-March/341296.html), I
have removed the two graph printing commits from this patchset rather than
adding to it, as to avoid wasting the effort already spent on reviewing.

So, now it's a graph printing patchset without graph printing :-)

All other commits are unchanged from the previous version. I'm also
resubmitting to give it a final run of the tests on various platforms.


V9
==

 * Fix outdir creation for out-of-tree builds
   (thanks, Michael)


V10
===

 * Nothing new, just fixed a merge conflict that I wanted to take a final
   round through Patchwork before applying.

softworkz (4):
  fftools/textformat: Extract and generalize textformat api from
ffprobe.c
  fftools/ffprobe: Change to use textformat api
  fftools/ffprobe: Rename writer_print_section_* and WriterContext
  fftools/ffprobe: Rename AVTextFormatContext variables (w => tfc)

 fftools/Makefile   |   15 +-
 fftools/ffprobe.c  | 2302 +---
 fftools/textformat/avtextformat.c  |  672 
 fftools/textformat/avtextformat.h  |  171 +++
 fftools/textformat/avtextwriters.h |   68 +
 fftools/textformat/tf_compact.c|  282 
 fftools/textformat/tf_default.c|  145 ++
 fftools/textformat/tf_flat.c   |  174 +++
 fftools/textformat/tf_ini.c|  160 ++
 fftools/textformat/tf_json.c   |  215 +++
 fftools/textformat/tf_xml.c|  221 +++
 fftools/textformat/tw_avio.c   |  129 ++
 fftools/textformat/tw_buffer.c |   92 ++
 fftools/textformat/tw_stdout.c |   82 +
 14 files changed, 2779 insertions(+), 1949 deletions(-)
 create mode 100644 fftools/textformat/avtextformat.c
 create mode 100644 fftools/textformat/avtextformat.h
 create mode 100644 fftools/textformat/avtextwriters.h
 create mode 100644 fftools/textformat/tf_compact.c
 create mode 100644 fftools/textformat/tf_default.c
 create mode 100644 fftools/textformat/tf_flat.c
 create mode 100644 fftools/textformat/tf_ini.c
 create mode 100644 fftools/textformat/tf_json.c
 create mode 100644 fftools/textformat/tf_xml.c
 create mode 100644 fftools/textformat/tw_avio.c
 create mode 100644 fftools/textformat/tw_buffer.c
 create mode 100644 fftools/textformat/tw_stdout.c


base-commit: 00c50a29abdd0579c441f114bb8edebf1c82461e
Published-As: 
https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-52%2Fsoftworkz%2Fsubmit_print_graphs5-v10
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-52/softworkz/submit_print_graphs5-v10
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/52

Range-diff vs v9:

 1:  f379c77e88 ! 1:  16b2cf05e6 fftools/textformat: Extract and generalize 
textformat api from ffprobe.c
 @@ fftools/textformat/avtextformat.h (new)
  +#define SECTION_MAX_NB_CHILDREN 11
  +
  +
 -+struct AVTextFormatSection {
 ++typedef struct AVTextFormatSection {
  +int id; ///< unique id identifying a section
  +const char *name;
  +
 2:  5ebe2a6c20 = 2:  0690336721 fftools/ffprobe: Change to use textformat api
 3:  41dab9d31a ! 3:  a9cfc15a79 fftools/ffprobe: Rename writer_print_section_* 
and WriterContext
 @@ fftools/ffprobe.c: static void print_private_data(WriterContext *w, 
void *priv_d
   }
   }
   
 +-static void print_pixel_format(WriterContext *w, enum AVPixelFormat 
pix_fmt)
 ++static void print_pixel_format(AVTextFormatContext *w, enum 
AVPixelFormat pix_fmt)
 + {
 + const char *s = av_get_pix_fmt_name(pix_fmt);
 + enum AVPixelFormat swapped_pix_fmt;
 +@@ fftools/ffprobe.c: static void print_pixel_format(WriterContext *w, 
enum AVPixelFormat pix_fmt)
 + }
 + }
 + 
  -static void print_color_range(WriterContext *w, enum AVColorRange 
color_range)
  +static void print_color_range(AVTextFormatContext *w, enum AVColorRange 
color_range)
   {
 4:  ae472da3e3 ! 4:  cad667bb3f fftools/ffprobe: Rename AVTextFormatContext 
variables (w => tfc)
 @@ fftools/ffprobe.c: static void print_private_data(AVTextFormatContext 
*w, void *
   }
   }
   
 +-static void print_pixel_format(AVTextFormatContext *w, enum 
AVPixelFormat pix_fmt)
 ++static void print_pixel_format(AVTextFormatContext *tfc, enum 
AVPixelFormat pix_fmt)
 + {
 + const char *s = av_get_pix_fmt_name(pix_fmt);
 + enum AVPixelFormat swapped_pix_fmt;
 +@@ fftools/ffprobe.c: static void print_pixel_format(AVTextFormatContext 
*w, enum AVPixelFormat pix_fm
 + }
 + }
 + 
  -static void print_color_range(AVTextFormatContext *w, enum AVColorRange 
color_range)
  +static void print_color_range(AVTextFormatContext *tfc, enum 
AVColorRange color_range)
   {
 @@ fftools/ffprobe.c: static void show_frame(AVTextFormatContext *w, 
AVFrame *frame
   
   s = av_get_media_type_string(stream->codecpar

[FFmpeg-devel] [PATCH v10 4/4] fftools/ffprobe: Rename AVTextFormatContext variables (w => tfc)

2025-04-09 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 fftools/ffprobe.c | 518 +++---
 1 file changed, 259 insertions(+), 259 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 141233a2e9..e0a7322523 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -407,7 +407,7 @@ static void log_callback(void *ptr, int level, const char 
*fmt, va_list vl)
 #define print_fmt(k, f, ...) do {  \
 av_bprint_clear(&pbuf);\
 av_bprintf(&pbuf, f, __VA_ARGS__); \
-avtext_print_string(w, k, pbuf.str, 0);\
+avtext_print_string(tfc, k, pbuf.str, 0);\
 } while (0)
 
 #define print_list_fmt(k, f, n, m, ...) do {\
@@ -419,19 +419,19 @@ static void log_callback(void *ptr, int level, const char 
*fmt, va_list vl)
 av_bprintf(&pbuf, f, __VA_ARGS__);  \
 }   \
 }   \
-avtext_print_string(w, k, pbuf.str, 0); \
+avtext_print_string(tfc, k, pbuf.str, 0); \
 } while (0)
 
-#define print_int(k, v) avtext_print_integer(w, k, v)
-#define print_q(k, v, s)avtext_print_rational(w, k, v, s)
-#define print_str(k, v) avtext_print_string(w, k, v, 0)
-#define print_str_opt(k, v) avtext_print_string(w, k, v, 
AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
-#define print_str_validate(k, v) avtext_print_string(w, k, v, 
AV_TEXTFORMAT_PRINT_STRING_VALIDATE)
-#define print_time(k, v, tb)avtext_print_time(w, k, v, tb, 0)
-#define print_ts(k, v)  avtext_print_ts(w, k, v, 0)
-#define print_duration_time(k, v, tb) avtext_print_time(w, k, v, tb, 1)
-#define print_duration_ts(k, v)   avtext_print_ts(w, k, v, 1)
-#define print_val(k, v, u)  avtext_print_unit_int(w, k, v, u)
+#define print_int(k, v) avtext_print_integer(tfc, k, v)
+#define print_q(k, v, s)avtext_print_rational(tfc, k, v, s)
+#define print_str(k, v) avtext_print_string(tfc, k, v, 0)
+#define print_str_opt(k, v) avtext_print_string(tfc, k, v, 
AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
+#define print_str_validate(k, v) avtext_print_string(tfc, k, v, 
AV_TEXTFORMAT_PRINT_STRING_VALIDATE)
+#define print_time(k, v, tb)avtext_print_time(tfc, k, v, tb, 0)
+#define print_ts(k, v)  avtext_print_ts(tfc, k, v, 0)
+#define print_duration_time(k, v, tb) avtext_print_time(tfc, k, v, tb, 1)
+#define print_duration_ts(k, v)   avtext_print_ts(tfc, k, v, 1)
+#define print_val(k, v, u)  avtext_print_unit_int(tfc, k, v, u)
 
 #define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n)\
 {   \
@@ -441,25 +441,25 @@ static void log_callback(void *ptr, int level, const char 
*fmt, va_list vl)
 memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
 }
 
-static inline int show_tags(AVTextFormatContext *w, AVDictionary *tags, int 
section_id)
+static inline int show_tags(AVTextFormatContext *tfc, AVDictionary *tags, int 
section_id)
 {
 const AVDictionaryEntry *tag = NULL;
 int ret = 0;
 
 if (!tags)
 return 0;
-avtext_print_section_header(w, NULL, section_id);
+avtext_print_section_header(tfc, NULL, section_id);
 
 while ((tag = av_dict_iterate(tags, tag))) {
 if ((ret = print_str_validate(tag->key, tag->value)) < 0)
 break;
 }
-avtext_print_section_footer(w);
+avtext_print_section_footer(tfc);
 
 return ret;
 }
 
-static void print_dovi_metadata(AVTextFormatContext *w, const AVDOVIMetadata 
*dovi)
+static void print_dovi_metadata(AVTextFormatContext *tfc, const AVDOVIMetadata 
*dovi)
 {
 if (!dovi)
 return;
@@ -514,15 +514,15 @@ static void print_dovi_metadata(AVTextFormatContext *w, 
const AVDOVIMetadata *do
 print_int("num_x_partitions",  mapping->num_x_partitions);
 print_int("num_y_partitions",  mapping->num_y_partitions);
 
-avtext_print_section_header(w, NULL, 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST);
+avtext_print_section_header(tfc, NULL, 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST);
 
 for (int c = 0; c < 3; c++) {
 const AVDOVIReshapingCurve *curve = &mapping->curves[c];
-avtext_print_section_header(w, "Reshaping curve", 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT);
+avtext_print_section_header(tfc, "Reshaping curve", 
SECTION_ID_FRAME_SIDE_DATA_COMPONENT);
 
 print_list_fmt("pivots", "%"PRIu16, curve->num_pivots, 1, 
curve->pivots[idx]);
 
-avtext_print_section_header(w, NULL, 
SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST);
+avtext_print_section_header(tfc, NULL, 
SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST);
 for (int i = 0; i < curve->num_pivots - 1; i++) {
 AVBPrint piece_buf;
 
@@ -540,7 +540,7 @@ static void print_dovi_metadata(AVTextFormatContext *w, 
const AVDOVIMetadata

[FFmpeg-devel] [PATCH 1/2] avcodec/h261dec: Export key frame information

2025-04-09 Thread Andreas Rheinhardt
Patches attached.

- Andreas
From 312fa0762798ea2207a29fde378f451e693b5981 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Wed, 9 Apr 2025 14:23:32 +0200
Subject: [PATCH 1/2] avcodec/h261dec: Export key frame information

Implements ticket #8343.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/h261dec.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 1f57c9f8fe..840414cafc 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -25,7 +25,6 @@
  * H.261 decoder.
  */
 
-#include "libavutil/avassert.h"
 #include "libavutil/thread.h"
 #include "avcodec.h"
 #include "codec_internal.h"
@@ -458,7 +457,7 @@ intra:
  * Decode the H.261 picture header.
  * @return <0 if no startcode found
  */
-static int h261_decode_picture_header(H261DecContext *h)
+static int h261_decode_picture_header(H261DecContext *h, int *is_key)
 {
 MpegEncContext *const s = &h->s;
 int format, i;
@@ -482,7 +481,7 @@ static int h261_decode_picture_header(H261DecContext *h)
 /* PTYPE starts here */
 skip_bits1(&s->gb); /* split screen off */
 skip_bits1(&s->gb); /* camera  off */
-skip_bits1(&s->gb); /* freeze picture release off */
+*is_key = get_bits1(&s->gb); /* freeze picture release off */
 
 format = get_bits1(&s->gb);
 
@@ -545,7 +544,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
 const uint8_t *buf = avpkt->data;
 int buf_size   = avpkt->size;
 MpegEncContext *s  = &h->s;
-int ret;
+int ret, is_key;
 
 ff_dlog(avctx, "*frame %"PRId64" size=%d\n", avctx->frame_num, buf_size);
 ff_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
@@ -554,7 +553,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
 
 init_get_bits(&s->gb, buf, buf_size * 8);
 
-ret = h261_decode_picture_header(h);
+ret = h261_decode_picture_header(h, &is_key);
 
 /* skip if the header was thrashed */
 if (ret < 0) {
@@ -575,7 +574,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
 return ret;
 }
 
-if ((avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
+if ((avctx->skip_frame >= AVDISCARD_NONINTRA && !is_key) ||
  avctx->skip_frame >= AVDISCARD_ALL)
 return buf_size;
 
@@ -595,7 +594,10 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict,
 }
 ff_mpv_frame_end(s);
 
-av_assert0(s->pict_type == s->cur_pic.ptr->f->pict_type);
+if (is_key) {
+s->cur_pic.ptr->f->pict_type = AV_PICTURE_TYPE_I;
+s->cur_pic.ptr->f->flags|= AV_FRAME_FLAG_KEY;
+}
 
 if ((ret = av_frame_ref(pict, s->cur_pic.ptr->f)) < 0)
 return ret;
-- 
2.45.2

From d341d45fc7ebdd8cfc46d40ab1f0af4faa4e563b Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Wed, 9 Apr 2025 14:39:37 +0200
Subject: [PATCH 2/2] avcodec/h261dec: Set pict_type during init

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/h261dec.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 840414cafc..146f979a5e 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -88,6 +88,12 @@ static av_cold int h261_decode_init(AVCodecContext *avctx)
 
 avctx->framerate = (AVRational) { 3, 1001 };
 
+/* The H.261 analog of intra/key frames is setting the freeze picture release flag,
+ * but this does not guarantee that the frame uses intra-only encoding,
+ * so we still need to allocate dummy frames. So set pict_type to P here
+ * for all frames and override it after having decoded the frame. */
+s->pict_type = AV_PICTURE_TYPE_P;
+
 s->private_ctx = &h->common;
 // set defaults
 ret = ff_mpv_decode_init(s, avctx);
@@ -501,11 +507,6 @@ static int h261_decode_picture_header(H261DecContext *h, int *is_key)
 if (skip_1stop_8data_bits(&s->gb) < 0)
 return AVERROR_INVALIDDATA;
 
-/* H.261 has no I-frames, but if we pass AV_PICTURE_TYPE_I for the first
- * frame, the codec crashes if it does not contain all I-blocks
- * (e.g. when a packet is lost). */
-s->pict_type = AV_PICTURE_TYPE_P;
-
 h->gob_number = 0;
 return 0;
 }
-- 
2.45.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] tools: Fix deprecation warning in patcheck

2025-04-09 Thread Link Mauve
From: Link Mauve 

GNU apparently deprecated their egrep alias, replace it with 'grep -E'
to avoid getting flooded with deprecation warnings.
---
 tools/patcheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/patcheck b/tools/patcheck
index 934e5b9451..ab6f73a784 100755
--- a/tools/patcheck
+++ b/tools/patcheck
@@ -9,7 +9,7 @@ if [ $# = 0 ]; then
 fi
 
 GREP=grep
-EGREP=egrep
+EGREP='grep -E'
 TMP=patcheck.tmp
 OPT="-nH"
 #FILES=$($GREP '^+++' $* | sed 's/+++ //g')
-- 
2.49.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v9 2/3] fftools: add mem log flag and disable printing addresses by default

2025-04-09 Thread Gyan Doshi




On 2025-04-09 11:49 pm, softworkz wrote:

diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 2ac3fd4fb3..edf2f49d0b 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
  } else {
  flags |= AV_LOG_PRINT_DATETIME;
  }
+} else if (av_strstart(token, "mem", &arg)) {
+if (cmd == '-') {
+flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+} else {
+flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+}
  } else {
  break;
  }


You also need to update the block just before the end jump.

Regards,
Gyan

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] libavutil: Replace obsolete functions with 2-suffix

2025-04-09 Thread Link Mauve
From: Link Mauve 

These functions got replaced in the Vulkan API because they had
forgotten extensibility through the pNext pointer, otherwise used
everywhere in the API.

For two of these functions we already had the 2 pointer loaded, so this
avoids loading the old one as well.

On most drivers these old functions are implemented through the 2
functions automatically anyway, so this avoids the conversion.

I have tested it against anv so far, using the ANV_VIDEO_DECODE=1
environment variable.
---
 libavutil/hwcontext_vulkan.c | 17 +
 libavutil/vulkan.c   |  9 +
 libavutil/vulkan.h   |  2 +-
 libavutil/vulkan_functions.h |  4 +---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 6b9c438222..62cddb424b 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -112,7 +112,7 @@ typedef struct VulkanDevicePriv {
 
 /* Properties */
 VkPhysicalDeviceProperties2 props;
-VkPhysicalDeviceMemoryProperties mprops;
+VkPhysicalDeviceMemoryProperties2 mprops;
 VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops;
 
 /* Opaque FD external semaphore properties */
@@ -1414,7 +1414,7 @@ static int setup_queue_families(AVHWDeviceContext *ctx, 
VkDeviceCreateInfo *cd)
 VkQueueFamilyVideoPropertiesKHR *qf_vid = NULL;
 
 /* First get the number of queue families */
-vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &num, NULL);
+vk->GetPhysicalDeviceQueueFamilyProperties2(hwctx->phys_dev, &num, NULL);
 if (!num) {
 av_log(ctx, AV_LOG_ERROR, "Failed to get queues!\n");
 return AVERROR_EXTERNAL;
@@ -1775,7 +1775,7 @@ static int vulkan_device_init(AVHWDeviceContext *ctx)
 
 p->dev_is_nvidia = (p->props.properties.vendorID == 0x10de);
 
-vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &qf_num, NULL);
+vk->GetPhysicalDeviceQueueFamilyProperties2(hwctx->phys_dev, &qf_num, 
NULL);
 if (!qf_num) {
 av_log(ctx, AV_LOG_ERROR, "Failed to get queues!\n");
 return AVERROR_EXTERNAL;
@@ -1947,7 +1947,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 hwctx->unlock_queue = unlock_queue;
 
 /* Get device capabilities */
-vk->GetPhysicalDeviceMemoryProperties(hwctx->phys_dev, &p->mprops);
+vk->GetPhysicalDeviceMemoryProperties2(hwctx->phys_dev, &p->mprops);
 
 p->vkctx.device = ctx;
 p->vkctx.hwctx = hwctx;
@@ -2134,6 +2134,7 @@ static int alloc_mem(AVHWDeviceContext *ctx, 
VkMemoryRequirements *req,
 VkResult ret;
 int index = -1;
 VulkanDevicePriv *p = ctx->hwctx;
+VkPhysicalDeviceMemoryProperties *mprops = &p->mprops.memoryProperties;
 FFVulkanFunctions *vk = &p->vkctx.vkfn;
 AVVulkanDeviceContext *dev_hwctx = &p->p;
 VkMemoryAllocateInfo alloc_info = {
@@ -2144,8 +2145,8 @@ static int alloc_mem(AVHWDeviceContext *ctx, 
VkMemoryRequirements *req,
 
 /* The vulkan spec requires memory types to be sorted in the "optimal"
  * order, so the first matching type we find will be the best/fastest one 
*/
-for (int i = 0; i < p->mprops.memoryTypeCount; i++) {
-const VkMemoryType *type = &p->mprops.memoryTypes[i];
+for (int i = 0; i < mprops->memoryTypeCount; i++) {
+const VkMemoryType *type = &mprops->memoryTypes[i];
 
 /* The memory type must be supported by the requirements (bitfield) */
 if (!(req->memoryTypeBits & (1 << i)))
@@ -2156,7 +2157,7 @@ static int alloc_mem(AVHWDeviceContext *ctx, 
VkMemoryRequirements *req,
 continue;
 
 /* The memory type must be large enough */
-if (req->size > p->mprops.memoryHeaps[type->heapIndex].size)
+if (req->size > mprops->memoryHeaps[type->heapIndex].size)
 continue;
 
 /* Found a suitable memory type */
@@ -2180,7 +2181,7 @@ static int alloc_mem(AVHWDeviceContext *ctx, 
VkMemoryRequirements *req,
 return AVERROR(ENOMEM);
 }
 
-*mem_flags |= p->mprops.memoryTypes[index].propertyFlags;
+*mem_flags |= mprops->memoryTypes[index].propertyFlags;
 
 return 0;
 }
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 52b42cdc32..643caf1f90 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -152,7 +152,7 @@ int ff_vk_load_props(FFVulkanContext *s)
 };
 
 vk->GetPhysicalDeviceProperties2(s->hwctx->phys_dev, &s->props);
-vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops);
+vk->GetPhysicalDeviceMemoryProperties2(s->hwctx->phys_dev, &s->mprops);
 vk->GetPhysicalDeviceFeatures2(s->hwctx->phys_dev, &s->feats);
 
 load_enabled_qfs(s);
@@ -901,6 +901,7 @@ int ff_vk_alloc_mem(FFVulkanContext *s, 
VkMemoryRequirements *req,
 VkResult ret;
 int index = -1;
 FFVulkanFunctions *vk = &s->vkfn;
+VkPhysicalDeviceMemoryProperties *mprops = &s->mprops.memoryProperties;
 
 VkMemoryAllocateInfo alloc_info = {
 .sType   = V

Re: [FFmpeg-devel] [RFC] AVDictionary2

2025-04-09 Thread Michael Niedermayer
On Tue, Apr 08, 2025 at 08:00:20PM -0400, Leo Izen wrote:
> On 4/8/25 06:19, Michael Niedermayer wrote:
> > Hi all
> > 
> > As i have too many things to do already i did the most logic thing and
> > started thinking about a new and unrelated idea.
> > 
> > This is a list of problems and ideas, that everyone is welcome to add to and
> > comment on.
> > 
> > AVDictionary is just bad.
> > 
> > * its complicated internally with
> >unneeded alternative (AV_DICT_DONT_STRDUP_VAL/KEY) these are rarely used
> >and probably not relevant for performance.
> > 
> 
> As far as I'm aware the main purpose of AV_DICT_DONT_STRDUP is to transfer
> ownership to the dictionary to save a call to malloc/free. If I construct a
> string e.g. with av_bprint API, and then I want to pass it as a value to an
> AVDictionary *, then without access to AV_DICT_DONT_STRDUP_VAL as an option,
> I will then have to free it.
> 
> Since your goal is to avoid malloc/free calls I feel like this is a
> reasonable interface to continue to support.

git grep av_dict_set | wc is 690

git grep AV_DICT_DONT_STRDUP | wc is 87
git grep AV_DICT_DONT_STRDUP libavutil/ tests doc | wc is 20

We thus have 67 cases using one of the AV_DICT_DONT_STRDUP
and ~ 623 which do not

and we need 2*623 mallocs and 623 + 67 reallocs ATM
(not counting the ones outside av_dict_set())

teh proposed system would use 623 + 67 mallocs and 67 free and
log2(623 + 67) realloc. (or less if one used a single array)
It also could potentially avoid some of teh mallocs done outside
that just get freed then inside

now if you continue or not continue to support AV_DICT_DONT_STRDUP
doesnt change anything. The 2 externally allocated strings are not
in the right format and need to be freed. And even with freeing
its fewer mallocs (as shown above)

also the implied minimum allocation from AV_DICT_DONT_STRDUP is 2 per
call, we only need 1 with no extra complexity. Just dont allocate 2
seperate arrays, use 1
as a bonus its also 1 pointer less and 1 free less

thx

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/3] swscale/swscale: Do not crash on floats

2025-04-09 Thread Michael Niedermayer
On Tue, Feb 04, 2025 at 03:58:43AM +0100, Michael Niedermayer wrote:
> Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
> Fixes: division by zero
> Fixes: 
> 391981061/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6691017763389440
> Fixes: 
> 392929028/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5142088307507200
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libswscale/swscale.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread Andreas Rheinhardt
softworkz:
> From: softworkz 
> 
> 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.

The implementation of this flag is counter to the usual one: It is
enabled by default, but every av_log_set_flags() that does not set
AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory addresses.
This means that it will affect users that do not opt into this. I don't
think this is intended or that the new system makes sense.
(Due to the av_log_set_flags(AV_LOG_SKIP_REPEATED) performed early in
the main function of the fftools, they are of this kind even with this
patch alone.)

> 
> Signed-off-by: softworkz 
> ---
>  doc/APIchanges  | 3 +++
>  libavutil/log.c | 8 +---
>  libavutil/log.h | 5 +
>  libavutil/version.h | 2 +-
>  4 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 65bf5a9419..27afa5ba81 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 - xx - lavu 60.2.100 - log.h
> +  Add flag AV_LOG_PRINT_MEMADDRESSES
> +
>  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..7ce23cc31f 100644
> --- a/libavutil/log.c
> +++ b/libavutil/log.c
> @@ -56,7 +56,7 @@ 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
> @@ -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_PRINT_MEMADDRESSES ? "[%s @ %p] " 
> : "[%s] ";
> +
>  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..450b4544b9 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
>  
> +/**
> + * Print memory addresses instead of logical ids in the AVClass prefix.

The logical id system has been removed from this patchset.

> + */
> +#define AV_LOG_PRINT_MEMADDRESSES 16

AV_LOG_PRINT_MEMADDRESS seems better given that every av_log() will
likely only print one memaddress.

> +
>  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, \

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread Andreas Rheinhardt
softworkz .:
> 
> 
>> -Original Message-
>> From: ffmpeg-devel  On Behalf Of
>> Andreas Rheinhardt
>> Sent: Mittwoch, 9. April 2025 09:28
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
>> AV_LOG_PRINT_MEMADDRESSES
>>
>> softworkz:
>>> From: softworkz 
>>>
>>> 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.
>>
>> The implementation of this flag is counter to the usual one: It is
>> enabled by default, but every av_log_set_flags() that does not set
>> AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory addresses.
> 
> Hi Andreas,
> 
> thanks for looking at the patchset.
> 
> The intention is that memadress printing is enabled by default for library 
> use of avutil (so that there's no change in behavior) but not for fftools 
> (following the suggestion from Marton).
> 
> For fftools, the default is to _not_ print memory addresses _unless_ a user 
> specifies something like:
> 
> ./ffmpeg -v +memaddresses .
> 
> 
>> This means that it will affect users that do not opt into this. I don't
>> think this is intended
> 
> Yes, it is.

So this new behavior is intended? Because this clashes with your
statement above that there is no change in behavior for avutil users.

> 
> 
>> or that the new system makes sense.
> 
> Do you think it would make more sense to negate the flag semantic?

Yes.

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread Andreas Rheinhardt
softworkz .:
> 
> 
>> -Original Message-
>> From: ffmpeg-devel  On Behalf Of
>> Andreas Rheinhardt
>> Sent: Mittwoch, 9. April 2025 10:12
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
>> AV_LOG_PRINT_MEMADDRESSES
>>
>> softworkz .:
>>>
>>>
 -Original Message-
 From: ffmpeg-devel  On Behalf Of
 softworkz .
 Sent: Mittwoch, 9. April 2025 09:51
 To: FFmpeg development discussions and patches > de...@ffmpeg.org>
 Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
 AV_LOG_PRINT_MEMADDRESSES



> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Andreas Rheinhardt
> Sent: Mittwoch, 9. April 2025 09:28
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> AV_LOG_PRINT_MEMADDRESSES
>
> softworkz:
>> From: softworkz 
>>
>> 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.
>
> The implementation of this flag is counter to the usual one: It is
> enabled by default, but every av_log_set_flags() that does not set
> AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory
 addresses.

 Hi Andreas,

 thanks for looking at the patchset.
>>>
>>> [..]
>>>
> AV_LOG_PRINT_MEMADDRESS seems better given that every av_log() will
> likely only print one memaddress.

 It can be more than a single address per log line since it also
>> prints
 the parent's memory address in case it specifies
 parent_log_context_offset.
>>
>> I know. That's why my statement contained a "likely".
> 
> Sorry, of course you know. My bad.
> 
> 
>> https://github.com/ffstaging/FFmpeg/blob/02eda84bf2fcf0db7793872204b0f56
 4a6557232/libavutil/log.c#L329-L337
>>>
>>> But the reason - from my thinking - why I made it plural is because
>> it's a global flag that controls whether all memory addresses ( <- pl.)
>> should be printed or not. If it was a flag that is conveyed as part of a
>> log invocation (like av_log), controlling whether the memory address
>> should be printed for that single log line, then I'd think it should be
>> singular - probably even despite the nit regarding the parent address.
>>>
>>> Does it make sense? 😊
>>>
>>
>> I get your thinking, but it is not consistent with the other flags:
>> There is no AV_LOG_PRINT_TIMES after all.
> 
> Okay, singular it will be!
> 
> 
>>> Do you think it would make more sense to negate the flag semantic?
>>
>> Yes.
> 
> Fine, let's do it that way round. To be clear, you only mean to negate the 
> internal logic of that flag, i.e. making it AV_LOG_NO_PRINT_MEMADDRESS 
> internally,

The flag is public, not internal.

 but for the fftools CLI, it will still be:
> 
> ./ffmpeg -v memaddress
> 
> to enable it, right?

Given that the default for the fftools is different from the default for
lavu, it makes sense to handle it differently.

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v8 2/3] fftools: add memaddress log flag and disable printing addresses by default

2025-04-09 Thread softworkz
From: softworkz 

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.

Example with memaddresses flag:

[hevc @ 018e72a89cc0] .

without (new behavior):

[hevc] .

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c | 2 +-
 fftools/ffplay.c | 2 +-
 fftools/ffprobe.c| 2 +-
 fftools/opt_common.c | 6 ++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..72887d6c5e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -954,7 +954,7 @@ 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
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 2a572fc3aa..9bd1fc2f22 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3761,7 +3761,7 @@ 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 */
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index abbd1dcf36..106435b827 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4672,7 +4672,7 @@ 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);
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 2ac3fd4fb3..73a591acd8 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1304,6 +1304,12 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_DATETIME;
 }
+} else if (av_strstart(token, "memaddress", &arg)) {
+if (cmd == '-') {
+flags |= AV_LOG_NO_PRINT_MEMADDRESS;
+} else {
+flags &= ~AV_LOG_NO_PRINT_MEMADDRESS;
+}
 } else {
 break;
 }
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v8 3/3] doc/fftools-common-opts: document memaddress log flag

2025-04-09 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/fftools-common-opts.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index f6d452c40e..15a54fdbb6 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -230,6 +230,8 @@ 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 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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread softworkz .


> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Andreas Rheinhardt
> Sent: Mittwoch, 9. April 2025 10:28
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> AV_LOG_PRINT_MEMADDRESSES
> 
> softworkz .:
> >
> >
> >> -Original Message-
> >> From: ffmpeg-devel  On Behalf Of
> >> Andreas Rheinhardt
> >> Sent: Mittwoch, 9. April 2025 10:12
> >> To: ffmpeg-devel@ffmpeg.org
> >> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> >> AV_LOG_PRINT_MEMADDRESSES
> >>
> >> softworkz .:
> >>>
> >>>
>  -Original Message-
>  From: ffmpeg-devel  On Behalf Of
>  softworkz .
>  Sent: Mittwoch, 9. April 2025 09:51
>  To: FFmpeg development discussions and patches  >> de...@ffmpeg.org>
>  Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
>  AV_LOG_PRINT_MEMADDRESSES
> 
> 
> 
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of
> > Andreas Rheinhardt
> > Sent: Mittwoch, 9. April 2025 09:28
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log
> flag
> > AV_LOG_PRINT_MEMADDRESSES
> >
> > softworkz:
> >> From: softworkz 
> >>
> >> 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.
> >
> > The implementation of this flag is counter to the usual one: It is
> > enabled by default, but every av_log_set_flags() that does not set
> > AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory
>  addresses.
> 
>  Hi Andreas,
> 
>  thanks for looking at the patchset.
> >>>
> >>> [..]
> >>>
> > AV_LOG_PRINT_MEMADDRESS seems better given that every av_log()
> will
> > likely only print one memaddress.
> 
>  It can be more than a single address per log line since it also
> >> prints
>  the parent's memory address in case it specifies
>  parent_log_context_offset.
> >>
> >> I know. That's why my statement contained a "likely".
> >
> > Sorry, of course you know. My bad.
> >
> >
> >>
> https://github.com/ffstaging/FFmpeg/blob/02eda84bf2fcf0db7793872204b0f56
>  4a6557232/libavutil/log.c#L329-L337
> >>>
> >>> But the reason - from my thinking - why I made it plural is because
> >> it's a global flag that controls whether all memory addresses ( <-
> pl.)
> >> should be printed or not. If it was a flag that is conveyed as part
> of a
> >> log invocation (like av_log), controlling whether the memory address
> >> should be printed for that single log line, then I'd think it should
> be
> >> singular - probably even despite the nit regarding the parent
> address.
> >>>
> >>> Does it make sense? 😊
> >>>
> >>
> >> I get your thinking, but it is not consistent with the other flags:
> >> There is no AV_LOG_PRINT_TIMES after all.
> >
> > Okay, singular it will be!
> >
> >
> >>> Do you think it would make more sense to negate the flag semantic?
> >>
> >> Yes.
> >
> > Fine, let's do it that way round. To be clear, you only mean to negate
> the internal logic of that flag, i.e. making it
> AV_LOG_NO_PRINT_MEMADDRESS internally,
> 
> The flag is public, not internal.

Hi Andreas,

I meant "internal" from the pov of a cli user, but public API of course, yea.


>  but for the fftools CLI, it will still be:
> >
> > ./ffmpeg -v memaddress
> >
> > to enable it, right?
> 
> Given that the default for the fftools is different from the default for
> lavu, it makes sense to handle it differently.

I've just pushed v8, I hope that's how you meant it to be like?

I also realized a flaw in the previous version in a way that the flag got lost 
when log params are specified multiple times (e.g. ./ffmpeg -v -memaddress -v 
verbose ...), but that doesn't happen anymore now.


Thanks again,
sw


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread softworkz .


> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Andreas Rheinhardt
> Sent: Mittwoch, 9. April 2025 10:12
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> AV_LOG_PRINT_MEMADDRESSES
> 
> softworkz .:
> >
> >
> >> -Original Message-
> >> From: ffmpeg-devel  On Behalf Of
> >> softworkz .
> >> Sent: Mittwoch, 9. April 2025 09:51
> >> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> >> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> >> AV_LOG_PRINT_MEMADDRESSES
> >>
> >>
> >>
> >>> -Original Message-
> >>> From: ffmpeg-devel  On Behalf Of
> >>> Andreas Rheinhardt
> >>> Sent: Mittwoch, 9. April 2025 09:28
> >>> To: ffmpeg-devel@ffmpeg.org
> >>> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> >>> AV_LOG_PRINT_MEMADDRESSES
> >>>
> >>> softworkz:
>  From: softworkz 
> 
>  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.
> >>>
> >>> The implementation of this flag is counter to the usual one: It is
> >>> enabled by default, but every av_log_set_flags() that does not set
> >>> AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory
> >> addresses.
> >>
> >> Hi Andreas,
> >>
> >> thanks for looking at the patchset.
> >
> > [..]
> >
> >>> AV_LOG_PRINT_MEMADDRESS seems better given that every av_log() will
> >>> likely only print one memaddress.
> >>
> >> It can be more than a single address per log line since it also
> prints
> >> the parent's memory address in case it specifies
> >> parent_log_context_offset.
> 
> I know. That's why my statement contained a "likely".

Sorry, of course you know. My bad.


> https://github.com/ffstaging/FFmpeg/blob/02eda84bf2fcf0db7793872204b0f56
> >> 4a6557232/libavutil/log.c#L329-L337
> >
> > But the reason - from my thinking - why I made it plural is because
> it's a global flag that controls whether all memory addresses ( <- pl.)
> should be printed or not. If it was a flag that is conveyed as part of a
> log invocation (like av_log), controlling whether the memory address
> should be printed for that single log line, then I'd think it should be
> singular - probably even despite the nit regarding the parent address.
> >
> > Does it make sense? 😊
> >
> 
> I get your thinking, but it is not consistent with the other flags:
> There is no AV_LOG_PRINT_TIMES after all.

Okay, singular it will be!


> > Do you think it would make more sense to negate the flag semantic?
> 
> Yes.

Fine, let's do it that way round. To be clear, you only mean to negate the 
internal logic of that flag, i.e. making it AV_LOG_NO_PRINT_MEMADDRESS 
internally, but for the fftools CLI, it will still be:

./ffmpeg -v memaddress

to enable it, right?


Thank you
sw







___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v8 0/3] avutil/log: Add log flag to control printing of memory addresses

2025-04-09 Thread ffmpegagent
--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 @ 018e72a89cc0] nal_unit_type:
[hevc @ 018e72a89cc0] Decoding PPS
[hevc @ 018e72a89cc0] nal_unit_type: 39(SEI_P.. [hevc @
018e72a89cc0] Decoding SEI
[mp4 @ 018e72a8e240] All [mp4 @ 018e72a8e240] Afte [hevc @
018e742f6b40] Decoded frame with POC .. detected 16 logical cores
[Parsed_scale_0 @ 018e74382f40] Setting 'w' t.. [Parsed_scale_0 @
018e74382f40] Setting 'h' t.. [Parsed_scale_1 @ 018e74382440]
Setting 'w' t.. [mjpeg @ 018e743210c0] Forcing thread count t.. [mjpeg @
018e743210c0] 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 
  
 @@ doc/APIchanges
   The last version increases of all libraries were on 2025-03-28
   
  +2025-03-xx - xx - 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 me

Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag AV_LOG_PRINT_MEMADDRESSES

2025-04-09 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Andreas Rheinhardt
> Sent: Mittwoch, 9. April 2025 09:28
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v7 1/3] avutil/log: Add log flag
> AV_LOG_PRINT_MEMADDRESSES
> 
> softworkz:
> > From: softworkz 
> >
> > 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.
> 
> The implementation of this flag is counter to the usual one: It is
> enabled by default, but every av_log_set_flags() that does not set
> AV_LOG_PRINT_MEMADDRESSES implicitly disables printing memory addresses.

Hi Andreas,

thanks for looking at the patchset.

The intention is that memadress printing is enabled by default for library use 
of avutil (so that there's no change in behavior) but not for fftools 
(following the suggestion from Marton).

For fftools, the default is to _not_ print memory addresses _unless_ a user 
specifies something like:

./ffmpeg -v +memaddresses .


> This means that it will affect users that do not opt into this. I don't
> think this is intended

Yes, it is.


> or that the new system makes sense.

Do you think it would make more sense to negate the flag semantic?


> AV_LOG_PRINT_MEMADDRESS seems better given that every av_log() will
> likely only print one memaddress.

It can be more than a single address per log line since it also prints the 
parent's memory address in case it specifies parent_log_context_offset.

see: 
https://github.com/ffstaging/FFmpeg/blob/02eda84bf2fcf0db7793872204b0f564a6557232/libavutil/log.c#L329-L337


Also, thanks a lot for the other hints!

sw

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2] nvdec/vc1: add marker insertion logic

2025-04-09 Thread Timo Rothenpieler

On 08/04/2025 22:50, averne wrote:

This mirrors existing code in d3dxx and dxva hwaccels

---
Changes since v1: use the codec-specific handler
for wmv3.

Insert the relevant marker into the bitstream on
slice submission.
This is analogous to the logic found in DXVA and
D3D hwaccels.

Fixes decoding of various VC-1 streams, eg.:
https://drive.google.com/file/d/1WJyiRhcdU4FHTW3sVMitS7UdrZM1NBy-/view?usp=sharing

This was investigated using my nvdec tracing tool:
https://github.com/averne/NvdecTrace

Signed-off-by: averne 
---
  libavcodec/nvdec_vc1.c | 45 -
  1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/libavcodec/nvdec_vc1.c b/libavcodec/nvdec_vc1.c
index 
fbfba1ecb43421573ef8fea1e37a2425c272edc9..a88327833df55054a42e7ced8cdd4c99fa6b6584
 100644
--- a/libavcodec/nvdec_vc1.c
+++ b/libavcodec/nvdec_vc1.c
@@ -22,6 +22,7 @@
  
  #include "config_components.h"
  
+#include "libavutil/mem.h"

  #include "avcodec.h"
  #include "hwaccel_internal.h"
  #include "internal.h"
@@ -107,6 +108,48 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, 
const uint8_t *buffer, u
  return 0;
  }
  
+static int nvdec_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,

+  uint32_t size)
+{
+NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
+const VC1Context *v = avctx->priv_data;
+uint32_t marker;
+int marker_size;
+void *tmp;
+
+if (ctx->bitstream_len)
+marker = VC1_CODE_SLICE;
+else if (v->profile == PROFILE_ADVANCED && v->fcm == ILACE_FIELD && 
v->second_field)
+marker = VC1_CODE_FIELD;
+else
+marker = VC1_CODE_FRAME;
+
+/* Only insert the marker if not already present in the bitstream */
+marker_size = (size >= sizeof(marker) && AV_RB32(buffer) != marker) ? 
sizeof(marker) : 0;
+
+tmp = av_fast_realloc(ctx->bitstream_internal, &ctx->bitstream_allocated,
+  ctx->bitstream_len + size + marker_size);
+if (!tmp)
+return AVERROR(ENOMEM);
+ctx->bitstream = ctx->bitstream_internal = tmp;
+
+tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
+  (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
+if (!tmp)
+return AVERROR(ENOMEM);
+ctx->slice_offsets = tmp;
+
+if (marker_size)
+AV_WB32(ctx->bitstream_internal + ctx->bitstream_len, marker);
+
+memcpy(ctx->bitstream_internal + ctx->bitstream_len + marker_size, buffer, 
size);
+ctx->slice_offsets[ctx->nb_slices] = ctx->bitstream_len ;
+ctx->bitstream_len += size + marker_size;
+ctx->nb_slices++;
+
+return 0;
+}
+
  static int nvdec_vc1_frame_params(AVCodecContext *avctx,
AVBufferRef *hw_frames_ctx)
  {
@@ -121,7 +164,7 @@ const FFHWAccel ff_vc1_nvdec_hwaccel = {
  .p.pix_fmt= AV_PIX_FMT_CUDA,
  .start_frame  = nvdec_vc1_start_frame,
  .end_frame= ff_nvdec_simple_end_frame,
-.decode_slice = ff_nvdec_simple_decode_slice,
+.decode_slice = nvdec_vc1_decode_slice,
  .frame_params = nvdec_vc1_frame_params,
  .init = ff_nvdec_decode_init,
  .uninit   = ff_nvdec_decode_uninit,

---
base-commit: f76195ff656d6bea68feee783160652e2b3e3d60
change-id: 20250408-nvdec-vc1-fix-7fb117513851

Best regards,


I'll give this a test later and apply if everything works fine.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] ffmpeg.git test compile fail

2025-04-09 Thread James Almer

On 4/9/2025 8:49 AM, Andrew Randrianasulu wrote:

ffmpeg shallow git copy

commit 890b8da1ce27fd365eaffefc7efcbadae9f01f2a

our patches 2 and 8 fail, but this is not really my point yet 


ffmpeg.C:313:42: error: 'avcodec_close' was not declared in this scope; did
you mean 'avio_close'?
ffmpeg.C:476:33: error: 'avcodec_close' was not declared in this scope; did
you mean 'avio_close'?
ffmpeg.C:1307:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1309:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1309:66: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:1311:37: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1311:67: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:1340:36: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'key_frame'
ffmpeg.C:1512:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'interlaced_frame'
ffmpeg.C:1513:24: error: 'AVFrame' {aka 'struct AVFrame'} has no member
named 'top_field_first'
ffmpeg.C:3847:29: error: 'av_stream_get_side_data' was not declared in this
scope; did you mean 'av_frame_get_side_data'?

mplayer switched for now to branch 7.1 until it get updates.

i see in doc/APIchanges


2023-05-04 - 0fc9c1f6828 - lavu 58.7.100 - frame.h
  Deprecate AVFrame.interlaced_frame,
AVFrame.top_field_first, and
   AVFrame.key_frame.
   Add AV_FRAME_FLAG_INTERLACED, AV_FRAME_FLAG_TOP_FIELD_FIRST, and
   AV_FRAME_FLAG_KEY flags as replacement.

but not sure how to use them yet.

Those are flags. You need to check AVFrame->flags to see if they are set.
See 
https://code.videolan.org/videolan/x264/-/merge_requests/173/diffs?commit_id=32c3b801191522961102d4bea292cdb61068d0dd 
for an example.




OpenPGP_signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".