[FFmpeg-devel] [PATCH] avformat/hls: Fix twitter

2025-02-06 Thread Michael Niedermayer
Allow mp4 with all mpegts extensions

Fixes: Ticket11435

Signed-off-by: Michael Niedermayer 
---
 libavformat/hls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8eae64b787e..3bdc1bc8489 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -755,8 +755,8 @@ static int test_segment(AVFormatContext *s, const 
AVInputFormat *in_fmt, struct
 matchF =  av_match_ext(seg->url, in_fmt->extensions)
  + 2*(ff_match_url_ext(seg->url, in_fmt->extensions) > 0);
 if(av_match_name("mp4", in_fmt->name)) {
-matchF |=  av_match_ext(seg->url, "ts")
-  + 2*(ff_match_url_ext(seg->url, "ts") > 0);
+matchF |=  av_match_ext(seg->url, 
"ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
+  + 2*(ff_match_url_ext(seg->url, 
"ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts") > 0);
 }
 } else if (!strcmp(in_fmt->name, "mpegts")) {
 matchF =  av_match_ext(seg->url, 
"ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
-- 
2.48.1

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

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


Re: [FFmpeg-devel] [PATCH v2] avfilter/xpsnr: avoid division by zero

2025-02-06 Thread Gyan Doshi




On 2025-02-05 12:09 pm, Gyan Doshi wrote:



On 2025-02-02 11:27 pm, Gyan Doshi wrote:

The ref input may have its frame rate unset, which would then lead to
SIGFPE. So fall back to the main link frame rate. If that too is unset,
default to 0.

Related to #11428


Plan to push tomorrow.


Pushed as 6da82b448568a1875b32a7135fe30b7da8d197e7

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".


Re: [FFmpeg-devel] [PATCH] avformat/unix: Set is_streamed to true

2025-02-06 Thread Efrain T
That sounds perfectly fine with me. Thanks for the quick reply.

On Thursday, February 6, 2025, Leo Izen  wrote:

> On 2/6/25 2:00 AM, dank074 wrote:
>
>> Currently when a Unix Domain Socket is used as input there is a loss of
>> data when data is consumed from the stream. Setting is_streamed to true
>> fixes this, since the unix domain socket is now treated like a consumable
>> stream.
>>
>> Fixes: #9346
>> Signed-off-by: dank074 
>> ---
>>   libavformat/unix.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/unix.c b/libavformat/unix.c
>> index 5704155cf0..2de4023835 100644
>> --- a/libavformat/unix.c
>> +++ b/libavformat/unix.c
>> @@ -89,7 +89,7 @@ static int unix_open(URLContext *h, const char
>> *filename, int flags)
>>   }
>> s->fd = fd;
>> -
>> +h->is_streamed = 1;
>>   return 0;
>> fail:
>>
>
> The patch looks fine as-is but two style nitpicks:
>
> - we like to have a full blank line between the return statement and the
> one before it, so you should add this line of code right after the line
> s->fd = fd; but not remove the blank line that was there
> - commit messages should be capped at 72 characters per line for
> historical reasons, so please insert newline characters in the commit
> message
>
> If there's no other objections I will push this patch and make both of
> these changes on my end, preserving authorship before I do, if that is okay
> with you.
>
> - Leo Izen (Traneptora)
>
> ___
> 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".


[FFmpeg-devel] Captions SCC

2025-02-06 Thread Devlist Archive
Greetings,

I have been absent from the list for a few years, so I would appreciate it
if someone could catch me up a bit.  I am needing to extract and embed scc
files with 608 captions.  I am pleased to see that transcoding without
frame rate changes now preserves 608 intact, and there appear to be
extraction and embed functions but they do seem to have bugs for my files
at 1080p2997.  Are there any developers willing to take on a paid project
to fix whatever is the issue?  Here are the commands I am working with.

Embed:
"C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -i
"C:\Users\Captions\AIM-2301_premiereDF.mp4" -i
"C:\Captions\AIM-2301_premiereDF.mp4.scc" -map 0:v -map 0:a -map 1 -c:v
copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng
"C:\Captions\AIM-2301_premiereDFcopy.mp4"

Extract:
"C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -f lavfi -i
"movie=\'C:\\Captions\\AIM-2301_premiereDF_ffmpegEmbedscc.mp4\'"[out+subcc]
-map 0:1 -c:s copy "C:\Captions\AIM-2301_premiereDF_ffmpegEmbedscc.scc"


https://drive.google.com/drive/folders/13NXvUgE1EIyLR4WBw30l4NVtS5w33EM7?usp=sharing

The file outputs are included in that drive folder.  Please don't
distribute the files online, but you can use them for testing.  The folder
will go away when the job is complete.  I have requested sample files for
distribution from the content provider, but haven't received those yet.

The objective is to fix the character duplication and data spill out that
is happening during extraction and embedding of scc files for these
resolutions.  I will try to get some 1080i samples also, but don't have
those available in source file form at the moment.  There will be other
captions related projects available once this one is complete.

Thanks,

Zach Swena
___
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 6/7] avformat: add s337m support in mpegts, wav and mxf stereo tracks

2025-02-06 Thread Nicolas Gaullier
>De : ffmpeg-devel  de la part de Tomas Härdin 
>
>Envoyé : mercredi 5 février 2025 15:47
>Objet : Re: [FFmpeg-devel] [PATCH 6/7] avformat: add s337m support in mpegts, 
>wav and mxf stereo tracks
>
>Looks OK
>
>Sorry for the late review
>
>/Tomas

Thanks to you, good to know; nevertheless, the patch serie is shelved because 
of red flags, so there will not be any follow up on the ml at the moment.

Nicolas
___
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] avformat/hls: Fix twitter

2025-02-06 Thread Steven Liu
Michael Niedermayer  于2025年2月6日周四 20:10写道:
>
> Allow mp4 with all mpegts extensions
>
> Fixes: Ticket11435
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/hls.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index 8eae64b787e..3bdc1bc8489 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -755,8 +755,8 @@ static int test_segment(AVFormatContext *s, const 
> AVInputFormat *in_fmt, struct
>  matchF =  av_match_ext(seg->url, in_fmt->extensions)
>   + 2*(ff_match_url_ext(seg->url, in_fmt->extensions) > 
> 0);
>  if(av_match_name("mp4", in_fmt->name)) {
> -matchF |=  av_match_ext(seg->url, "ts")
> -  + 2*(ff_match_url_ext(seg->url, "ts") > 0);
> +matchF |=  av_match_ext(seg->url, 
> "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
> +  + 2*(ff_match_url_ext(seg->url, 
> "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts") > 0);
>  }
>  } else if (!strcmp(in_fmt->name, "mpegts")) {
>  matchF =  av_match_ext(seg->url, 
> "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
> --
> 2.48.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

LGTM

Thanks
___
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 2/2] avcodec: add a ffv1 parser

2025-02-06 Thread Jerome Martinez

Le 06/02/2025 à 16:52, Michael Niedermayer a écrit :

On Sun, Feb 02, 2025 at 11:16:03PM -0300, James Almer wrote:

[...]
+s->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P, see ffv1dec.c

id remove the comment, also in ffv1dec.c


For your information this resolves the issue with non working demux (raw 
copy) of FFV1 in MXF

https://trac.ffmpeg.org/ticket/10161
___
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 v2] avcodec/ac3dec: add a flush callback for the ac3 and eac3 decoders

2025-02-06 Thread James Almer
Fixes ticket #10732

Signed-off-by: James Almer 
---
 libavcodec/ac3dec.c   | 10 ++
 libavcodec/ac3dec.h   | 40 ++-
 libavcodec/ac3dec_fixed.c |  1 +
 libavcodec/ac3dec_float.c |  2 ++
 4 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ff8cbfb0b4..2cf82abc19 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -252,6 +252,16 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
 return 0;
 }
 
+static av_cold void ac3_decode_flush(AVCodecContext *avctx)
+{
+AC3DecodeContext *s = avctx->priv_data;
+
+memset(&s->frame_type, 0, sizeof(*s) - offsetof(AC3DecodeContext, 
frame_type));
+
+AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256);
+av_lfg_init(&s->dith_state, 0);
+}
+
 /**
  * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream.
  * GetBitContext within AC3DecodeContext must point to
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index 98de7b5abf..cc6d1a118e 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -75,8 +75,30 @@ typedef struct AC3DecodeContext {
 AVCodecContext *avctx;  ///< parent context
 GetBitContext gbc;  ///< bitstream reader
 
+AVTXContext *tx_128, *tx_256;
+av_tx_fn tx_fn_128, tx_fn_256;
+
+///@name Optimization
+BswapDSPContext bdsp;
+#if USE_FIXED
+AVFixedDSPContext *fdsp;
+#else
+AVFloatDSPContext *fdsp;
+#endif
+AC3DSPContext ac3dsp;
+FmtConvertContext fmt_conv; ///< optimized conversion functions
+///@}
+
+INTFLOAT *xcfptr[AC3_MAX_CHANNELS];
+INTFLOAT *dlyptr[AC3_MAX_CHANNELS];
+
+AVChannelLayout downmix_layout;
+SHORTFLOAT *downmix_coeffs[2];  ///< stereo downmix 
coefficients
+
+// Start of flushable fields
 ///@name Bit stream information
 ///@{
+// frame_type must be first
 int frame_type; ///< frame type
 (strmtyp)
 int substreamid;///< substream identification
 int superframe_size;///< current superframe size, in 
bytes
@@ -164,7 +186,6 @@ typedef struct AC3DecodeContext {
 int fbw_channels;   ///< number of full-bandwidth 
channels
 int channels;   ///< number of total channels
 int lfe_ch; ///< index of LFE channel
-SHORTFLOAT *downmix_coeffs[2];  ///< stereo downmix 
coefficients
 int downmixed;  ///< indicates if coeffs are 
currently downmixed
 int output_mode;///< output channel 
configuration
 int prev_output_mode;   ///< output channel 
configuration for previous frame
@@ -222,24 +243,9 @@ typedef struct AC3DecodeContext {
 
 ///@name IMDCT
 int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags
 (blksw)
-AVTXContext *tx_128, *tx_256;
-av_tx_fn tx_fn_128, tx_fn_256;
-///@}
-
-///@name Optimization
-BswapDSPContext bdsp;
-#if USE_FIXED
-AVFixedDSPContext *fdsp;
-#else
-AVFloatDSPContext *fdsp;
-#endif
-AC3DSPContext ac3dsp;
-FmtConvertContext fmt_conv; ///< optimized conversion functions
 ///@}
 
 SHORTFLOAT *outptr[AC3_MAX_CHANNELS];
-INTFLOAT *xcfptr[AC3_MAX_CHANNELS];
-INTFLOAT *dlyptr[AC3_MAX_CHANNELS];
 
 ///@name Aligned arrays
 DECLARE_ALIGNED(16, int,   fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; 
  ///< fixed-point transform coefficients
@@ -252,7 +258,7 @@ typedef struct AC3DecodeContext {
 DECLARE_ALIGNED(32, SHORTFLOAT, 
output_buffer)[EAC3_MAX_CHANNELS][AC3_BLOCK_SIZE * 6];  ///< final output buffer
 ///@}
 
-AVChannelLayout downmix_layout;
+// End of flushable fields
 } AC3DecodeContext;
 
 /**
diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c
index e0db9b2260..e284140e74 100644
--- a/libavcodec/ac3dec_fixed.c
+++ b/libavcodec/ac3dec_fixed.c
@@ -181,6 +181,7 @@ const FFCodec ff_ac3_fixed_decoder = {
 .p.priv_class   = &ac3_decoder_class,
 .priv_data_size = sizeof (AC3DecodeContext),
 .init   = ac3_decode_init,
+.flush  = ac3_decode_flush,
 .close  = ac3_decode_end,
 FF_CODEC_DECODE_CB(ac3_decode_frame),
 .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c
index 53d9d472c4..31f5590729 100644
--- a/libavcodec/ac3dec_float.c
+++ b/libavcodec/ac3dec_float.c
@@ -70,6 +70,7 @@ const FFCodec ff_ac3_decoder = {
 .p.id   = AV_CODEC_ID_AC3,
 .priv_data_size = sizeof (AC3DecodeContext),
 .init   = ac3_decode_init,
+.flush  = ac3_decode_flush,
 .close  = ac3_decode_end,
 FF_CODEC_DECODE_CB(ac3_decode_frame),
 .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
@@ -88,6 +89,7 @@ cons

Re: [FFmpeg-devel] Up to Date DeckLink Support broken in FFMPEG

2025-02-06 Thread Devin Heitmueller
On Thu, Feb 6, 2025 at 3:16 PM Marton Balint  wrote:
> > Feel free to take a look. The last change to the decklink code in FFmpeg was
> > authored last april (not counting minor one-line bugfixes and the like) and
> > as far as I am aware nobody is currently working on that so you wouldn't be
> > redoing someone else's work.
>
> There is a patch linked in the blackmagic forums:
>
> https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=213592

I do most of my validation with version 12.9.  While it might be
tempting to change to the new APIs and increase the minimum supported
version to 13.3, I would encourage you to be careful to not force
everybody to update to the latest version and consider a path that
doesn't cause breakage (we typically do this with #defines).

Devin

-- 
Devin Heitmueller, Senior Software Engineer
LTN Global Communications
o: +1 (301) 363-1001
w: https://ltnglobal.com  e: devin.heitmuel...@ltnglobal.com
___
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] avformat/mxfdec: Check edit unit for overflow in mxf_set_current_edit_unit()

2025-02-06 Thread Michael Niedermayer
Hi

On Wed, Feb 05, 2025 at 03:53:23PM +0100, Tomas Härdin wrote:
> ons 2025-02-05 klockan 12:56 +0100 skrev Michael Niedermayer:
> > Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be
> > represented in type 'long'
> > Fixes: 392672068/clusterfuzz-testcase-minimized-
> > ffmpeg_dem_MXF_fuzzer-6232335892152320
> > 
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/mxfdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index 6bc8980d9c1..3b87063c3f2 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -3956,7 +3956,7 @@ static int64_t
> > mxf_set_current_edit_unit(MXFContext *mxf, AVStream *st, int64_t
> >  int64_t new_edit_unit;
> >  MXFIndexTable *t = mxf_find_index_table(mxf, track->index_sid);
> >  
> > -    if (!t || track->wrapping == UnknownWrapped)
> > +    if (!t || track->wrapping == UnknownWrapped || edit_unit >
> > INT64_MAX - track->edit_units_per_packet)
> 
> Looks OK

will apply

thx

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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 v2] avformat/mov: fix eof check in mov_read_iinf()

2025-02-06 Thread Michael Niedermayer
On Mon, Feb 03, 2025 at 06:25:53AM +0100, Kacper Michajłow wrote:
> This fix ensures that the loop stops early on EOF. The issue occurs
> because mov_read_infe() performs a version check and skips unsupported
> versions. The problem is that seeking within the stream clears the EOF
> flag, causing avio_feof() to not function as expected. This is resolved
> by moving the EOF check after reading the size and type, ensuring the
> EOF flag is set when necessary.
> 
> Signed-off-by: Kacper Michajłow 
> ---
>  libavformat/mov.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

thx

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

z(9) = an object that transcends all computable functions describable
in finite terms. - ChatGPT in 2024


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] avformat/hls: Fix twitter

2025-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2025 at 08:17:05PM +0800, Steven Liu wrote:
> Michael Niedermayer  于2025年2月6日周四 20:10写道:
> >
> > Allow mp4 with all mpegts extensions
> >
> > Fixes: Ticket11435
> >
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/hls.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/hls.c b/libavformat/hls.c
> > index 8eae64b787e..3bdc1bc8489 100644
> > --- a/libavformat/hls.c
> > +++ b/libavformat/hls.c
> > @@ -755,8 +755,8 @@ static int test_segment(AVFormatContext *s, const 
> > AVInputFormat *in_fmt, struct
> >  matchF =  av_match_ext(seg->url, in_fmt->extensions)
> >   + 2*(ff_match_url_ext(seg->url, in_fmt->extensions) > 
> > 0);
> >  if(av_match_name("mp4", in_fmt->name)) {
> > -matchF |=  av_match_ext(seg->url, "ts")
> > -  + 2*(ff_match_url_ext(seg->url, "ts") > 0);
> > +matchF |=  av_match_ext(seg->url, 
> > "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
> > +  + 2*(ff_match_url_ext(seg->url, 
> > "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts") > 0);
> >  }
> >  } else if (!strcmp(in_fmt->name, "mpegts")) {
> >  matchF =  av_match_ext(seg->url, 
> > "ts,m2t,m2ts,mts,mpg,m4s,mpeg,mpegts")
> > --
> > 2.48.1
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> 
> LGTM

will apply

thx

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

Some people wanted to paint the bikeshed green, some blue and some pink.
People argued and fought, when they finally agreed, only rust was left.


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 v3 2/2] random_seed: Improve behaviour with small timer increments with high precision timers

2025-02-06 Thread Martin Storsjö
On a Zen 5, on Ubuntu 24.04 (with CLOCKS_PER_SEC 100), the
value of clock() in this loop increments by 0 most of the time,
and when it does increment, it usually increments by 1 compared
to the previous round.

Due to the "last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t"
expression, we only manage to take one step forward in this loop
(incrementing i) if clock() increments by 2, while it incremented
by 0 in the previous iteration (last_td).

This is similar to the change done in
c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc, to speed it up on
systems with very small CLOCKS_PER_SEC. However in this case,
CLOCKS_PER_SEC is still very large, but the machine is fast enough
to hit every clock increment repeatedly.

For this case, use the number of repetitions of each timer value
as entropy source; require a change in the number of repetitions
in order to proceed to the next buffer index.

This helps the fate-random-seed test to actually terminate within
a reasonable time on such a system (where it previously could hang,
running for many minutes).
---
Store two historical numbers of repeats in addition to the current one.
---
 libavutil/random_seed.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index ca084b40da..19180a89aa 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -83,6 +83,7 @@ static uint32_t get_generic_seed(void)
 static uint32_t buffer[512] = { 0 };
 unsigned char digest[20];
 uint64_t last_i = i;
+int repeats[3] = { 0 };
 
 av_assert0(sizeof(tmp) >= av_sha_size);
 
@@ -101,8 +102,22 @@ static uint32_t get_generic_seed(void)
 int incremented_i = 0;
 int cur_td = t - last_t;
 if (last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) < t) {
+// If the timer incremented by more than 2*last_td at once,
+// we may e.g. have had a context switch. If the timer resolution
+// is high (CLOCKS_PER_SEC > 1000), require that the timer
+// incremented by more than 1. If the timer resolution is low,
+// it is enough that the timer incremented at all.
 buffer[++i & 511] += cur_td % 3294638521U;
 incremented_i = 1;
+} else if (t != last_t && repeats[0] > 0 && repeats[1] > 0 &&
+   repeats[2] > 0 && repeats[0] != repeats[1] &&
+   repeats[0] != repeats[2]) {
+// If the timer resolution is high, and we get the same timer
+// value multiple times, use variances in the number of repeats
+// of each timer value as entropy. If we get a different number of
+// repeats than the last two cases, proceed to the next index.
+buffer[++i & 511] += (repeats[0] + repeats[1] + repeats[2]) % 
3294638521U;
+incremented_i = 1;
 } else {
 buffer[i & 511] = 1664525*buffer[i & 511] + 1013904223 + (cur_td % 
3294638521U);
 }
@@ -110,6 +125,13 @@ static uint32_t get_generic_seed(void)
 if (last_i && i - last_i > 4 || i - last_i > 64 || TEST && i - 
last_i > 8)
 break;
 }
+if (t == last_t) {
+repeats[0]++;
+} else {
+for (int j = 2; j > 0; j--)
+repeats[j] = repeats[j - 1];
+repeats[0] = 0;
+}
 last_t = t;
 last_td = cur_td;
 if (!init_t)
-- 
2.43.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 v4 3/3] avcodec/hevc: Add alpha layer support

2025-02-06 Thread Zhao Zhili



> On Feb 6, 2025, at 21:26, James Almer  wrote:
> 
> On 2/6/2025 12:50 AM, Zhao Zhili wrote:
>> From: Zhao Zhili 
>> Signed-off-by: Zhao Zhili 
>> ---
>>  libavcodec/hevc/hevcdec.c | 72 ++-
>>  libavcodec/hevc/hevcdec.h |  2 ++
>>  libavcodec/hevc/refs.c| 11 +-
>>  3 files changed, 83 insertions(+), 2 deletions(-)
> 
> Can you please share the sample from the other day without requiring to 
> request for access to your google drive?

Sorry I have modified the permission but forgot to reply.

https://drive.google.com/file/d/1SK6gnMNlWODeTySpetNAKgNeqt69DQDz/view?usp=sharing

> 
> ___
> 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 4/8] avformat/flacdec: Return correct error-codes on read-failure

2025-02-06 Thread Michael Niedermayer
On Wed, Feb 05, 2025 at 03:20:30PM +0100, Tomas Härdin wrote:
> 

>  flacdec.c |   16 
>  1 file changed, 12 insertions(+), 4 deletions(-)
> da53ae8bb59c5ee934cc7ba809955e0446168675  
> 0004-avformat-flacdec-Return-correct-error-codes-on-read-.patch
> From c81e350d5419cf02f029ce006d94f257bc18fb97 Mon Sep 17 00:00:00 2001
> From: Ulrik 
> Date: Thu, 26 Jan 2023 17:51:02 +0100
> Subject: [PATCH 4/8] avformat/flacdec: Return correct error-codes on
>  read-failure
> 
> Forward errors from `avio_read` directly. When `avio_read` sees EOF before
> expected bytes can be read, consistently return `AVERROR_INVALIDDATA`
> 
> We used to return `AVERROR(AVERROR_INVALIDDATA)` when failing to read
> metadata block headers. `AVERROR_INVALIDDATA` is already negative, so
> wrapping in `AVERROR` leads to double-negation.
> 
> We used to return `AVERROR(EIO)` when failing to read extended metadata.
> However, many times, the IO-layer is not at fault, the input data is simply
> corrupted (truncated), so we return `AVERROR_INVALIDDATA` here as well.
> 
> ---
> 
> Tomas: changed to use AVERROR_EOF
> ---
>  libavformat/flacdec.c | 16 
>  1 file changed, 12 insertions(+), 4 deletions(-)

should be fine / LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


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] avutil/hwcontext_amf: fix crash on uninit after init failed

2025-02-06 Thread Dmitrii Ovchinnikov
LGTM,  Thanks. I will merge it soon.
___
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] Captions SCC

2025-02-06 Thread Jack Lau


> I have been absent from the list for a few years, so I would appreciate it
> if someone could catch me up a bit.  I am needing to extract and embed scc
> files with 608 captions.  I am pleased to see that transcoding without
> frame rate changes now preserves 608 intact, and there appear to be
> extraction and embed functions but they do seem to have bugs for my files
> at 1080p2997.  Are there any developers willing to take on a paid project
> to fix whatever is the issue?  Here are the commands I am working with.
> 
> Embed:
> "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -i
> "C:\Users\Captions\AIM-2301_premiereDF.mp4" -i
> "C:\Captions\AIM-2301_premiereDF.mp4.scc" -map 0:v -map 0:a -map 1 -c:v
> copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng
> "C:\Captions\AIM-2301_premiereDFcopy.mp4"
> 
> Extract:
> "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -f lavfi -i
> "movie=\'C:\\Captions\\AIM-2301_premiereDF_ffmpegEmbedscc.mp4\'"[out+subcc]
> -map 0:1 -c:s copy "C:\Captions\AIM-2301_premiereDF_ffmpegEmbedscc.scc”
> 


Hi,

I’ve reviewed the issue with embedding and extracting 608 SCC captions at 
1080p2997 resolution and identified a few areas that might help resolve the 
character duplication and data spill. Here's a summary of my findings:

The current command uses -c:s mov_text, but SCC files may work better with -c:s 
scc to preserve the format correctly.
The current command uses a filtergraph that might not map correctly for SCC 
extraction. Instead, try simplifying the extraction command: -map 0:s:0 -c:s 
copy
Frame Rate Issues: Ensure the video frame rate and the SCC file frame rate 
match. You might want to force a specific frame rate (e.g., -r 29.97).

Let me know if you have further questions.
___
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] fate/libswresample: add a test downmixing with a custom order layout

2025-02-06 Thread James Almer

On 2/6/2025 11:26 AM, Michael Niedermayer wrote:

Hi James

On Wed, Feb 05, 2025 at 11:46:32AM -0300, James Almer wrote:

Signed-off-by: James Almer 
---
  tests/fate/libswresample.mak   | 8 
  tests/filtergraphs/custom_rematrix | 1 +
  2 files changed, 9 insertions(+)
  create mode 100644 tests/filtergraphs/custom_rematrix

diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak
index a1e5ab91fa..aa4438a4bd 100644
--- a/tests/fate/libswresample.mak
+++ b/tests/fate/libswresample.mak
@@ -1097,5 +1097,13 @@ fate-swr-audioconvert: CMP = stddev
  fate-swr-audioconvert: FUZZ = 0
  
  FATE_SWR += $(FATE_SWR_AUDIOCONVERT-yes)

+
+FATE_SWR_CUSTOM_REMATRIX-$(call FILTERDEMDECENCMUX, ARESAMPLE CHANNELMAP 
AFORMAT, WAV, PCM_S16LE, PCM_S16LE, PCM_S16LE) += fate-swr-custom-rematrix
+fate-swr-custom-rematrix: tests/data/asynth-44100-8.wav 
tests/data/filtergraphs/custom_rematrix
+fate-swr-custom-rematrix: CMD = md5 -i 
$(TARGET_PATH)/tests/data/asynth-44100-8.wav -/filter_complex 
$(TARGET_PATH)/tests/data/filtergraphs/custom_rematrix -map [OUT] -f s16le
+fate-swr-custom-rematrix: CMP = oneline
+fate-swr-custom-rematrix: REF = 2a14a44deb4ae26e3b474ddbfbc048f8


not a huge fan of md5 based testing of downmixing as it provides just a
"same" vs "different"


Afaict, downmixing this sample to stereo using either 
FL+FR+FC+LFE+SL+SR+BL+BR (custom order) and 7.1 (native) as input layout 
will result in the same output given that both side and back channels 
are assigned the exact same coeffs, so this test is mainly just making 
sure swr doesn't reject the non-native input layout.




but patch ok

thx

[...]


___
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".




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".


Re: [FFmpeg-devel] [PATCH 1/2] libavcodec: add AV_CODEC_ID_IVTV_VBI

2025-02-06 Thread Marth64
Planning to push in 24-48 hours.
___
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] avcodec/hw_base_encode: log the readable error message on failure

2025-02-06 Thread Marth64
Planning to push in 24-48 hours.
___
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 2/2] avcodec: add a ffv1 parser

2025-02-06 Thread James Almer

On 2/6/2025 4:25 PM, Jerome Martinez wrote:

Le 06/02/2025 à 16:52, Michael Niedermayer a écrit :

On Sun, Feb 02, 2025 at 11:16:03PM -0300, James Almer wrote:

[...]
+    s->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P, see ffv1dec.c

id remove the comment, also in ffv1dec.c


For your information this resolves the issue with non working demux (raw 
copy) of FFV1 in MXF

https://trac.ffmpeg.org/ticket/10161


That problem was what prompted me to write it, but i wasn't aware this 
ticket existed.




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".


Re: [FFmpeg-devel] Up to Date DeckLink Support broken in FFMPEG

2025-02-06 Thread Marton Balint




On Wed, 5 Feb 2025, Leo Izen wrote:


On 2/5/25 4:44 PM, ffm...@gallery.co.uk wrote:

 Hi Folks

 It seems like the current decklink code in FFMPEG is no longer fully
 compatible with the latest Decklink drivers
 The behaviour seen is that output via DeckLink starts OK but very quickly
 stalls. Apparently its related to the callbacks.
 I believe this broken with BMD drivers 13.3 and later

 Has anyone here already fixed the FFMPEG code to work again ?

 If no-one has attempted this fix, I will give it a go, but if someone is
 ahead of me please let me know

 Thanks !!!

 Mark.



Feel free to take a look. The last change to the decklink code in FFmpeg was 
authored last april (not counting minor one-line bugfixes and the like) and 
as far as I am aware nobody is currently working on that so you wouldn't be 
redoing someone else's work.


There is a patch linked in the blackmagic forums:

https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=213592

Regards,
Marton
___
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 2/2] avcodec/vvc/refs: Check content_ref in set_pict_type()

2025-02-06 Thread Frank Plowman
On 02/02/2025 21:17, Michael Niedermayer wrote:
> Fixes: 
> 390565846/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-4990028521996288
> Fixes: Null pointer dereference
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vvc/refs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c
> index 486515d06db..1cfca482047 100644
> --- a/libavcodec/vvc/refs.c
> +++ b/libavcodec/vvc/refs.c
> @@ -186,7 +186,7 @@ static void set_pict_type(AVFrame *frame, const 
> VVCContext *s, const VVCFrameCon
>  const CodedBitstreamFragment *current = &s->current_frame;
>  for (int i = 0; i < current->nb_units && !has_b; i++) {
>  const CodedBitstreamUnit *unit = current->units + i;
> -if (unit->type <= VVC_RSV_IRAP_11) {
> +if (unit->content_ref && unit->type <= VVC_RSV_IRAP_11) {
>  const H266RawSliceHeader *rsh = unit->content_ref;
>  has_inter |= !IS_I(rsh);
>  has_b |= IS_B(rsh);

I did a little more sniffing around this.  unit->content and
unit->content_ref are NULL for NAL units with a type code corresponding
with a reserved or unspecified NAL unit type.  Due to the existing
condition on the NAL unit type being a VCL NAL unit type, this means
that unit->type will be in [4..6], which are all reserved.

Perhaps we might want to add a warning message or something similar
letting the user know some data is being skipped, particularly seeing as
we are talking about video data here?  On the other hand, if the
loglevel is set to verbose or above, cbs_read_fragment_content will
produce some log output which eludes to this, although it is a bit
obtuse as codec-specific information is not available there.  In any
case, I agree that adding the extra check on unit->content_ref is correct.

Thank you,
Frank

___
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 2/2] random_seed: Improve behaviour with small timer increments with high precision timers

2025-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2025 at 02:38:48PM +0200, Martin Storsjö wrote:
> On Thu, 6 Feb 2025, Michael Niedermayer wrote:
> 
> > > +// If the timer resolution is high, and we get the same timer
> > > +// value multiple times, use variances in the number of 
> > > repeats
> > > +// of each timer value as entropy. If the number of repeats 
> > > changed,
> > > +// proceed to the next index.
> > 
> > Does it still work if you check against the last 2 ?
> > or does this become too slow ?
> > What iam thinking of is this
> > 
> > 7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,... and a 9 or 6 or further distant 
> > would trigger it
> > 
> > I assume both the CPU clock and the wall time are quite precisse so if we
> > just compare them the entropy could be low even with 2 alternating values
> 
> Yes, that still works for making it terminate in a reasonable amount of
> time. I updated the patch to keep track of 3 numbers of repeats, and we
> consider that we got valid entropy once the new number of repeats is
> different from the last two.
> 
> So in the sequence above, e.g. for 7,8,7,8,8,7, at the point of the last
> one, we have old repeats 8 and 8, and the new repeat count 7, which in that
> context looks unique.

I was thinking that in 7,8,8 that 7 and 8 be the 2 least recent used
values not 8,8
that is, something like:

if (old2 == new) {
FFSWAP(old,old2);
} else if (old != new) {
old2 = old;
old = new;
}

but again, iam not sure this will work or just need too much time to gather
enough entropy

thx

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

Some people wanted to paint the bikeshed green, some blue and some pink.
People argued and fought, when they finally agreed, only rust was left.


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/ac3dec: add a flush callback for the eac3 decoder

2025-02-06 Thread James Almer
Fixes ticket #10732

Signed-off-by: James Almer 
---
 libavcodec/ac3dec.c   | 10 ++
 libavcodec/ac3dec.h   | 38 ++
 libavcodec/ac3dec_fixed.c |  1 +
 libavcodec/ac3dec_float.c |  1 +
 4 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ff8cbfb0b4..2cf82abc19 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -252,6 +252,16 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
 return 0;
 }
 
+static av_cold void ac3_decode_flush(AVCodecContext *avctx)
+{
+AC3DecodeContext *s = avctx->priv_data;
+
+memset(&s->frame_type, 0, sizeof(*s) - offsetof(AC3DecodeContext, 
frame_type));
+
+AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256);
+av_lfg_init(&s->dith_state, 0);
+}
+
 /**
  * Parse the 'sync info' and 'bit stream info' from the AC-3 bitstream.
  * GetBitContext within AC3DecodeContext must point to
diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h
index 98de7b5abf..cfaad446ab 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -75,8 +75,29 @@ typedef struct AC3DecodeContext {
 AVCodecContext *avctx;  ///< parent context
 GetBitContext gbc;  ///< bitstream reader
 
+AVTXContext *tx_128, *tx_256;
+av_tx_fn tx_fn_128, tx_fn_256;
+
+///@name Optimization
+BswapDSPContext bdsp;
+#if USE_FIXED
+AVFixedDSPContext *fdsp;
+#else
+AVFloatDSPContext *fdsp;
+#endif
+AC3DSPContext ac3dsp;
+FmtConvertContext fmt_conv; ///< optimized conversion functions
+///@}
+
+INTFLOAT *xcfptr[AC3_MAX_CHANNELS];
+INTFLOAT *dlyptr[AC3_MAX_CHANNELS];
+
+AVChannelLayout downmix_layout;
+
+// Start of flushable fields
 ///@name Bit stream information
 ///@{
+// frame_type must be first
 int frame_type; ///< frame type
 (strmtyp)
 int substreamid;///< substream identification
 int superframe_size;///< current superframe size, in 
bytes
@@ -222,24 +243,9 @@ typedef struct AC3DecodeContext {
 
 ///@name IMDCT
 int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags
 (blksw)
-AVTXContext *tx_128, *tx_256;
-av_tx_fn tx_fn_128, tx_fn_256;
-///@}
-
-///@name Optimization
-BswapDSPContext bdsp;
-#if USE_FIXED
-AVFixedDSPContext *fdsp;
-#else
-AVFloatDSPContext *fdsp;
-#endif
-AC3DSPContext ac3dsp;
-FmtConvertContext fmt_conv; ///< optimized conversion functions
 ///@}
 
 SHORTFLOAT *outptr[AC3_MAX_CHANNELS];
-INTFLOAT *xcfptr[AC3_MAX_CHANNELS];
-INTFLOAT *dlyptr[AC3_MAX_CHANNELS];
 
 ///@name Aligned arrays
 DECLARE_ALIGNED(16, int,   fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; 
  ///< fixed-point transform coefficients
@@ -252,7 +258,7 @@ typedef struct AC3DecodeContext {
 DECLARE_ALIGNED(32, SHORTFLOAT, 
output_buffer)[EAC3_MAX_CHANNELS][AC3_BLOCK_SIZE * 6];  ///< final output buffer
 ///@}
 
-AVChannelLayout downmix_layout;
+// End of flushable fields
 } AC3DecodeContext;
 
 /**
diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c
index e0db9b2260..e284140e74 100644
--- a/libavcodec/ac3dec_fixed.c
+++ b/libavcodec/ac3dec_fixed.c
@@ -181,6 +181,7 @@ const FFCodec ff_ac3_fixed_decoder = {
 .p.priv_class   = &ac3_decoder_class,
 .priv_data_size = sizeof (AC3DecodeContext),
 .init   = ac3_decode_init,
+.flush  = ac3_decode_flush,
 .close  = ac3_decode_end,
 FF_CODEC_DECODE_CB(ac3_decode_frame),
 .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c
index 53d9d472c4..aed34ec2e9 100644
--- a/libavcodec/ac3dec_float.c
+++ b/libavcodec/ac3dec_float.c
@@ -88,6 +88,7 @@ const FFCodec ff_eac3_decoder = {
 .p.id   = AV_CODEC_ID_EAC3,
 .priv_data_size = sizeof (AC3DecodeContext),
 .init   = ac3_decode_init,
+.flush  = ac3_decode_flush,
 .close  = ac3_decode_end,
 FF_CODEC_DECODE_CB(ac3_decode_frame),
 .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
-- 
2.48.1

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

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


Re: [FFmpeg-devel] [PATCH 8/8] Make mime-type award a bonus probe score

2025-02-06 Thread Michael Niedermayer
Hi Tomas

On Wed, Feb 05, 2025 at 03:24:24PM +0100, Tomas Härdin wrote:
> Seems reasonable to me and passes FATE
> 
> /Tomas

>  avformat.h   |2 +-
>  format.c |8 
>  libopenmpt.c |2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 01f04f79202640330d6be91b0215f92f14d1845a  
> 0008-Make-mime-type-award-a-bonus-probe-score.patch
> From ecc3459990f2871fd907f96fe66362b8fea41bd8 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Peter=20Zeb=C3=BChr?= 
> Date: Tue, 21 Nov 2023 14:16:49 +0100
> Subject: [PATCH 8/8] Make mime-type award a bonus probe score
> 
> This changes the default behaviour of ffmpeg where content-type headers
> on an input gives an absolut probe score (of 75) to instead give a bonus
> score (of 30). This gives the probe a better chance to arrive at the
> correct format by (hopefully) giving a large enough bonus to push edge
> cases in the right direction (MPEG-PS vs MP3, I am looking at you) while
> also not adversly punishing clearer cases (raw ADTS marked as
> "audio/mpeg" for example).
> 
> This patch was regression tested against 20 million recent podcast
> submissions (after content-type propagation was added to
> original-storage), and 50k Juno vodcasts submissions (dito). No adverse
> effects observed (but the bonus may still need tweaking if other edge
> cases are detected in production).
> ---
>  libavformat/avformat.h   | 2 +-
>  libavformat/format.c | 8 
>  libavformat/libopenmpt.c | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)

what is the score ?
a higher score means more likely but how much more ?
maybe we should come up with a more formal definition
like that score is the number of bits of entropy that where checked or
something like that.
in such a framework, adding 30 for a mime type match would probably
make sense

without such a framework, adding 30 to a abstract score is hard to
review
beyond that, i dont see anything breaking from this but then i
dont think we have real tests for mime types

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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 1/3] doc/encoders: Document compression_level for PNG

2025-02-06 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 doc/encoders.texi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index c0795fe5fd5..0005ade9c18 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -3395,6 +3395,13 @@ Default is 1 (on).
 
 PNG image encoder.
 
+@subsection Options
+
+@table @option
+@item compression_level
+Sets the compression level, from 0 to 9(default)
+@end table
+
 @subsection Private options
 
 @table @option
-- 
2.48.1

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

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


[FFmpeg-devel] [PATCH 2/3] avcodec/pngenc: set default prediction method to PAETH

2025-02-06 Thread Michael Niedermayer
this is a good compromise between speed and compression

-rw-r- 1 michael michael 180987 Feb  6 14:29 lena-def.png
-rw-r- 1 michael michael 128430 Feb  6 14:36 lena-pavg.png
-rw-r- 1 michael michael 126269 Feb  6 14:36 lena-pmixed.png
-rw-r- 1 michael michael 180987 Feb  6 14:35 lena-pnone.png
-rw-r- 1 michael michael 127758 Feb  6 14:35 lena-ppaeth.png

Signed-off-by: Michael Niedermayer 
---
 libavcodec/pngenc.c   | 2 +-
 tests/ref/fate/copy-apng  | 4 ++--
 tests/ref/fate/cover-art-aiff-id3v2-remux | 6 +++---
 tests/ref/fate/cover-art-flac-remux   | 6 +++---
 tests/ref/fate/cover-art-mp3-id3v2-remux  | 6 +++---
 tests/ref/fate/mov-cover-image| 6 +++---
 tests/ref/fate/png-icc| 6 +++---
 tests/ref/fate/png-mdcv   | 4 ++--
 tests/ref/lavf/apng   | 4 ++--
 tests/ref/lavf/apng.png   | 4 ++--
 tests/ref/lavf/gray16be.png   | 4 ++--
 tests/ref/lavf/png| 4 ++--
 tests/ref/lavf/rgb48be.png| 4 ++--
 tests/ref/vsynth/vsynth1-mpng | 4 ++--
 tests/ref/vsynth/vsynth2-mpng | 4 ++--
 tests/ref/vsynth/vsynth3-mpng | 4 ++--
 tests/ref/vsynth/vsynth_lena-mpng | 4 ++--
 17 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 37e8d5bfcf8..b9ef2a665a6 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -1205,7 +1205,7 @@ static av_cold int png_enc_close(AVCodecContext *avctx)
 static const AVOption options[] = {
 {"dpi", "Set image resolution (in dots per inch)",  OFFSET(dpi), 
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x1, VE},
 {"dpm", "Set image resolution (in dots per meter)", OFFSET(dpm), 
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x1, VE},
-{ "pred", "Prediction method", OFFSET(filter_type), AV_OPT_TYPE_INT, { 
.i64 = PNG_FILTER_VALUE_NONE }, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED, 
VE, .unit = "pred" },
+{ "pred", "Prediction method", OFFSET(filter_type), AV_OPT_TYPE_INT, { 
.i64 = PNG_FILTER_VALUE_PAETH }, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED, 
VE, .unit = "pred" },
 { "none",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_NONE 
},  INT_MIN, INT_MAX, VE, .unit = "pred" },
 { "sub",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_SUB 
},   INT_MIN, INT_MAX, VE, .unit = "pred" },
 { "up",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_UP }, 
   INT_MIN, INT_MAX, VE, .unit = "pred" },
diff --git a/tests/ref/fate/copy-apng b/tests/ref/fate/copy-apng
index 3057573cee1..659cec3d6e1 100644
--- a/tests/ref/fate/copy-apng
+++ b/tests/ref/fate/copy-apng
@@ -1,5 +1,5 @@
-a4c46fad7716ad094eb3c78b74ca0244 *tests/data/fate/copy-apng.apng
-6209864 tests/data/fate/copy-apng.apng
+963d078c8702a77b362c5b7c508fa447 *tests/data/fate/copy-apng.apng
+3911913 tests/data/fate/copy-apng.apng
 #tb 0: 1/25
 #media_type 0: video
 #codec_id 0: rawvideo
diff --git a/tests/ref/fate/cover-art-aiff-id3v2-remux 
b/tests/ref/fate/cover-art-aiff-id3v2-remux
index 57c5a9f3873..096afb73e55 100644
--- a/tests/ref/fate/cover-art-aiff-id3v2-remux
+++ b/tests/ref/fate/cover-art-aiff-id3v2-remux
@@ -1,5 +1,5 @@
-d8caddad3af3879f5957f71adcaedd23 
*tests/data/fate/cover-art-aiff-id3v2-remux.aiff
-608970 tests/data/fate/cover-art-aiff-id3v2-remux.aiff
+af437d72614dac36a80091f9f4182b75 
*tests/data/fate/cover-art-aiff-id3v2-remux.aiff
+558574 tests/data/fate/cover-art-aiff-id3v2-remux.aiff
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: pcm_s16be
@@ -27,7 +27,7 @@ d8caddad3af3879f5957f71adcaedd23 
*tests/data/fate/cover-art-aiff-id3v2-remux.aif
 #sar 4: 1/1
 0,  0,  0, 1024, 4096, 0xdac4695d
 1,  0,  0,0,19650, 0xd5662610
-2,  0,  0,0,   184497, 0xc33f8d44
+2,  0,  0,0,   134100, 0x804dcb53
 3,  0,  0,0,   368254, 0xfa7f4bd8
 4,  0,  0,0,19650, 0xd5662610
 0,   1024,   1024, 1024, 4096, 0xad05c909
diff --git a/tests/ref/fate/cover-art-flac-remux 
b/tests/ref/fate/cover-art-flac-remux
index 109bf7395e2..35325b11a03 100644
--- a/tests/ref/fate/cover-art-flac-remux
+++ b/tests/ref/fate/cover-art-flac-remux
@@ -1,5 +1,5 @@
-6defc5081a59ab12c8a5f9e263b25068 *tests/data/fate/cover-art-flac-remux.flac
-1098537 tests/data/fate/cover-art-flac-remux.flac
+2535b1a3c759250e7f470ece217971a4 *tests/data/fate/cover-art-flac-remux.flac
+964234 tests/data/fate/cover-art-flac-remux.flac
 #extradata 0:   34, 0x8d830abd
 #tb 0: 1/44100
 #media_type 0: audio
@@ -38,7 +38,7 @@
 #channel_layout_name 6: 2 channels (FL+FC)
 0,  0,  0, 4608,   14, 0x242b036d
 1,  0,  0,0,66888, 0x1fd72743
-2,  0,  0,0,   438706, 0x8bcb753b
+2,  0,  0,0,   304403, 

Re: [FFmpeg-devel] [PATCH v4 3/3] avcodec/hevc: Add alpha layer support

2025-02-06 Thread James Almer

On 2/6/2025 11:32 AM, James Almer wrote:

On 2/6/2025 11:06 AM, Zhao Zhili wrote:




On Feb 6, 2025, at 21:26, James Almer  wrote:

On 2/6/2025 12:50 AM, Zhao Zhili wrote:

From: Zhao Zhili 
Signed-off-by: Zhao Zhili 
---
  libavcodec/hevc/hevcdec.c | 72 +++ 
+++-

  libavcodec/hevc/hevcdec.h |  2 ++
  libavcodec/hevc/refs.c    | 11 +-
  3 files changed, 83 insertions(+), 2 deletions(-)


Can you please share the sample from the other day without requiring 
to request for access to your google drive?


Sorry I have modified the permission but forgot to reply.

https://drive.google.com/file/d/1SK6gnMNlWODeTySpetNAKgNeqt69DQDz/ 
view?usp=sharing


Thanks. That sample however doesn't really showcase the alpha layer 
doing anything. Can't you generate a sample with videotoolbox out of 
some apng, webp or similar source with alpha where the transparency is 
noticeable? The FATE suite has a couple.


Oh, nevermind, it looks like ffplay outputs yuv420p instead of yuva420p.



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".


[FFmpeg-devel] [PATCH] threadprogress: reorder instructions to silence tsan warning.

2025-02-06 Thread Ronald S. Bultje
Fixes #11456.
---
 libavcodec/threadprogress.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/threadprogress.c b/libavcodec/threadprogress.c
index 62c4fd898b..aa72ff80e7 100644
--- a/libavcodec/threadprogress.c
+++ b/libavcodec/threadprogress.c
@@ -55,9 +55,8 @@ void ff_thread_progress_report(ThreadProgress *pro, int n)
 if (atomic_load_explicit(&pro->progress, memory_order_relaxed) >= n)
 return;
 
-atomic_store_explicit(&pro->progress, n, memory_order_release);
-
 ff_mutex_lock(&pro->progress_mutex);
+atomic_store_explicit(&pro->progress, n, memory_order_release);
 ff_cond_broadcast(&pro->progress_cond);
 ff_mutex_unlock(&pro->progress_mutex);
 }
-- 
2.48.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 v3 0/3] Add option to log timing

2025-02-06 Thread Marth64
> it would probably also be odd when there's a single white space in-between.
Yes, it would look worse on white background. OK as is, then.

> Why wouldn't it be machine-parsable without those letters?
It is more about having timezone, etc.
I actually think it is better for readability as is, but was checking
if preservation for machine parsing* (phrasing what I meant
better) was a goal, then it should be compliant. But I don't see much
value in that.

Thanks
___
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] lavc/hevcdec: fix crash when ff_h2645_sei_to_frame modifies avctx->properties

2025-02-06 Thread Thinh Nguyen Huu
Hello.
I discovered this issue while using the *release/6.1* branch.
Could you try applying the patch on this branch?

On Fri, Feb 7, 2025 at 11:10 AM Marth64  wrote:

> Hello,
> Patch fails to apply (looks like a rebase needed since I see the path
> of hevcdec.c is older).
> Also a sample or context to trigger the condition would be nice to
> validation.
> Thank you
>


-- 
NGUYEN HUU THINH
Phone: 0978813120
Email: nguyenhuuthinh1...@gmail.com
___ University Of Science - VNUHCM ___
___
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 v3 0/3] Add option to log timing

2025-02-06 Thread Marth64
I meant obscure in the context of running ffmpeg CLI in a short lived
(<1 day) session for the average user.

Nonetheless I am good. Thanks!
___
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] lavc/hevcdec: fix crash when ff_h2645_sei_to_frame modifies avctx->properties

2025-02-06 Thread Marth64
Hello,
Yes I can, thanks for sharing that.
Can you share a sample or steps to reproduce?
___
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 v4 0/3] Add option to log timing

2025-02-06 Thread ffmpegagent
This pathcset adds two logging flags: 'timing' and 'datetiming'.

Usage:

ffmpeg -loglevel +timing

or

ffmpeg -loglevel +datetiming

Update V1

 * Fix merge conflicts

Update V2

 * Rebased

Update V3

 * Fix print timing on exit (as reported by Michael Niedermayer)

softworkz (3):
  avutil/log: support logging of date and timing information
  fftools/opt_common: add timing and datetiming log flags
  doc/fftools-common-opts: document log timing flags

 doc/APIchanges   |  3 +++
 doc/fftools-common-opts.texi |  4 
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 libavutil/log.c  | 32 +---
 libavutil/log.h  | 10 ++
 libavutil/version.h  |  2 +-
 7 files changed, 60 insertions(+), 4 deletions(-)


base-commit: 4ba9ae7742a6f8a29d6486e25ff5709a075edb5b
Published-As: 
https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-37%2Fsoftworkz%2Fsubmit_logtiming-v4
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-37/softworkz/submit_logtiming-v4
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/37

Range-diff vs v3:

 1:  13a7dc164b ! 1:  2871595d3b avutil/log: support logging of date and timing 
information
 @@ libavutil/log.c: static const char *item_name(void *obj, const AVClass 
*cls)
   return (cls->item_name ? cls->item_name : av_default_item_name)(obj);
   }
   
 -+static void format_date_now(AVBPrint* timeBuf, int include_date)
 ++static void format_date_now(AVBPrint* bp_time, int include_date)
  +{
  +struct tm *ptm, tmbuf;
  +const int64_t time_us = av_gettime();
 @@ libavutil/log.c: static const char *item_name(void *obj, const AVClass 
*cls)
  +ptm   = localtime_r(&time_s, &tmbuf);
  +if (ptm) {
  +if (include_date)
 -+av_bprint_strftime(timeBuf, "%Y-%m-%d ", ptm);
 ++av_bprint_strftime(bp_time, "%Y-%m-%d ", ptm);
  +
 -+av_bprint_strftime(timeBuf, "%H:%M:%S", ptm);
 -+av_bprintf(timeBuf, ".%03d ", millisec);
 ++av_bprint_strftime(bp_time, "%H:%M:%S", ptm);
 ++av_bprintf(bp_time, ".%03d ", millisec);
  +}
  +}
  +
 2:  6c435fc02d ! 2:  aed251e1f5 fftools/opt_common: add timing and datetiming 
log flags
 @@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, 
const char
   } else {
   flags |= AV_LOG_PRINT_LEVEL;
   }
 -+} else if (av_strstart(token, "timing", &arg)) {
 ++} else if (av_strstart(token, "time", &arg)) {
  +if (cmd == '-') {
  +flags &= ~AV_LOG_PRINT_TIME;
  +} else {
  +flags |= AV_LOG_PRINT_TIME;
  +}
 -+} else if (av_strstart(token, "datetiming", &arg)) {
 ++} else if (av_strstart(token, "datetime", &arg)) {
  +if (cmd == '-') {
  +flags &= ~AV_LOG_PRINT_DATETIME;
  +} else {
 3:  f0aa91d5c1 ! 3:  600020f36e doc/fftools-common-opts: document log timing 
flags
 @@ doc/fftools-common-opts.texi: and the "Last message repeated n times" 
line will
   Indicates that log output should add a @code{[level]} prefix to each 
message
   line. This can be used as an alternative to log coloring, e.g. when 
dumping the
   log to file.
 -+@item timing
 -+Indicates that log lines should be prefixed with timing information.
 -+@item datetiming
 -+Indicates that log lines should be prefixed with date and timing 
information.
 ++@item time
 ++Indicates that log lines should be prefixed with time information.
 ++@item datetime
 ++Indicates that log lines should be prefixed with date and time 
information.
   @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".


[FFmpeg-devel] [PATCH v4 1/3] avutil/log: support logging of date and timing information

2025-02-06 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/APIchanges  |  3 +++
 libavutil/log.c | 32 +---
 libavutil/log.h | 10 ++
 libavutil/version.h |  2 +-
 4 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 0f2b640601..83d57ae314 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2025-01-xx - xx - lavu 59.57.100 - log.h
+  Add flags AV_LOG_PRINT_TIME and AV_LOG_PRINT_DATETIME.
+
 2025-01-25 - xx - lavu 59.56.100 - frame.h
   Add AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT.
 
diff --git a/libavutil/log.c b/libavutil/log.c
index 46662f3db0..2fe21d4900 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -42,6 +42,8 @@
 #include "internal.h"
 #include "log.h"
 #include "thread.h"
+#include "time.h"
+#include "time_internal.h"
 
 static AVMutex mutex = AV_MUTEX_INITIALIZER;
 
@@ -296,14 +298,32 @@ static const char *item_name(void *obj, const AVClass 
*cls)
 return (cls->item_name ? cls->item_name : av_default_item_name)(obj);
 }
 
+static void format_date_now(AVBPrint* bp_time, int include_date)
+{
+struct tm *ptm, tmbuf;
+const int64_t time_us = av_gettime();
+const int64_t time_ms = time_us / 1000;
+const time_t time_s   = time_ms / 1000;
+const int millisec= time_ms - (time_s * 1000);
+ptm   = localtime_r(&time_s, &tmbuf);
+if (ptm) {
+if (include_date)
+av_bprint_strftime(bp_time, "%Y-%m-%d ", ptm);
+
+av_bprint_strftime(bp_time, "%H:%M:%S", ptm);
+av_bprintf(bp_time, ".%03d ", millisec);
+}
+}
+
 static void format_line(void *avcl, int level, const char *fmt, va_list vl,
-AVBPrint part[4], int *print_prefix, int type[2])
+AVBPrint part[5], int *print_prefix, int type[2])
 {
 AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
 av_bprint_init(part+0, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+1, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+2, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+3, 0, 65536);
+av_bprint_init(part+4, 0, AV_BPRINT_SIZE_AUTOMATIC);
 
 if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
 if (*print_prefix && avc) {
@@ -321,6 +341,9 @@ static void format_line(void *avcl, int level, const char 
*fmt, va_list vl,
 if(type) type[1] = get_category(avcl);
 }
 
+if (*print_prefix && (flags & (AV_LOG_PRINT_TIME | AV_LOG_PRINT_DATETIME)))
+format_date_now(&part[4], flags & AV_LOG_PRINT_DATETIME);
+
 if (*print_prefix && (level > AV_LOG_QUIET) && (flags & 
AV_LOG_PRINT_LEVEL))
 av_bprintf(part+2, "[%s] ", get_level_str(level));
 
@@ -341,7 +364,7 @@ void av_log_format_line(void *ptr, int level, const char 
*fmt, va_list vl,
 int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
 char *line, int line_size, int *print_prefix)
 {
-AVBPrint part[4];
+AVBPrint part[5];
 int ret;
 
 format_line(ptr, level, fmt, vl, part, print_prefix, NULL);
@@ -355,7 +378,7 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 static int print_prefix = 1;
 static int count;
 static char prev[LINE_SZ];
-AVBPrint part[4];
+AVBPrint part[5];
 char line[LINE_SZ];
 static int is_atty;
 int type[2];
@@ -390,6 +413,9 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 count = 0;
 }
 strcpy(prev, line);
+
+sanitize(part[4].str);
+colored_fputs(7, 0, part[4].str);
 sanitize(part[0].str);
 colored_fputs(type[0], 0, part[0].str);
 sanitize(part[1].str);
diff --git a/libavutil/log.h b/libavutil/log.h
index 4c8c92266f..dd094307ce 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -406,6 +406,16 @@ int av_log_format_line2(void *ptr, int level, const char 
*fmt, va_list vl,
  */
 #define AV_LOG_PRINT_LEVEL 2
 
+/**
+ * Include system time in log output.
+ */
+#define AV_LOG_PRINT_TIME 4
+
+/**
+ * Include system date and time in log output.
+ */
+#define AV_LOG_PRINT_DATETIME 8
+
 void av_log_set_flags(int arg);
 int av_log_get_flags(void);
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 83b7822125..ee4a36cb17 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  56
+#define LIBAVUTIL_VERSION_MINOR  57
 #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".


[FFmpeg-devel] [PATCH v4 2/3] fftools/opt_common: add timing and datetiming log flags

2025-02-06 Thread softworkz
From: softworkz 

This commit adds two logging flags: 'timing' and 'datetiming'.

Usage:

ffmpeg -loglevel +timing

or

ffmpeg -loglevel +datetiming

Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
timing to be printed when exiting.

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 2 files changed, 13 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..f4c717afaa 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -130,6 +130,7 @@ static void term_exit_sigsafe(void)
 
 void term_exit(void)
 {
+av_log_set_flags(0);
 av_log(NULL, AV_LOG_QUIET, "%s", "");
 term_exit_sigsafe();
 }
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 34da2cee7d..317e8458c1 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1292,6 +1292,18 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_LEVEL;
 }
+} else if (av_strstart(token, "time", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_TIME;
+} else {
+flags |= AV_LOG_PRINT_TIME;
+}
+} else if (av_strstart(token, "datetime", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_DATETIME;
+} else {
+flags |= AV_LOG_PRINT_DATETIME;
+}
 } 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 v4 3/3] doc/fftools-common-opts: document log timing flags

2025-02-06 Thread softworkz
From: softworkz 

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

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 8b0931a86d..f6d452c40e 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be 
omitted.
 Indicates that log output should add a @code{[level]} prefix to each message
 line. This can be used as an alternative to log coloring, e.g. when dumping the
 log to file.
+@item time
+Indicates that log lines should be prefixed with time information.
+@item datetime
+Indicates that log lines should be prefixed with date and time information.
 @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] Captions SCC

2025-02-06 Thread Soft Works
> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Devlist Archive
> Sent: Friday, February 7, 2025 6:13 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] Captions SCC
> 
> On Thu, Feb 6, 2025 at 4:57 AM Jack Lau 
> wrote:
> 
> >
> >
> > > I have been absent from the list for a few years, so I would
> appreciate
> > it
> > > if someone could catch me up a bit.  I am needing to extract and
> embed
> > scc
> > > files with 608 captions.  I am pleased to see that transcoding
> without
> > > frame rate changes now preserves 608 intact, and there appear to
> be
> > > extraction and embed functions but they do seem to have bugs for
> my files
> > > at 1080p2997.  Are there any developers willing to take on a paid
> project
> > > to fix whatever is the issue?  Here are the commands I am working
> with.
> > >
> > > Embed:
> > > "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -i
> > > "C:\Users\Captions\AIM-2301_premiereDF.mp4" -i
> > > "C:\Captions\AIM-2301_premiereDF.mp4.scc" -map 0:v -map 0:a -map
> 1 -c:v
> > > copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng
> > > "C:\Captions\AIM-2301_premiereDFcopy.mp4"
> > >
> > > Extract:
> > > "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -f lavfi -i
> > >
> > "movie=\'C:\\Captions\\AIM-
> 2301_premiereDF_ffmpegEmbedscc.mp4\'"[out+subcc]
> > > -map 0:1 -c:s copy "C:\Captions\AIM-
> 2301_premiereDF_ffmpegEmbedscc.scc”
> > >
> >
> >
> > Hi,
> >
> > I’ve reviewed the issue with embedding and extracting 608 SCC
> captions at
> > 1080p2997 resolution and identified a few areas that might help
> resolve the
> > character duplication and data spill. Here's a summary of my
> findings:
> >
> > The current command uses -c:s mov_text, but SCC files may work
> better with
> > -c:s scc to preserve the format correctly.
> > The current command uses a filtergraph that might not map correctly
> for
> > SCC extraction. Instead, try simplifying the extraction command: -
> map 0:s:0
> > -c:s copy
> > Frame Rate Issues: Ensure the video frame rate and the SCC file
> frame rate
> > match. You might want to force a specific frame rate (e.g., -r
> 29.97).
> >
> > Let me know if you have further questions.
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

> Hi Jack,
> 
> Thanks for the suggestions.  Could you please tell me where I can get
> a
> build of ffmpeg that will work with the -c:s scc command?  That
> encoder
> doesn't seem to be in the release version I am working with.
> 
> It is slightly unclear to me how your suggestion for the extract
> command
> suggestion should be implemented.  All of my media files I am working
> with
> now are the same frame rate, but forcing a frame rate prior to
> embedding is
> probably a good idea.  I had assumed there were still bugs in the
> code for
> this, but it would be nice if extraction/embedding could work without
> having to  change more.
> 
> Zach


Hi Zack,

that message from "Jack" had confused me for a moment, but on re-reading it 
appears to be an AI response.
The content is total nonsense. There is no "SCC" encoder in ffmpeg, and if 
there was one, it wouldn't help much because the CC data needs to get into the 
video frames - so that it exists as input to the video encoder.
For the same reason, it is also not possible to add CCs at the muxer level. It 
always requires video encoding because the data needs to get into the video 
stream itself, so there's no way to get data from an SCC file into a video 
stream currently.

The only way in the ffmpeg architecture to get CC data encoded would be at the 
filtering level. The Subtitle Filtering patchset that I have submitted a while 
ago has a "splitcc" filter which has video as input and a video plus a subtitle 
pin/pad at the output side.
What would be needed is a reverse pendant like a "mergecc" filter with video 
and subtitles input - plus a CEA-608/708 encoder.

softworkz



___
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 v5 1/3] avutil/log: support logging of date and time information

2025-02-06 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/APIchanges  |  3 +++
 libavutil/log.c | 32 +---
 libavutil/log.h | 10 ++
 libavutil/version.h |  2 +-
 4 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 0f2b640601..83d57ae314 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2025-01-xx - xx - lavu 59.57.100 - log.h
+  Add flags AV_LOG_PRINT_TIME and AV_LOG_PRINT_DATETIME.
+
 2025-01-25 - xx - lavu 59.56.100 - frame.h
   Add AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT.
 
diff --git a/libavutil/log.c b/libavutil/log.c
index 46662f3db0..2fe21d4900 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -42,6 +42,8 @@
 #include "internal.h"
 #include "log.h"
 #include "thread.h"
+#include "time.h"
+#include "time_internal.h"
 
 static AVMutex mutex = AV_MUTEX_INITIALIZER;
 
@@ -296,14 +298,32 @@ static const char *item_name(void *obj, const AVClass 
*cls)
 return (cls->item_name ? cls->item_name : av_default_item_name)(obj);
 }
 
+static void format_date_now(AVBPrint* bp_time, int include_date)
+{
+struct tm *ptm, tmbuf;
+const int64_t time_us = av_gettime();
+const int64_t time_ms = time_us / 1000;
+const time_t time_s   = time_ms / 1000;
+const int millisec= time_ms - (time_s * 1000);
+ptm   = localtime_r(&time_s, &tmbuf);
+if (ptm) {
+if (include_date)
+av_bprint_strftime(bp_time, "%Y-%m-%d ", ptm);
+
+av_bprint_strftime(bp_time, "%H:%M:%S", ptm);
+av_bprintf(bp_time, ".%03d ", millisec);
+}
+}
+
 static void format_line(void *avcl, int level, const char *fmt, va_list vl,
-AVBPrint part[4], int *print_prefix, int type[2])
+AVBPrint part[5], int *print_prefix, int type[2])
 {
 AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
 av_bprint_init(part+0, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+1, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+2, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+3, 0, 65536);
+av_bprint_init(part+4, 0, AV_BPRINT_SIZE_AUTOMATIC);
 
 if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
 if (*print_prefix && avc) {
@@ -321,6 +341,9 @@ static void format_line(void *avcl, int level, const char 
*fmt, va_list vl,
 if(type) type[1] = get_category(avcl);
 }
 
+if (*print_prefix && (flags & (AV_LOG_PRINT_TIME | AV_LOG_PRINT_DATETIME)))
+format_date_now(&part[4], flags & AV_LOG_PRINT_DATETIME);
+
 if (*print_prefix && (level > AV_LOG_QUIET) && (flags & 
AV_LOG_PRINT_LEVEL))
 av_bprintf(part+2, "[%s] ", get_level_str(level));
 
@@ -341,7 +364,7 @@ void av_log_format_line(void *ptr, int level, const char 
*fmt, va_list vl,
 int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
 char *line, int line_size, int *print_prefix)
 {
-AVBPrint part[4];
+AVBPrint part[5];
 int ret;
 
 format_line(ptr, level, fmt, vl, part, print_prefix, NULL);
@@ -355,7 +378,7 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 static int print_prefix = 1;
 static int count;
 static char prev[LINE_SZ];
-AVBPrint part[4];
+AVBPrint part[5];
 char line[LINE_SZ];
 static int is_atty;
 int type[2];
@@ -390,6 +413,9 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 count = 0;
 }
 strcpy(prev, line);
+
+sanitize(part[4].str);
+colored_fputs(7, 0, part[4].str);
 sanitize(part[0].str);
 colored_fputs(type[0], 0, part[0].str);
 sanitize(part[1].str);
diff --git a/libavutil/log.h b/libavutil/log.h
index 4c8c92266f..dd094307ce 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -406,6 +406,16 @@ int av_log_format_line2(void *ptr, int level, const char 
*fmt, va_list vl,
  */
 #define AV_LOG_PRINT_LEVEL 2
 
+/**
+ * Include system time in log output.
+ */
+#define AV_LOG_PRINT_TIME 4
+
+/**
+ * Include system date and time in log output.
+ */
+#define AV_LOG_PRINT_DATETIME 8
+
 void av_log_set_flags(int arg);
 int av_log_get_flags(void);
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 83b7822125..ee4a36cb17 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  56
+#define LIBAVUTIL_VERSION_MINOR  57
 #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".


[FFmpeg-devel] [PATCH v5 0/3] Add option to log timing

2025-02-06 Thread ffmpegagent
This commit adds two logging flags: 'time' and 'datetime'.

Usage:

ffmpeg -loglevel +time

or

ffmpeg -loglevel +datetime

Update V1

 * Fix merge conflicts

Update V2

 * Rebased

Update V3

 * Fix print timing on exit (as reported by Michael Niedermayer)

Update V4

 * Rename variable
 * Rename flags to time and datetime (as suggested by Marth64)

Update V5

 * Fix commit message (as noted by epirat07)

softworkz (3):
  avutil/log: support logging of date and time information
  fftools/opt_common: add time and datetime log flags
  doc/fftools-common-opts: document log timing flags

 doc/APIchanges   |  3 +++
 doc/fftools-common-opts.texi |  4 
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 libavutil/log.c  | 32 +---
 libavutil/log.h  | 10 ++
 libavutil/version.h  |  2 +-
 7 files changed, 60 insertions(+), 4 deletions(-)


base-commit: 4ba9ae7742a6f8a29d6486e25ff5709a075edb5b
Published-As: 
https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-37%2Fsoftworkz%2Fsubmit_logtiming-v5
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-37/softworkz/submit_logtiming-v5
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/37

Range-diff vs v4:

 1:  2871595d3b ! 1:  dae6bd3210 avutil/log: support logging of date and timing 
information
 @@ Metadata
  Author: softworkz 
  
   ## Commit message ##
 -avutil/log: support logging of date and timing information
 +avutil/log: support logging of date and time information
  
  Signed-off-by: softworkz 
  
 2:  aed251e1f5 ! 2:  63ab3a9411 fftools/opt_common: add timing and datetiming 
log flags
 @@ Metadata
  Author: softworkz 
  
   ## Commit message ##
 -fftools/opt_common: add timing and datetiming log flags
 +fftools/opt_common: add time and datetime log flags
  
 -This commit adds two logging flags: 'timing' and 'datetiming'.
 +This commit adds two logging flags: 'time' and 'datetime'.
  
  Usage:
  
 -ffmpeg -loglevel +timing
 +ffmpeg -loglevel +time
  
  or
  
 -ffmpeg -loglevel +datetiming
 +ffmpeg -loglevel +datetime
  
  Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
  timing to be printed when exiting.
 3:  600020f36e = 3:  038cbf45ed doc/fftools-common-opts: document log timing 
flags

-- 
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 v5 3/3] doc/fftools-common-opts: document log timing flags

2025-02-06 Thread softworkz
From: softworkz 

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

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 8b0931a86d..f6d452c40e 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be 
omitted.
 Indicates that log output should add a @code{[level]} prefix to each message
 line. This can be used as an alternative to log coloring, e.g. when dumping the
 log to file.
+@item time
+Indicates that log lines should be prefixed with time information.
+@item datetime
+Indicates that log lines should be prefixed with date and time information.
 @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] Captions SCC

2025-02-06 Thread Jack Lau
> 
> 
> Hi Zack,
> 
> that message from "Jack" had confused me for a moment, but on re-reading it 
> appears to be an AI response.
> The content is total nonsense. There is no "SCC" encoder in ffmpeg, and if 
> there was one, it wouldn't help much because the CC data needs to get into 
> the video frames - so that it exists as input to the video encoder.
> For the same reason, it is also not possible to add CCs at the muxer level. 
> It always requires video encoding because the data needs to get into the 
> video stream itself, so there's no way to get data from an SCC file into a 
> video stream currently.
> 
> The only way in the ffmpeg architecture to get CC data encoded would be at 
> the filtering level. The Subtitle Filtering patchset that I have submitted a 
> while ago has a "splitcc" filter which has video as input and a video plus a 
> subtitle pin/pad at the output side.
> What would be needed is a reverse pendant like a "mergecc" filter with video 
> and subtitles input - plus a CEA-608/708 encoder.
> 
> softworkz
> 


Hi softworkz,

Sorry about that, The response is indeed from AI. I thought this question was 
enough for AI to answer, I will pay attention to it next time.

Thank you for pointing it out.

Jack
___
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 v5 2/3] fftools/opt_common: add time and datetime log flags

2025-02-06 Thread softworkz
From: softworkz 

This commit adds two logging flags: 'time' and 'datetime'.

Usage:

ffmpeg -loglevel +time

or

ffmpeg -loglevel +datetime

Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
timing to be printed when exiting.

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 2 files changed, 13 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..f4c717afaa 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -130,6 +130,7 @@ static void term_exit_sigsafe(void)
 
 void term_exit(void)
 {
+av_log_set_flags(0);
 av_log(NULL, AV_LOG_QUIET, "%s", "");
 term_exit_sigsafe();
 }
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 34da2cee7d..317e8458c1 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1292,6 +1292,18 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_LEVEL;
 }
+} else if (av_strstart(token, "time", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_TIME;
+} else {
+flags |= AV_LOG_PRINT_TIME;
+}
+} else if (av_strstart(token, "datetime", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_DATETIME;
+} else {
+flags |= AV_LOG_PRINT_DATETIME;
+}
 } 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".


Re: [FFmpeg-devel] [PATCH] avformat/hls: Revert "reduce default max reload to 3"

2025-02-06 Thread Soft Works
> -Original Message-
> From: softworkz 
> Sent: Sunday, January 19, 2025 9:53 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: softworkz ; softworkz
> 
> Subject: [PATCH] avformat/hls: Revert "reduce default max reload to
> 3"
> 
> From: softworkz 
> 
> This change has caused regressions for many users and consumers.
> Playlist reloads only happen when a playlist doesn't indicate that it
> has ended (via #EXT-X-ENDLIST), which means that the addition of
> future
> segments is still expected.
> It is well possible that an HLS server is temporarily unable to serve
> further segments but resumes after some time, either indicating a
> discontinuity or even by fully catching up.
> With a segment length of 3s, a max_reload value of 1000 corresponds
> to
> a duration of 50 minutes which appears to be a reasonable default.
> ---
> avformat/hls: Revert "reduce default max reload to 3"
> 
> This change has caused regressions for many users and consumers.
> Playlist reloads only happen when a playlist doesn't indicate
> that it
> has ended (via #EXT-X-ENDLIST), which means that the addition of
> future
> segments is still expected. It is well possible that an HLS
> server is
> temporarily unable to serve further segments but resumes after
> some
> time, either indicating a discontinuity or even by fully catching
> up.
> With a segment length of 3s, a max_reload value of 1000
> corresponds to a
> duration of 50 minutes which appears to be a reasonable default.
> 
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-
> ffstaging-51%2Fsoftworkz%2Fsubmit_hls_reload-v1
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-
> ffstaging-51/softworkz/submit_hls_reload-v1
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/51
> 
>  libavformat/hls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index 045741c3b4..426cf30f70 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -2577,7 +2577,7 @@ static const AVOption hls_options[] = {
>  {.str =
> "3gp,aac,avi,ac3,eac3,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,m
> peg,mpegts,ogg,ogv,oga,ts,vob,wav"},
>  INT_MIN, INT_MAX, FLAGS},
>  {"max_reload", "Maximum number of times a insufficient list is
> attempted to be reloaded",
> -OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 3}, 0, INT_MAX,
> FLAGS},
> +OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0,
> INT_MAX, FLAGS},
>  {"m3u8_hold_counters", "The maximum number of times to load m3u8
> when it refreshes without new segments",
>  OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000},
> 0, INT_MAX, FLAGS},
>  {"http_persistent", "Use persistent HTTP connections",
> 
> base-commit: ced9fddec0e45e1ce1b3425a1fed66af971e934c
> --
> ffmpeg-codebot


PING - Maybe this wasn't recognizable as a patch due to the long text..

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 v3 0/3] Add option to log timing

2025-02-06 Thread Marth64
The example I was thinking of was if I wanted to look at the logs 2
years later, it would have time zone in case of DST or whatever.
But it's a total obscure stretch case IMO. I'm not advocating for it,
just sharing what I meant with my logic.
(And if someone really needs it later they can make a +rfc3339 switch
or whatever)
___
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] Captions SCC

2025-02-06 Thread Devlist Archive
Hi Jack,

Thanks for the suggestions.  Could you please tell me where I can get a
build of ffmpeg that will work with the -c:s scc command?  That encoder
doesn't seem to be in the release version I am working with.

It is slightly unclear to me how your suggestion for the extract command
suggestion should be implemented.  All of my media files I am working with
now are the same frame rate, but forcing a frame rate prior to embedding is
probably a good idea.  I had assumed there were still bugs in the code for
this, but it would be nice if extraction/embedding could work without
having to  change more.

Zach

On Thu, Feb 6, 2025 at 4:57 AM Jack Lau  wrote:

>
>
> > I have been absent from the list for a few years, so I would appreciate
> it
> > if someone could catch me up a bit.  I am needing to extract and embed
> scc
> > files with 608 captions.  I am pleased to see that transcoding without
> > frame rate changes now preserves 608 intact, and there appear to be
> > extraction and embed functions but they do seem to have bugs for my files
> > at 1080p2997.  Are there any developers willing to take on a paid project
> > to fix whatever is the issue?  Here are the commands I am working with.
> >
> > Embed:
> > "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -i
> > "C:\Users\Captions\AIM-2301_premiereDF.mp4" -i
> > "C:\Captions\AIM-2301_premiereDF.mp4.scc" -map 0:v -map 0:a -map 1 -c:v
> > copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng
> > "C:\Captions\AIM-2301_premiereDFcopy.mp4"
> >
> > Extract:
> > "C:\FFmpeg\ffmpeg7.1_2024-12-14\ffmpeg.exe" -f lavfi -i
> >
> "movie=\'C:\\Captions\\AIM-2301_premiereDF_ffmpegEmbedscc.mp4\'"[out+subcc]
> > -map 0:1 -c:s copy "C:\Captions\AIM-2301_premiereDF_ffmpegEmbedscc.scc”
> >
>
>
> Hi,
>
> I’ve reviewed the issue with embedding and extracting 608 SCC captions at
> 1080p2997 resolution and identified a few areas that might help resolve the
> character duplication and data spill. Here's a summary of my findings:
>
> The current command uses -c:s mov_text, but SCC files may work better with
> -c:s scc to preserve the format correctly.
> The current command uses a filtergraph that might not map correctly for
> SCC extraction. Instead, try simplifying the extraction command: -map 0:s:0
> -c:s copy
> Frame Rate Issues: Ensure the video frame rate and the SCC file frame rate
> match. You might want to force a specific frame rate (e.g., -r 29.97).
>
> Let me know if you have further questions.
> ___
> 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] threadprogress: reorder instructions to silence tsan warning.

2025-02-06 Thread Zhao Zhili



> On Feb 7, 2025, at 05:42, Ronald S. Bultje  wrote:
> 
> Fixes #11456.
> ---
> libavcodec/threadprogress.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/threadprogress.c b/libavcodec/threadprogress.c
> index 62c4fd898b..aa72ff80e7 100644
> --- a/libavcodec/threadprogress.c
> +++ b/libavcodec/threadprogress.c
> @@ -55,9 +55,8 @@ void ff_thread_progress_report(ThreadProgress *pro, int n)
> if (atomic_load_explicit(&pro->progress, memory_order_relaxed) >= n)
> return;
> 
> -atomic_store_explicit(&pro->progress, n, memory_order_release);
> -
> ff_mutex_lock(&pro->progress_mutex);
> +atomic_store_explicit(&pro->progress, n, memory_order_release);
> ff_cond_broadcast(&pro->progress_cond);
> ff_mutex_unlock(&pro->progress_mutex);
> }
> -- 
> 2.48.0

LGTM.

> 
> ___
> 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 v3 0/3] Add option to log timing

2025-02-06 Thread Soft Works

> -Original Message-
> From: Marth64 
> Sent: Friday, February 7, 2025 5:47 AM
> To: Soft Works 
> Cc: FFmpeg development discussions and patches  de...@ffmpeg.org>; Michael Niedermayer ; Soft
> Works 
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/3] Add option to log timing
> 
> > it would probably also be odd when there's a single white space in-
>   between.
>
> Yes, it would look worse on white background. OK as is, then.

Fine. If someone has a specific wish or idea, feel free to comment.

> > Why wouldn't it be machine-parsable without those letters?
>
> It is more about having timezone, etc.
> I actually think it is better for readability as is, but was checking
> if preservation for machine parsing* (phrasing what I meant
> better) was a goal, then it should be compliant. But I don't see much
> value in that.

We actually parse this output in some analysis tool, but only the time.

> The example I was thinking of was if I wanted to look at the logs 2
> years later, it would have time zone in case of DST or whatever.
> But it's a total obscure stretch case IMO. I'm not advocating for it,
> just sharing what I meant with my logic.
> (And if someone really needs it later they can make a +rfc3339 switch
> or whatever)

I don’t find that case "obscure" at all. In fact, the time zone can get really 
important when correlating information from multiple log files (e.g. ffmpeg + 
application). 
For this, we are printing the full date with time zone just once at the top of 
the logs and let ffmpeg print the time only. The date occupies a lot of 
horizontal screen estate which is inconvenient for manual review and largely 
redundant anyway. 
The only corner case would be a long-running process where ffmpeg doesn't print 
a single log line for a whole day - in that case, the time-only output would 
become ambiguous..

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] lavc/hevcdec: fix crash when ff_h2645_sei_to_frame modifies avctx->properties

2025-02-06 Thread Marth64
Yes, confirmed
Looks like its only present on 6.1. In 7.0+ it is fixed by
d9f1b321cf58a85518d29c5a3d220d67b1a68b92 (which is the same change)
If there is no objection I'll back port that commit in the next few days.

Thanks Thinh.
___
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 v4 2/3] fftools/opt_common: add timing and datetiming log flags

2025-02-06 Thread epirat07



On 7 Feb 2025, at 7:27, softworkz wrote:

> From: softworkz 
>
> This commit adds two logging flags: 'timing' and 'datetiming'.
>
> Usage:
>
> ffmpeg -loglevel +timing
>
> or
>
> ffmpeg -loglevel +datetiming

This commit message seems out of date regarding the actual commit contents
given the flags are time and datetime now?

>
> Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
> timing to be printed when exiting.
>
> Signed-off-by: softworkz 
> ---
>  fftools/ffmpeg.c |  1 +
>  fftools/opt_common.c | 12 
>  2 files changed, 13 insertions(+)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index dc321fb4a2..f4c717afaa 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -130,6 +130,7 @@ static void term_exit_sigsafe(void)
>
>  void term_exit(void)
>  {
> +av_log_set_flags(0);
>  av_log(NULL, AV_LOG_QUIET, "%s", "");
>  term_exit_sigsafe();
>  }
> diff --git a/fftools/opt_common.c b/fftools/opt_common.c
> index 34da2cee7d..317e8458c1 100644
> --- a/fftools/opt_common.c
> +++ b/fftools/opt_common.c
> @@ -1292,6 +1292,18 @@ int opt_loglevel(void *optctx, const char *opt, const 
> char *arg)
>  } else {
>  flags |= AV_LOG_PRINT_LEVEL;
>  }
> +} else if (av_strstart(token, "time", &arg)) {
> +if (cmd == '-') {
> +flags &= ~AV_LOG_PRINT_TIME;
> +} else {
> +flags |= AV_LOG_PRINT_TIME;
> +}
> +} else if (av_strstart(token, "datetime", &arg)) {
> +if (cmd == '-') {
> +flags &= ~AV_LOG_PRINT_DATETIME;
> +} else {
> +flags |= AV_LOG_PRINT_DATETIME;
> +}
>  } 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 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 v4 2/3] fftools/opt_common: add timing and datetiming log flags

2025-02-06 Thread Soft Works



> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> epira...@gmail.com
> Sent: Friday, February 7, 2025 7:46 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v4 2/3] fftools/opt_common: add
> timing and datetiming log flags
> 
> 
> 
> On 7 Feb 2025, at 7:27, softworkz wrote:
> 
> > From: softworkz 
> >
> > This commit adds two logging flags: 'timing' and 'datetiming'.
> >
> > Usage:
> >
> > ffmpeg -loglevel +timing
> >
> > or
> >
> > ffmpeg -loglevel +datetiming
> 
> This commit message seems out of date regarding the actual commit
> contents
> given the flags are time and datetime now?

Yes of course. 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 v2 2/2] random_seed: Improve behaviour with small timer increments with high precision timers

2025-02-06 Thread Martin Storsjö

On Thu, 6 Feb 2025, Michael Niedermayer wrote:


On Thu, Feb 06, 2025 at 02:38:48PM +0200, Martin Storsjö wrote:

On Thu, 6 Feb 2025, Michael Niedermayer wrote:


+// If the timer resolution is high, and we get the same timer
+// value multiple times, use variances in the number of repeats
+// of each timer value as entropy. If the number of repeats 
changed,
+// proceed to the next index.


Does it still work if you check against the last 2 ?
or does this become too slow ?
What iam thinking of is this

7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,... and a 9 or 6 or further distant 
would trigger it

I assume both the CPU clock and the wall time are quite precisse so if we
just compare them the entropy could be low even with 2 alternating values


Yes, that still works for making it terminate in a reasonable amount of
time. I updated the patch to keep track of 3 numbers of repeats, and we
consider that we got valid entropy once the new number of repeats is
different from the last two.

So in the sequence above, e.g. for 7,8,7,8,8,7, at the point of the last
one, we have old repeats 8 and 8, and the new repeat count 7, which in that
context looks unique.


I was thinking that in 7,8,8 that 7 and 8 be the 2 least recent used
values not 8,8


Sure, that's probably doable too.


that is, something like:

if (old2 == new) {
   FFSWAP(old,old2);


I don't see why we'd need to check this if clause at all, it seems to me 
that it's enough to have the "if (old != new)" case. If we have old2 == 
new, we'd just end up with old2 = old, and old = (previous old2 value) 
anyway.



} else if (old != new) {
   old2 = old;
   old = new;
}

but again, iam not sure this will work or just need too much time to gather
enough entropy


It still executes in reasonable amount of time; my patch now looks like 
this:


if (t == last_t) {
repeats[0]++;
} else {
// If we got a new unique number of repeats, update the history.
// (We don't need to check repeats[2]; if it is equal to the new
// value we'll end up keeping the same two values as before, in
// opposite order.
if (repeats[0] != repeats[1]) {
repeats[2] = repeats[1];
repeats[1] = repeats[0];
}
repeats[0] = 0;
}

// Martin
___
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 v3 1/3] avutil/log: support logging of date and timing information

2025-02-06 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/APIchanges  |  3 +++
 libavutil/log.c | 32 +---
 libavutil/log.h | 10 ++
 libavutil/version.h |  2 +-
 4 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 0f2b640601..83d57ae314 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2025-01-xx - xx - lavu 59.57.100 - log.h
+  Add flags AV_LOG_PRINT_TIME and AV_LOG_PRINT_DATETIME.
+
 2025-01-25 - xx - lavu 59.56.100 - frame.h
   Add AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT.
 
diff --git a/libavutil/log.c b/libavutil/log.c
index 46662f3db0..3ea6cb671e 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -42,6 +42,8 @@
 #include "internal.h"
 #include "log.h"
 #include "thread.h"
+#include "time.h"
+#include "time_internal.h"
 
 static AVMutex mutex = AV_MUTEX_INITIALIZER;
 
@@ -296,14 +298,32 @@ static const char *item_name(void *obj, const AVClass 
*cls)
 return (cls->item_name ? cls->item_name : av_default_item_name)(obj);
 }
 
+static void format_date_now(AVBPrint* timeBuf, int include_date)
+{
+struct tm *ptm, tmbuf;
+const int64_t time_us = av_gettime();
+const int64_t time_ms = time_us / 1000;
+const time_t time_s   = time_ms / 1000;
+const int millisec= time_ms - (time_s * 1000);
+ptm   = localtime_r(&time_s, &tmbuf);
+if (ptm) {
+if (include_date)
+av_bprint_strftime(timeBuf, "%Y-%m-%d ", ptm);
+
+av_bprint_strftime(timeBuf, "%H:%M:%S", ptm);
+av_bprintf(timeBuf, ".%03d ", millisec);
+}
+}
+
 static void format_line(void *avcl, int level, const char *fmt, va_list vl,
-AVBPrint part[4], int *print_prefix, int type[2])
+AVBPrint part[5], int *print_prefix, int type[2])
 {
 AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
 av_bprint_init(part+0, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+1, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+2, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(part+3, 0, 65536);
+av_bprint_init(part+4, 0, AV_BPRINT_SIZE_AUTOMATIC);
 
 if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
 if (*print_prefix && avc) {
@@ -321,6 +341,9 @@ static void format_line(void *avcl, int level, const char 
*fmt, va_list vl,
 if(type) type[1] = get_category(avcl);
 }
 
+if (*print_prefix && (flags & (AV_LOG_PRINT_TIME | AV_LOG_PRINT_DATETIME)))
+format_date_now(&part[4], flags & AV_LOG_PRINT_DATETIME);
+
 if (*print_prefix && (level > AV_LOG_QUIET) && (flags & 
AV_LOG_PRINT_LEVEL))
 av_bprintf(part+2, "[%s] ", get_level_str(level));
 
@@ -341,7 +364,7 @@ void av_log_format_line(void *ptr, int level, const char 
*fmt, va_list vl,
 int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
 char *line, int line_size, int *print_prefix)
 {
-AVBPrint part[4];
+AVBPrint part[5];
 int ret;
 
 format_line(ptr, level, fmt, vl, part, print_prefix, NULL);
@@ -355,7 +378,7 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 static int print_prefix = 1;
 static int count;
 static char prev[LINE_SZ];
-AVBPrint part[4];
+AVBPrint part[5];
 char line[LINE_SZ];
 static int is_atty;
 int type[2];
@@ -390,6 +413,9 @@ void av_log_default_callback(void* ptr, int level, const 
char* fmt, va_list vl)
 count = 0;
 }
 strcpy(prev, line);
+
+sanitize(part[4].str);
+colored_fputs(7, 0, part[4].str);
 sanitize(part[0].str);
 colored_fputs(type[0], 0, part[0].str);
 sanitize(part[1].str);
diff --git a/libavutil/log.h b/libavutil/log.h
index 4c8c92266f..dd094307ce 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -406,6 +406,16 @@ int av_log_format_line2(void *ptr, int level, const char 
*fmt, va_list vl,
  */
 #define AV_LOG_PRINT_LEVEL 2
 
+/**
+ * Include system time in log output.
+ */
+#define AV_LOG_PRINT_TIME 4
+
+/**
+ * Include system date and time in log output.
+ */
+#define AV_LOG_PRINT_DATETIME 8
+
 void av_log_set_flags(int arg);
 int av_log_get_flags(void);
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 83b7822125..ee4a36cb17 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  56
+#define LIBAVUTIL_VERSION_MINOR  57
 #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".


[FFmpeg-devel] [PATCH v3 2/3] fftools/opt_common: add timing and datetiming log flags

2025-02-06 Thread softworkz
From: softworkz 

This commit adds two logging flags: 'timing' and 'datetiming'.

Usage:

ffmpeg -loglevel +timing

or

ffmpeg -loglevel +datetiming

Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
timing to be printed when exiting.

Signed-off-by: softworkz 
---
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 2 files changed, 13 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..f4c717afaa 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -130,6 +130,7 @@ static void term_exit_sigsafe(void)
 
 void term_exit(void)
 {
+av_log_set_flags(0);
 av_log(NULL, AV_LOG_QUIET, "%s", "");
 term_exit_sigsafe();
 }
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 34da2cee7d..94e9dae8b6 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -1292,6 +1292,18 @@ int opt_loglevel(void *optctx, const char *opt, const 
char *arg)
 } else {
 flags |= AV_LOG_PRINT_LEVEL;
 }
+} else if (av_strstart(token, "timing", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_TIME;
+} else {
+flags |= AV_LOG_PRINT_TIME;
+}
+} else if (av_strstart(token, "datetiming", &arg)) {
+if (cmd == '-') {
+flags &= ~AV_LOG_PRINT_DATETIME;
+} else {
+flags |= AV_LOG_PRINT_DATETIME;
+}
 } 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 v3 0/3] Add option to log timing

2025-02-06 Thread ffmpegagent
This pathcset adds two logging flags: 'timing' and 'datetiming'.

Usage:

ffmpeg -loglevel +timing

or

ffmpeg -loglevel +datetiming

Update V1

 * Fix merge conflicts

Update V2

 * Rebased

Update V3

 * Fix print timing on exit (as reported by Michael Niedermayer)

softworkz (3):
  avutil/log: support logging of date and timing information
  fftools/opt_common: add timing and datetiming log flags
  doc/fftools-common-opts: document log timing flags

 doc/APIchanges   |  3 +++
 doc/fftools-common-opts.texi |  4 
 fftools/ffmpeg.c |  1 +
 fftools/opt_common.c | 12 
 libavutil/log.c  | 32 +---
 libavutil/log.h  | 10 ++
 libavutil/version.h  |  2 +-
 7 files changed, 60 insertions(+), 4 deletions(-)


base-commit: 4ba9ae7742a6f8a29d6486e25ff5709a075edb5b
Published-As: 
https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-37%2Fsoftworkz%2Fsubmit_logtiming-v3
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
pr-ffstaging-37/softworkz/submit_logtiming-v3
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/37

Range-diff vs v2:

 1:  13a7dc164b = 1:  13a7dc164b avutil/log: support logging of date and timing 
information
 2:  9eb9a6cf48 ! 2:  6c435fc02d fftools/opt_common: add timing and datetiming 
log flags
 @@ Commit message
  
  ffmpeg -loglevel +datetiming
  
 +Setting av_log_set_flags(0) in term_exit in ffmpeg.c prevents
 +timing to be printed when exiting.
 +
  Signed-off-by: softworkz 
  
 + ## fftools/ffmpeg.c ##
 +@@ fftools/ffmpeg.c: static void term_exit_sigsafe(void)
 + 
 + void term_exit(void)
 + {
 ++av_log_set_flags(0);
 + av_log(NULL, AV_LOG_QUIET, "%s", "");
 + term_exit_sigsafe();
 + }
 +
   ## fftools/opt_common.c ##
  @@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, 
const char *arg)
   } else {
 3:  20e049c4c7 = 3:  f0aa91d5c1 doc/fftools-common-opts: document log timing 
flags

-- 
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 v3 3/3] doc/fftools-common-opts: document log timing flags

2025-02-06 Thread softworkz
From: softworkz 

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

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 8b0931a86d..37bed92864 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -226,6 +226,10 @@ and the "Last message repeated n times" line will be 
omitted.
 Indicates that log output should add a @code{[level]} prefix to each message
 line. This can be used as an alternative to log coloring, e.g. when dumping the
 log to file.
+@item timing
+Indicates that log lines should be prefixed with timing information.
+@item datetiming
+Indicates that log lines should be prefixed with date and timing information.
 @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 v3 0/3] Add option to log timing

2025-02-06 Thread Marth64
It works good. First pass thoughts:
1- Rename `timeBuf` -> `bp_time`, in this way it follows snake case
convention and conveys clearly that the parameter is an `AVBPrint`

2- Option switch: +datetime and +time feels lighter/easier (vs. -ing)

3- Term color: the space after the time keeps the background of the
time, which looks odd IMO with terminal emulator color schemes that
show the background.
Not sure if this is intentional. Let me know if you need a screenshot.

4- (Optional): how would you feel about RFC3339 representation? If
machine parsing is a goal for this.
___
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] lavc/hevcdec: fix crash when ff_h2645_sei_to_frame modifies avctx->properties

2025-02-06 Thread Marth64
Hello,
Patch fails to apply (looks like a rebase needed since I see the path
of hevcdec.c is older).
Also a sample or context to trigger the condition would be nice to validation.
Thank you
___
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] avfilter/scale*: add option reset_sar

2025-02-06 Thread Gyan Doshi




On 2025-01-31 06:30 pm, Gyan Doshi wrote:

For anamorphic videos, enabling this option leads to adjustment of
output dimensions to obtain square pixels when the user requests
proportional scaling through either of the w/h expressions or
force_original_aspect_ratio.

Output SAR is always reset to 1.

Option added to scale, scale_cuda, scale_npp & scale_vaapi.

libplacebo already has a similar option with different semantics,
scale_vt and scale_vulkan don't implement force_oar, so for these
three filters, I've made minimal changes needed to not break building
or change output.


Plan to push on Monday.

Regards,
Gyan



---
  doc/filters.texi  | 21 +
  libavfilter/scale_eval.c  | 13 +++--
  libavfilter/scale_eval.h  |  5 -
  libavfilter/vf_libplacebo.c   |  2 +-
  libavfilter/vf_scale.c| 13 +++--
  libavfilter/vf_scale_cuda.c   | 25 +++--
  libavfilter/vf_scale_npp.c| 13 +++--
  libavfilter/vf_scale_vaapi.c  | 13 +++--
  libavfilter/vf_scale_vt.c |  2 +-
  libavfilter/vf_scale_vulkan.c |  2 +-
  10 files changed, 87 insertions(+), 22 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a14c7e7e77..71de1ab2dc 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -21285,6 +21285,13 @@ This option can be handy if you need to have a video 
fit within or exceed
  a defined resolution using @option{force_original_aspect_ratio} but also have
  encoder restrictions on width or height divisibility.
  
+@item reset_sar

+For anamorphic videos, enabling this option leads to adjustment of output 
dimensions
+to obtain square pixels when the user requests proportional scaling through 
either of
+the width or height expressions or through force_original_aspect_ratio.
+Output SAR is always reset to 1.
+Default is false.
+
  @end table
  
  The values of the @option{w} and @option{h} options are expressions

@@ -21538,6 +21545,13 @@ Affects the curves of the bicubic algorithm.
  @item force_divisible_by
  Work the same as the identical @ref{scale} filter options.
  
+@item reset_sar

+For anamorphic videos, enabling this option leads to adjustment of output 
dimensions
+to obtain square pixels when the user requests proportional scaling through 
either of
+the width or height expressions or through force_original_aspect_ratio.
+Output SAR is always reset to 1.
+Default is false.
+
  @end table
  
  @subsection Examples

@@ -21641,6 +21655,13 @@ This option can be handy if you need to have a video 
fit within or exceed
  a defined resolution using @option{force_original_aspect_ratio} but also have
  encoder restrictions on width or height divisibility.
  
+@item reset_sar

+For anamorphic videos, enabling this option leads to adjustment of output 
dimensions
+to obtain square pixels when the user requests proportional scaling through 
either of
+the width or height expressions or through force_original_aspect_ratio.
+Output SAR is always reset to 1.
+Default is false.
+
  @item eval
  Specify when to evaluate @var{width} and @var{height} expression. It accepts 
the following values:
  
diff --git a/libavfilter/scale_eval.c b/libavfilter/scale_eval.c

index dc8d522b1e..53f5e22b0e 100644
--- a/libavfilter/scale_eval.c
+++ b/libavfilter/scale_eval.c
@@ -112,7 +112,8 @@ fail:
  
  int ff_scale_adjust_dimensions(AVFilterLink *inlink,

  int *ret_w, int *ret_h,
-int force_original_aspect_ratio, int force_divisible_by)
+int force_original_aspect_ratio, int force_divisible_by,
+double w_adj)
  {
  int64_t w, h;
  int factor_w, factor_h;
@@ -132,7 +133,7 @@ int ff_scale_adjust_dimensions(AVFilterLink *inlink,
  }
  
  if (w < 0 && h < 0) {

-w = inlink->w;
+w = inlink->w * w_adj;
  h = inlink->h;
  }
  
@@ -140,18 +141,18 @@ int ff_scale_adjust_dimensions(AVFilterLink *inlink,

   * earlier. If no factor was set, nothing will happen as the default
   * factor is 1 */
  if (w < 0)
-w = av_rescale(h, inlink->w, inlink->h * factor_w) * factor_w;
+w = av_rescale(h, inlink->w * w_adj, inlink->h * factor_w) * factor_w;
  if (h < 0)
-h = av_rescale(w, inlink->h, inlink->w * factor_h) * factor_h;
+h = av_rescale(w, inlink->h, inlink->w * w_adj * factor_h) * factor_h;
  
  /* Note that force_original_aspect_ratio may overwrite the previous set

   * dimensions so that it is not divisible by the set factors anymore
   * unless force_divisible_by is defined as well */
  if (force_original_aspect_ratio) {
  // Including force_divisible_by here rounds to the nearest multiple 
of it.
-int64_t tmp_w = av_rescale(h, inlink->w, inlink->h * 
(int64_t)force_divisible_by)
+int64_t tmp_w = av_rescale(h, inlink->w * w_adj, inlink->h * 
(int64_t)force_divisible_by)
  * force_divisible_by;
-int64_t tmp_h = av_rescale(w, inlink->h, inlink->w * 
(int64_t)

[FFmpeg-devel] [PATCH] swscale/graph: copy scaler_params to the legacy subpass context

2025-02-06 Thread James Almer
Fixes ticket #11448.

Signed-off-by: James Almer 
---
 libswscale/graph.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 2337016111..ed5e8038b1 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -431,6 +431,9 @@ static int add_legacy_sws_pass(SwsGraph *graph, SwsFormat 
src, SwsFormat dst,
 legacy_chr_pos(graph, &sws->dst_h_chr_pos, ctx->dst_h_chr_pos, &warned);
 legacy_chr_pos(graph, &sws->dst_v_chr_pos, ctx->dst_v_chr_pos, &warned);
 
+sws->scaler_params[0] = ctx->scaler_params[0];
+sws->scaler_params[1] = ctx->scaler_params[1];
+
 ret = sws_init_context(sws, NULL, NULL);
 if (ret < 0) {
 sws_free_context(&sws);
-- 
2.48.1

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

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


Re: [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo

2025-02-06 Thread Jörg Habenicht via ffmpeg-devel
Hi

Am 06.02.25 um 18:12 schrieb Michael Niedermayer:
> Hi Jörg
>
> On Tue, Feb 04, 2025 at 08:53:58PM +0100, Jörg Habenicht via ffmpeg-devel 
> wrote:
>> Add a parameter (boolean) r to switch the area from
>> rectangular (r=0) to circular(r=1) delogo.
>>
[...]

>> @@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
>>  { "y","set logo y position",   OFFSET(y_expr),
>> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>>  { "w","set logo width",OFFSET(w_expr),
>> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>>  { "h","set logo height",   OFFSET(h_expr),
>> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>> +{ "r","logo is round/ellipse", OFFSET(round), 
>> AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
> maybe a superellipse would be interresting
> https://en.wikipedia.org/wiki/Superellipse
>
> This would allow intermediates between a rectangle, elipse and rhombus
> I imagine this could cover more cases of logos

hm, good idea.

How do I get the user Interface right? Extending the new 'r' option from bool 
to accept a float type?

r=2.0 would result in an ellipse or circle and r=1.0 would result in a rhombus?

>
> either way teh 3 patches should be merged
>
> thx
>
>
my pleasure


cu

Jörg

___
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] avformat/hls: Revert "reduce default max reload to 3"

2025-02-06 Thread Steven Liu
softworkz  于2025年1月19日周日 16:52写道:
>
> From: softworkz 
>
> This change has caused regressions for many users and consumers.
> Playlist reloads only happen when a playlist doesn't indicate that it
> has ended (via #EXT-X-ENDLIST), which means that the addition of future
> segments is still expected.
> It is well possible that an HLS server is temporarily unable to serve
> further segments but resumes after some time, either indicating a
> discontinuity or even by fully catching up.
> With a segment length of 3s, a max_reload value of 1000 corresponds to
> a duration of 50 minutes which appears to be a reasonable default.
I have no opinion about this, lgtm

> ---
> avformat/hls: Revert "reduce default max reload to 3"
>
> This change has caused regressions for many users and consumers.
> Playlist reloads only happen when a playlist doesn't indicate that it
> has ended (via #EXT-X-ENDLIST), which means that the addition of future
> segments is still expected. It is well possible that an HLS server is
> temporarily unable to serve further segments but resumes after some
> time, either indicating a discontinuity or even by fully catching up.
> With a segment length of 3s, a max_reload value of 1000 corresponds to a
> duration of 50 minutes which appears to be a reasonable default.
>
> Published-As: 
> https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-51%2Fsoftworkz%2Fsubmit_hls_reload-v1
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
> pr-ffstaging-51/softworkz/submit_hls_reload-v1
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/51
>
>  libavformat/hls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index 045741c3b4..426cf30f70 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -2577,7 +2577,7 @@ static const AVOption hls_options[] = {
>  {.str = 
> "3gp,aac,avi,ac3,eac3,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"},
>  INT_MIN, INT_MAX, FLAGS},
>  {"max_reload", "Maximum number of times a insufficient list is attempted 
> to be reloaded",
> -OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 3}, 0, INT_MAX, FLAGS},
> +OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, 
> FLAGS},
>  {"m3u8_hold_counters", "The maximum number of times to load m3u8 when it 
> refreshes without new segments",
>  OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, 
> INT_MAX, FLAGS},
>  {"http_persistent", "Use persistent HTTP connections",
>
> base-commit: ced9fddec0e45e1ce1b3425a1fed66af971e934c
> --
> 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".


Thanks
Steven
___
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] avformat/hls: Revert "reduce default max reload to 3"

2025-02-06 Thread Soft Works


> -Original Message-
> From: Steven Liu 
> Sent: Friday, February 7, 2025 3:24 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: softworkz 
> Subject: Re: [FFmpeg-devel] [PATCH] avformat/hls: Revert "reduce
> default max reload to 3"
> 
> softworkz  于2025年1月19日周日 16:52写道:
> >
> > From: softworkz 
> >
> > This change has caused regressions for many users and consumers.
> > Playlist reloads only happen when a playlist doesn't indicate that
> it
> > has ended (via #EXT-X-ENDLIST), which means that the addition of
> future
> > segments is still expected.
> > It is well possible that an HLS server is temporarily unable to
> serve
> > further segments but resumes after some time, either indicating a
> > discontinuity or even by fully catching up.
> > With a segment length of 3s, a max_reload value of 1000 corresponds
> to
> > a duration of 50 minutes which appears to be a reasonable default.

Hi Steven,

thanks for reviewing

> I have no opinion about this, lgtm

Neither do I. As this is a reversion, I meant to say that the original value 
wasn't irrational as it might have  appeared when the change to 3 was made.
Whether it's 100, 1000 or 1 might be debatable, just 3 is way too low, so 
without any strong reason towards 100 or 1, I think that going back to the 
original value makes the most sense.

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".


[FFmpeg-devel] [PATCH] avcodec/libtheora: fix setting keyframe_mask

2025-02-06 Thread James Almer
t_info.keyframe_granule_shift is set to the library default of 6, which is ok
for gop sizes up to 63. Since there's apparently no way to query the updated
value after having forced a gop value with 
TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
calculate it manually instead.

Fixes ticket #11454.

Signed-off-by: James Almer 
---
 libavcodec/libtheoraenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index 8844f4be6a..761cd45d44 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -234,7 +234,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
 return AVERROR_EXTERNAL;
 }
 
-h->keyframe_mask = (1 << t_info.keyframe_granule_shift) - 1;
+h->keyframe_mask = (1 << av_ceil_log2(avc_context->gop_size)) - 1;
 /* Clear up theora_info struct */
 th_info_clear(&t_info);
 
-- 
2.48.1

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

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


Re: [FFmpeg-devel] [PATCH v3 0/3] Add option to log timing

2025-02-06 Thread Soft Works



> -Original Message-
> From: Marth64 
> Sent: Friday, February 7, 2025 4:58 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Michael Niedermayer ; softworkz
> ; Soft Works  hotmail@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/3] Add option to log timing
> 
> It works good. 

Millions of log lines were written with it already :-)

> First pass thoughts:
> 1- Rename `timeBuf` -> `bp_time`, in this way it follows snake case
> convention and conveys clearly that the parameter is an `AVBPrint`

Oops, missed that.

> 2- Option switch: +datetime and +time feels lighter/easier (vs. -ing)

Sure, I don't remember how I even came to the 'ing'.

> 3- Term color: the space after the time keeps the background of the
> time, which looks odd IMO with terminal emulator color schemes that
> show the background.
> Not sure if this is intentional. Let me know if you need a
> screenshot.

Here are two screenshots:
https://gist.github.com/softworkz/f78a6a4973f804b9381fe37d5f75f9ea

I suppose the lower one is what you are referring to, but in the upper one you 
can see that there are many lines with black background where it would probably 
also be odd when there's a single white space in-between.
That being said, I don't really care about coloring so I'll gladly change it to 
whichever way is desired.

> 4- (Optional): how would you feel about RFC3339 representation? If
> machine parsing is a goal for this.

What I feel is that the T and Z letters make it just much harder to read.
Why wouldn't it be machine-parsable without those letters?

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] ffv1dec: fix threaded decode failures

2025-02-06 Thread Michael Niedermayer
On Wed, Feb 05, 2025 at 03:47:19PM +0100, Lynne wrote:
> Fixes 7187eadf8c0f0c640f1d23811c55fad0cba60aa5
> 
> The issue is that while avctx->pix_fmt is synchronized between
> threads, f->pix_fmt was not.
> 
> Fixes fate-vsynth1-ffv1-2pass10 with THREADS=2.
> ---
>  libavcodec/ffv1dec.c | 1 +
>  1 file changed, 1 insertion(+)

thanks!

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

What is kyc? Its a tool that makes you give out your real ID, while criminals
give out a forged ID card.


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 3/3] doc/encoders: Document png pred

2025-02-06 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 doc/encoders.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 0005ade9c18..0bbdf5d6916 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -3409,6 +3409,8 @@ Sets the compression level, from 0 to 9(default)
 Set physical density of pixels, in dots per inch, unset by default
 @item dpm @var{integer}
 Set physical density of pixels, in dots per meter, unset by default
+@item pred @var{method}
+Set prediction method (none, sub, up, avg, paeth, mixed), default is paeth
 @end table
 
 @section ProRes
-- 
2.48.1

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

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


Re: [FFmpeg-devel] [PATCH v4 2/3] avcodec/hevc/ps: Add basic HEVC_SCALABILITY_AUXILIARY support

2025-02-06 Thread Zhao Zhili


> On Feb 6, 2025, at 21:25, James Almer  wrote:
> 
> On 2/6/2025 12:49 AM, Zhao Zhili wrote:
>> From: Zhao Zhili 
>> Only implementing what's needed for HEVC with alpha.
>> Signed-off-by: Zhao Zhili 
>> ---
>>  libavcodec/hevc/hevc.h |   5 ++
>>  libavcodec/hevc/ps.c   | 126 +
>>  libavcodec/hevc/ps.h   |   4 ++
>>  3 files changed, 98 insertions(+), 37 deletions(-)
>> diff --git a/libavcodec/hevc/hevc.h b/libavcodec/hevc/hevc.h
>> index b2229fda40..710786a89d 100644
>> --- a/libavcodec/hevc/hevc.h
>> +++ b/libavcodec/hevc/hevc.h
>> @@ -170,4 +170,9 @@ enum HEVCScalabilityMask {
>>  HEVC_SCALABILITY_MASK_MAX   = 0x,
>>  };
>>  +enum HEVCAuxId {
>> +HEVC_AUX_ALPHA = 1,
>> +HEVC_AUX_DEPTH = 2,
>> +};
>> +
>>  #endif /* AVCODEC_HEVC_HEVC_H */
>> diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
>> index 861a6bb0a2..4f18cd72e4 100644
>> --- a/libavcodec/hevc/ps.c
>> +++ b/libavcodec/hevc/ps.c
>> @@ -460,14 +460,17 @@ static int decode_vps_ext(GetBitContext *gb, 
>> AVCodecContext *avctx, HEVCVPS *vps
>>uint64_t layer1_id_included)
>>  {
>>  PTL ptl_dummy;
>> -uint8_t max_sub_layers[HEVC_MAX_LAYERS];
>> +uint8_t max_sub_layers[HEVC_MAX_LAYERS] = {1, 1};
>> +uint8_t dimension_id_len[16] = {0};
>> +uint8_t dimension_id[16] = {0};
>> +unsigned n;
>>  -int splitting_flag, dimension_id_len, view_id_len, num_add_olss, 
>> num_scalability_types,
>> +int splitting_flag, view_id_len, num_add_olss, num_scalability_types,
>>  default_output_layer_idc, direct_dep_type_len, direct_dep_type,
>>  sub_layers_max_present, sub_layer_flag_info_present_flag, nb_ptl;
>>  unsigned non_vui_extension_length;
>>  -if (vps->vps_max_layers == 1 || vps->vps_num_layer_sets == 1) {
>> +if (vps->vps_max_layers == 1) {
>>  av_log(avctx, AV_LOG_VERBOSE, "Ignoring VPS extensions with a 
>> single layer\n");
>>  return 0;
>>  }
>> @@ -520,7 +523,8 @@ static int decode_vps_ext(GetBitContext *gb, 
>> AVCodecContext *avctx, HEVCVPS *vps
>>   */
>>  vps->nb_layers = 2;
>>  -if (parse_ptl(gb, avctx, 0, &ptl_dummy, vps->vps_max_sub_layers) < 0)
>> +if (vps->vps_base_layer_internal_flag &&
> 
> What's the point checking for this flag if this code will not be reached if 
> it's false?

Here is only meant to follow the spec with little effort. When someone add 
support for
vps_base_layer_internal_flag = 0, it’s clear what does the flag can affect.

> 
>> +parse_ptl(gb, avctx, 0, &ptl_dummy, vps->vps_max_sub_layers) < 0)
>>  return AVERROR_INVALIDDATA;
>>splitting_flag = get_bits1(gb);
>> @@ -529,20 +533,25 @@ static int decode_vps_ext(GetBitContext *gb, 
>> AVCodecContext *avctx, HEVCVPS *vps
>>  if (!num_scalability_types) {
>>  av_log(avctx, AV_LOG_ERROR, "Missing scalability mask\n");
>>  return AVERROR_INVALIDDATA;
>> -} else if (num_scalability_types > 1) {
>> -av_log(avctx, AV_LOG_ERROR, "Scalability number %d not supported\n",
>> -   num_scalability_types);
>> -return AVERROR_PATCHWELCOME;
>>  }
>>  -if (!(vps->scalability_mask_flag & HEVC_SCALABILITY_MULTIVIEW)) {
>> +if (!(vps->scalability_mask_flag &
>> +  (HEVC_SCALABILITY_MULTIVIEW | HEVC_SCALABILITY_AUXILIARY))) {
>>  av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n",
>> 15 - ff_ctz(vps->scalability_mask_flag));
>>  return AVERROR_PATCHWELCOME;
>>  }
>> +// x265 specify MULTIVIEW when the stream really is alpha video only.
>> +if (num_scalability_types > 1)
>> +av_log(avctx, AV_LOG_WARNING, "Multiple scalability types 
>> presented\n");
>>  -if (!splitting_flag)
>> -dimension_id_len = get_bits(gb, 3) + 1;
>> +n = 0;
>> +for (int i = 0; i < num_scalability_types - splitting_flag; i++) {
>> +dimension_id_len[i] = get_bits(gb, 3) + 1;
>> +n += dimension_id_len[i];
>> +}
>> +if (splitting_flag)
>> +dimension_id_len[num_scalability_types - 1] = 5 - n;
>>if (get_bits1(gb)) { /* vps_nuh_layer_id_present_flag */
>>  int layer_id_in_nuh = get_bits(gb, 6);
>> @@ -559,28 +568,57 @@ static int decode_vps_ext(GetBitContext *gb, 
>> AVCodecContext *avctx, HEVCVPS *vps
>>  }
>>if (!splitting_flag) {
>> -int view_idx = get_bits(gb, dimension_id_len);
>> -if (view_idx != 1) {
>> -av_log(avctx, AV_LOG_ERROR, "Unexpected ViewOrderIdx: %d\n", 
>> view_idx);
>> +int index = 0;
>> +
>> +for (int i = 0; i < num_scalability_types; i++)
>> +dimension_id[i] = get_bits(gb, dimension_id_len[i]);
>> +
>> +if (vps->scalability_mask_flag & HEVC_SCALABILITY_MULTIVIEW)
>> +index++;
>> +
>> +/* AuxId 1 is alpha, 2 is depth. Only support alpha */
>> +if (vps->scalability_mask_flag & HEVC_SCALABILITY_AUXILIARY &

Re: [FFmpeg-devel] [PATCH v4 3/3] avcodec/hevc: Add alpha layer support

2025-02-06 Thread James Almer

On 2/6/2025 11:06 AM, Zhao Zhili wrote:




On Feb 6, 2025, at 21:26, James Almer  wrote:

On 2/6/2025 12:50 AM, Zhao Zhili wrote:

From: Zhao Zhili 
Signed-off-by: Zhao Zhili 
---
  libavcodec/hevc/hevcdec.c | 72 ++-
  libavcodec/hevc/hevcdec.h |  2 ++
  libavcodec/hevc/refs.c| 11 +-
  3 files changed, 83 insertions(+), 2 deletions(-)


Can you please share the sample from the other day without requiring to request 
for access to your google drive?


Sorry I have modified the permission but forgot to reply.

https://drive.google.com/file/d/1SK6gnMNlWODeTySpetNAKgNeqt69DQDz/view?usp=sharing


Thanks. That sample however doesn't really showcase the alpha layer 
doing anything. Can't you generate a sample with videotoolbox out of 
some apng, webp or similar source with alpha where the transparency is 
noticeable? The FATE suite has a couple.




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".


Re: [FFmpeg-devel] [PATCH 1/2] swresample/rematrix: split filling the matrix array into its own function

2025-02-06 Thread Michael Niedermayer
On Sun, Feb 02, 2025 at 06:46:41PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libswresample/rematrix.c | 202 ---
>  1 file changed, 106 insertions(+), 96 deletions(-)
> 
> diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
> index b9bf4dcac0..8b6e8ae1c5 100644
> --- a/libswresample/rematrix.c
> +++ b/libswresample/rematrix.c
> @@ -124,85 +124,28 @@ static int sane_layout(AVChannelLayout *ch_layout) {
>  return 1;
>  }
>  
> -av_cold int swr_build_matrix2(const AVChannelLayout *in_layout, const 
> AVChannelLayout *out_layout,
> -  double center_mix_level, double 
> surround_mix_level,
> -  double lfe_mix_level, double maxval,
> -  double rematrix_volume, double *matrix_param,
> -  ptrdiff_t stride, enum AVMatrixEncoding 
> matrix_encoding, void *log_context)
> +static void build_matrix(const AVChannelLayout *in_ch_layout, const 
> AVChannelLayout *out_ch_layout,
> + double center_mix_level, double surround_mix_level,
> + double lfe_mix_level, double maxval, double 
> rematrix_volume, double *matrix_param,
> + ptrdiff_t stride, enum AVMatrixEncoding 
> matrix_encoding)

Please document new functions, even if its just refering
to swr_build_matrix2() docs

thx

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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 2/2] swresample/rematrix: add support for custom order channel layouts

2025-02-06 Thread Michael Niedermayer
On Sun, Feb 02, 2025 at 06:46:42PM -0300, James Almer wrote:
> Limited to the same channels as a native layout, but not constrained by 
> channel ordering.
> 
> Signed-off-by: James Almer 
> ---
> Untested, as i don't have a sample from which we export a custom layout (Like 
> PCM in mp4).
> 
>  libswresample/rematrix.c | 28 +---
>  1 file changed, 17 insertions(+), 11 deletions(-)

probably ok

thx

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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] fix pad artifacting

2025-02-06 Thread Michael Niedermayer
Hi Ben

On Mon, Feb 03, 2025 at 04:02:15PM +, Ben Lu via ffmpeg-devel wrote:
> Sure, looks like gmail is complying with a plaintext email RFC. Let me try
> attaching to eml with:
> `git format-patch -s -o "outputfolder" --add-header "X-Unsent: 1" --suffix
> .eml --to ffmpeg-devel@ffmpeg.org -1 0f497eb391b`
> 
> On Mon, Feb 3, 2025 at 3:22 PM James Almer  wrote:
> 
> > On 2/3/2025 10:58 AM, Ben Lu via ffmpeg-devel wrote:
> > > Sorry about that, it looks correct in gmail and sending to myself also
> > > looks fine, not sure where the line width corruption is happening. Our
> > org
> > > doesn't allow programmatic email.
> >
> > Looks like lines with a single blank space are being replaced by empty
> > lines.
> >
> > >
> > > Is it possible to use this gist?
> >
> > Try to attach the output of git format-patch to an email instead. That
> > gist is only a diff of changes and missing all the git commit info.
> >
> > ___
> > 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".
> >

> Date: Fri, 31 Jan 2025 23:13:25 +
> From: Ben Lu 
> To: ffmpeg-devel@ffmpeg.org
> Subject: [PATCH] fix pad artifacts
> 
> Signed-off-by: Ben Lu 
> ---
>  libavfilter/vf_pad.c | 29 +
>  1 file changed, 21 insertions(+), 8 deletions(-)

A more verbose commit message would be good

Also do you have some testcase for this ?
or even better something that can be added to fate ? So that a regression
could be detected.

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If one takes all money from those who grow wealth and gives it to those who
do not grow wealth, 10 years later, almost the same people who where wealthy
will be wealthy again, the same people who where poor will be poor again.


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 v2 2/2] avcodec: add a ffv1 parser

2025-02-06 Thread James Almer

On 2/6/2025 12:52 PM, Michael Niedermayer wrote:

On Sun, Feb 02, 2025 at 11:16:03PM -0300, James Almer wrote:

Only setting frame and stream properties. No packetization is performed.

Signed-off-by: James Almer 
---
  configure|  1 +
  libavcodec/Makefile  |  1 +
  libavcodec/ffv1_parser.c | 86 
  libavcodec/parsers.c |  1 +
  4 files changed, 89 insertions(+)
  create mode 100644 libavcodec/ffv1_parser.c

diff --git a/configure b/configure
index 06f641ead0..f09faaf505 100755
--- a/configure
+++ b/configure
@@ -3469,6 +3469,7 @@ vvc_qsv_decoder_select="vvc_mp4toannexb_bsf qsvdec"
  aac_parser_select="adts_header mpeg4audio"
  av1_parser_select="cbs_av1"
  evc_parser_select="evcparse"
+ffv1_parser_select="rangecoder"
  ftr_parser_select="adts_header mpeg4audio"
  h264_parser_select="golomb h264dsp h264parse h264_sei"
  hevc_parser_select="hevcparse hevc_sei"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 44bb34182a..973e2c45d6 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1207,6 +1207,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER)   += dvbsub_parser.o
  OBJS-$(CONFIG_DVD_NAV_PARSER)  += dvd_nav_parser.o
  OBJS-$(CONFIG_DVDSUB_PARSER)   += dvdsub_parser.o
  OBJS-$(CONFIG_EVC_PARSER)  += evc_parser.o
+OBJS-$(CONFIG_FFV1_PARSER) += ffv1_parser.o ffv1_parse.o ffv1.o
  OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o
  OBJS-$(CONFIG_FTR_PARSER)  += ftr_parser.o
  OBJS-$(CONFIG_G723_1_PARSER)   += g723_1_parser.o
diff --git a/libavcodec/ffv1_parser.c b/libavcodec/ffv1_parser.c
new file mode 100644
index 00..d0b396b693
--- /dev/null
+++ b/libavcodec/ffv1_parser.c
@@ -0,0 +1,86 @@
+/*
+ * 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 "avcodec.h"
+#include "ffv1.h"
+#include "rangecoder.h"
+
+typedef struct FFV1ParseContext {
+FFV1Context f;
+int got_first;
+} FFV1ParseContext;
+
+static int parse(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ const uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size)
+{
+FFV1ParseContext *p = s->priv_data;
+FFV1Context *f = &p->f;
+RangeCoder c;
+uint8_t keystate = 128;
+
+*poutbuf  = buf;
+*poutbuf_size = buf_size;
+
+if (!p->got_first) {
+int ret = ff_ffv1_common_init(avctx, f);
+p->got_first = 1;
+if (ret < 0)
+return buf_size;
+
+if (avctx->extradata_size > 0 && (ret = ff_ffv1_read_extra_header(f)) 
< 0)
+return buf_size;
+}
+
+ff_init_range_decoder(&c, buf, buf_size);
+ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
+
+f->avctx = avctx;
+s->key_frame = get_rac(&c, &keystate);
+s->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P, see ffv1dec.c


id remove the comment, also in ffv1dec.c

patch should be ok



Applied with that change. Thanks.



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".


Re: [FFmpeg-devel] [PATCH v3 2/2] Add stream dump test with test for ogg/flac.

2025-02-06 Thread Romain Beauxis
Le mer. 5 févr. 2025 à 21:03, Michael Niedermayer 
a écrit :
>
> On Tue, Feb 04, 2025 at 07:31:45AM -0500, Romain Beauxis wrote:
> > This is the new FATE test.
> >
> > Test samples are available here:
https://www.dropbox.com/scl/fo/fxt2edwkyj2mjc9qubku5/AICHxJyxMMAK8MIJqWLcvk4?rlkey=mlt12lsu741ejukz0p5qtn9rq&dl=0
> >
> > Output prior to the changes is:
> > Stream ID: 0, codec name: flac, metadata: encoder=Lavc61.19.100
flac:title=First Stream
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, frame PTS: 0, metadata:
> > Stream ID: 0, packet PTS: 4608, packet DTS: 4608
> > Stream ID: 0, frame PTS: 4608, metadata:
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, frame PTS: 0, metadata:
> > Stream ID: 0, packet PTS: 4608, packet DTS: 4608
> > Stream ID: 0, frame PTS: 4608, metadata:
> >
> > Output after the changes:
> > Stream ID: 0, codec name: flac, metadata: encoder=Lavc61.19.100
flac:title=First Stream
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, frame PTS: 0, metadata:
> > Stream ID: 0, packet PTS: 4608, packet DTS: 4608
> > Stream ID: 0, frame PTS: 4608, metadata:
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, packet PTS: 0, packet DTS: 0
> > Stream ID: 0, frame PTS: 0, metadata: encoder=Lavc61.19.100
flac:title=Second Stream
> > Stream ID: 0, packet PTS: 4608, packet DTS: 4608
> > Stream ID: 0, frame PTS: 4608, metadata:
> >
> > ---
> >  tests/Makefile|   2 +
> >  tests/api/Makefile|   2 +-
> >  tests/api/api-dump-stream-meta-test.c | 169 ++
> >  tests/fate/api.mak|   5 +
> >  tests/fate/ogg-flac.mak   |  11 ++
>
> This is missing:
> ./tests/ref/fate/api-dump-stream-meta
>
> also make fate fails like this:
> TESTapi-dump-stream-meta
> reference file './tests/ref/fate/api-dump-stream-meta' not found
> ./tests/fate-run.sh: 705: cannot open
tests/data/fate/api-dump-stream-meta.diff: No such file
> Test api-dump-stream-meta failed. Look at
tests/data/fate/api-dump-stream-meta.err for details.
> make: *** [tests/Makefile:313: api-dump-stream-meta] Error 1
>
> but the failed part cant be run
>
> make api-dump-stream-meta
> make: *** No rule to make target 'api-dump-stream-meta'.  Stop.
>
> also if i add a empty reference file
> make fate passes
>
> so it seems there is some bug in this

Thanks for looking into this!

It was a silly mistake:
diff --git a/tests/fate/api.mak b/tests/fate/api.mak
index a9872a5589..5a01a381c0 100644
--- a/tests/fate/api.mak
+++ b/tests/fate/api.mak
@@ -1,4 +1,4 @@
-FATE_API_LIBAVFORMAT-$(call ENCDEC, FLAC, FLAC) += api-dump-stream-meta
+FATE_API_LIBAVFORMAT-$(call ENCDEC, FLAC, FLAC) += fate-api-ogg-flac-meta
 fate-api-ogg-flac-meta: $(APITESTSDIR)/api-dump-stream-meta-test$(EXESUF)
 fate-api-ogg-flac-meta: CMD = run $(APITESTSDIR)/api-flac-test$(EXESUF)
 fate-api-ogg-flac-meta: CMP = null

Should I send an updated patch? Any other feedback before I do so?

-- Romain
___
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] avfilter/delogo: add parameter to switch on circular delogo

2025-02-06 Thread Michael Niedermayer
Hi Jörg

On Tue, Feb 04, 2025 at 08:53:58PM +0100, Jörg Habenicht via ffmpeg-devel wrote:
> Add a parameter (boolean) r to switch the area from
> rectangular (r=0) to circular(r=1) delogo.
> 
> Signed-off-by: Jörg Habenicht 
> ---
>  libavfilter/vf_delogo.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
> index bfbf8e6f4c..7641c3b483 100644
> --- a/libavfilter/vf_delogo.c
> +++ b/libavfilter/vf_delogo.c
> @@ -195,7 +195,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
> 
>  typedef struct DelogoContext {
>  const AVClass *class;
> -int x, y, w, h, band, show;
> +int x, y, w, h, band, show, round;
>  char *x_expr, *y_expr, *w_expr, *h_expr;
>  AVExpr *x_pexpr, *y_pexpr, *w_pexpr, *h_pexpr;
>  double var_values[VAR_VARS_NB];
> @@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
>  { "y","set logo y position",   OFFSET(y_expr),
> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>  { "w","set logo width",OFFSET(w_expr),
> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>  { "h","set logo height",   OFFSET(h_expr),
> AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
> +{ "r","logo is round/ellipse", OFFSET(round), 
> AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },

maybe a superellipse would be interresting
https://en.wikipedia.org/wiki/Superellipse

This would allow intermediates between a rectangle, elipse and rhombus
I imagine this could cover more cases of logos

either way teh 3 patches should be merged

thx

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

The smallest minority on earth is the individual. Those who deny 
individual rights cannot claim to be defenders of minorities. - Ayn Rand


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 v2 2/2] random_seed: Improve behaviour with small timer increments with high precision timers

2025-02-06 Thread Martin Storsjö

On Thu, 6 Feb 2025, Michael Niedermayer wrote:


+// If the timer resolution is high, and we get the same timer
+// value multiple times, use variances in the number of repeats
+// of each timer value as entropy. If the number of repeats 
changed,
+// proceed to the next index.


Does it still work if you check against the last 2 ?
or does this become too slow ?
What iam thinking of is this

7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,... and a 9 or 6 or further distant 
would trigger it

I assume both the CPU clock and the wall time are quite precisse so if we
just compare them the entropy could be low even with 2 alternating values


Yes, that still works for making it terminate in a reasonable amount of 
time. I updated the patch to keep track of 3 numbers of repeats, and we 
consider that we got valid entropy once the new number of repeats is 
different from the last two.


So in the sequence above, e.g. for 7,8,7,8,8,7, at the point of the last 
one, we have old repeats 8 and 8, and the new repeat count 7, which in 
that context looks unique.


It's obviously not entirely unique in the wider context there, but it 
should cover for cases when we alternate between two numbers at least. 
It's of course not hard to make it look at an even longer history, 
although the conditional becomes a bit more unwieldy in that form.


// Martin

___
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 v4 2/3] avcodec/hevc/ps: Add basic HEVC_SCALABILITY_AUXILIARY support

2025-02-06 Thread James Almer

On 2/6/2025 12:49 AM, Zhao Zhili wrote:

From: Zhao Zhili 

Only implementing what's needed for HEVC with alpha.

Signed-off-by: Zhao Zhili 
---
  libavcodec/hevc/hevc.h |   5 ++
  libavcodec/hevc/ps.c   | 126 +
  libavcodec/hevc/ps.h   |   4 ++
  3 files changed, 98 insertions(+), 37 deletions(-)

diff --git a/libavcodec/hevc/hevc.h b/libavcodec/hevc/hevc.h
index b2229fda40..710786a89d 100644
--- a/libavcodec/hevc/hevc.h
+++ b/libavcodec/hevc/hevc.h
@@ -170,4 +170,9 @@ enum HEVCScalabilityMask {
  HEVC_SCALABILITY_MASK_MAX   = 0x,
  };
  
+enum HEVCAuxId {

+HEVC_AUX_ALPHA = 1,
+HEVC_AUX_DEPTH = 2,
+};
+
  #endif /* AVCODEC_HEVC_HEVC_H */
diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
index 861a6bb0a2..4f18cd72e4 100644
--- a/libavcodec/hevc/ps.c
+++ b/libavcodec/hevc/ps.c
@@ -460,14 +460,17 @@ static int decode_vps_ext(GetBitContext *gb, 
AVCodecContext *avctx, HEVCVPS *vps
uint64_t layer1_id_included)
  {
  PTL ptl_dummy;
-uint8_t max_sub_layers[HEVC_MAX_LAYERS];
+uint8_t max_sub_layers[HEVC_MAX_LAYERS] = {1, 1};
+uint8_t dimension_id_len[16] = {0};
+uint8_t dimension_id[16] = {0};
+unsigned n;
  
-int splitting_flag, dimension_id_len, view_id_len, num_add_olss, num_scalability_types,

+int splitting_flag, view_id_len, num_add_olss, num_scalability_types,
  default_output_layer_idc, direct_dep_type_len, direct_dep_type,
  sub_layers_max_present, sub_layer_flag_info_present_flag, nb_ptl;
  unsigned non_vui_extension_length;
  
-if (vps->vps_max_layers == 1 || vps->vps_num_layer_sets == 1) {

+if (vps->vps_max_layers == 1) {
  av_log(avctx, AV_LOG_VERBOSE, "Ignoring VPS extensions with a single 
layer\n");
  return 0;
  }
@@ -520,7 +523,8 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext 
*avctx, HEVCVPS *vps
   */
  vps->nb_layers = 2;
  
-if (parse_ptl(gb, avctx, 0, &ptl_dummy, vps->vps_max_sub_layers) < 0)

+if (vps->vps_base_layer_internal_flag &&


What's the point checking for this flag if this code will not be reached 
if it's false?



+parse_ptl(gb, avctx, 0, &ptl_dummy, vps->vps_max_sub_layers) < 0)
  return AVERROR_INVALIDDATA;
  
  splitting_flag = get_bits1(gb);

@@ -529,20 +533,25 @@ static int decode_vps_ext(GetBitContext *gb, 
AVCodecContext *avctx, HEVCVPS *vps
  if (!num_scalability_types) {
  av_log(avctx, AV_LOG_ERROR, "Missing scalability mask\n");
  return AVERROR_INVALIDDATA;
-} else if (num_scalability_types > 1) {
-av_log(avctx, AV_LOG_ERROR, "Scalability number %d not supported\n",
-   num_scalability_types);
-return AVERROR_PATCHWELCOME;
  }
  
-if (!(vps->scalability_mask_flag & HEVC_SCALABILITY_MULTIVIEW)) {

+if (!(vps->scalability_mask_flag &
+  (HEVC_SCALABILITY_MULTIVIEW | HEVC_SCALABILITY_AUXILIARY))) {
  av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n",
 15 - ff_ctz(vps->scalability_mask_flag));
  return AVERROR_PATCHWELCOME;
  }
+// x265 specify MULTIVIEW when the stream really is alpha video only.
+if (num_scalability_types > 1)
+av_log(avctx, AV_LOG_WARNING, "Multiple scalability types 
presented\n");
  
-if (!splitting_flag)

-dimension_id_len = get_bits(gb, 3) + 1;
+n = 0;
+for (int i = 0; i < num_scalability_types - splitting_flag; i++) {
+dimension_id_len[i] = get_bits(gb, 3) + 1;
+n += dimension_id_len[i];
+}
+if (splitting_flag)
+dimension_id_len[num_scalability_types - 1] = 5 - n;
  
  if (get_bits1(gb)) { /* vps_nuh_layer_id_present_flag */

  int layer_id_in_nuh = get_bits(gb, 6);
@@ -559,28 +568,57 @@ static int decode_vps_ext(GetBitContext *gb, 
AVCodecContext *avctx, HEVCVPS *vps
  }
  
  if (!splitting_flag) {

-int view_idx = get_bits(gb, dimension_id_len);
-if (view_idx != 1) {
-av_log(avctx, AV_LOG_ERROR, "Unexpected ViewOrderIdx: %d\n", 
view_idx);
+int index = 0;
+
+for (int i = 0; i < num_scalability_types; i++)
+dimension_id[i] = get_bits(gb, dimension_id_len[i]);
+
+if (vps->scalability_mask_flag & HEVC_SCALABILITY_MULTIVIEW)
+index++;
+
+/* AuxId 1 is alpha, 2 is depth. Only support alpha */
+if (vps->scalability_mask_flag & HEVC_SCALABILITY_AUXILIARY &&
+dimension_id[index] != HEVC_AUX_ALPHA) {
+av_log(avctx, AV_LOG_WARNING,
+   "Unsupported dimension_id %d for 
HEVC_SCALABILITY_AUXILIARY\n",
+   dimension_id[index]);
  return AVERROR_PATCHWELCOME;
  }
  }
  
  view_id_len = get_bits(gb, 4);

-if (view_id_len)
-for (int i = 0; i < 2 /* NumViews */; i++)
+if (view_id_len) {
+n = (vps->scalability_mask_flag & HEVC_SCALABIL

Re: [FFmpeg-devel] [PATCH v4 3/3] avcodec/hevc: Add alpha layer support

2025-02-06 Thread James Almer

On 2/6/2025 12:50 AM, Zhao Zhili wrote:

From: Zhao Zhili 

Signed-off-by: Zhao Zhili 
---
  libavcodec/hevc/hevcdec.c | 72 ++-
  libavcodec/hevc/hevcdec.h |  2 ++
  libavcodec/hevc/refs.c| 11 +-
  3 files changed, 83 insertions(+), 2 deletions(-)


Can you please share the sample from the other day without requiring to 
request for access to your google drive?




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".


Re: [FFmpeg-devel] [PATCH] fate/libswresample: add a test downmixing with a custom order layout

2025-02-06 Thread Michael Niedermayer
Hi James

On Wed, Feb 05, 2025 at 11:46:32AM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  tests/fate/libswresample.mak   | 8 
>  tests/filtergraphs/custom_rematrix | 1 +
>  2 files changed, 9 insertions(+)
>  create mode 100644 tests/filtergraphs/custom_rematrix
> 
> diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak
> index a1e5ab91fa..aa4438a4bd 100644
> --- a/tests/fate/libswresample.mak
> +++ b/tests/fate/libswresample.mak
> @@ -1097,5 +1097,13 @@ fate-swr-audioconvert: CMP = stddev
>  fate-swr-audioconvert: FUZZ = 0
>  
>  FATE_SWR += $(FATE_SWR_AUDIOCONVERT-yes)
> +
> +FATE_SWR_CUSTOM_REMATRIX-$(call FILTERDEMDECENCMUX, ARESAMPLE CHANNELMAP 
> AFORMAT, WAV, PCM_S16LE, PCM_S16LE, PCM_S16LE) += fate-swr-custom-rematrix
> +fate-swr-custom-rematrix: tests/data/asynth-44100-8.wav 
> tests/data/filtergraphs/custom_rematrix
> +fate-swr-custom-rematrix: CMD = md5 -i 
> $(TARGET_PATH)/tests/data/asynth-44100-8.wav -/filter_complex 
> $(TARGET_PATH)/tests/data/filtergraphs/custom_rematrix -map [OUT] -f s16le
> +fate-swr-custom-rematrix: CMP = oneline
> +fate-swr-custom-rematrix: REF = 2a14a44deb4ae26e3b474ddbfbc048f8

not a huge fan of md5 based testing of downmixing as it provides just a
"same" vs "different"

but patch ok

thx

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

There will always be a question for which you do not know the correct answer.


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 3/8] libavformat/flacdec: Export samples md5 as metadata

2025-02-06 Thread Michael Niedermayer
Hi Tomas

On Wed, Feb 05, 2025 at 03:20:09PM +0100, Tomas Härdin wrote:
> 

>  libavformat/flacdec.c |6 ++
>  tests/ref/fate/cover-art-aiff-id3v2-remux |5 +++--
>  tests/ref/fate/cover-art-flac-remux   |1 +
>  tests/ref/fate/id3v2-utf16-bom|5 +++--
>  4 files changed, 13 insertions(+), 4 deletions(-)
> 685b0c4be452dc7138f993a3cbeb85320a045545  
> 0003-libavformat-flacdec-Export-samples-md5-as-metadata.patch
> From e1c4dfa4cc7a574f6fac76c11591547d3cd90ad2 Mon Sep 17 00:00:00 2001
> From: Mattias Wadman 
> Date: Mon, 11 Oct 2021 15:38:13 +0200
> Subject: [PATCH 3/8] libavformat/flacdec: Export samples md5 as metadata
> 
> Will be used by mal to compare metadat md5 with decoded samples md5.
> 
> Part of fixing https://jira.spotify.net/browse/GOL-681
> ---
>  libavformat/flacdec.c | 6 ++
>  tests/ref/fate/cover-art-aiff-id3v2-remux | 5 +++--
>  tests/ref/fate/cover-art-flac-remux   | 1 +
>  tests/ref/fate/id3v2-utf16-bom| 5 +++--
>  4 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
> index 3c317acaee..9f65c25864 100644
> --- a/libavformat/flacdec.c
> +++ b/libavformat/flacdec.c
> @@ -33,6 +33,7 @@
>  #include "replaygain.h"
>  
>  #define SEEKPOINT_SIZE 18
> +#define MD5_BYTE_SIZE 16
>  
>  typedef struct FLACDecContext {
>  FFRawDemuxerContext rawctx;
> @@ -109,6 +110,7 @@ static int flac_read_header(AVFormatContext *s)
>  if (metadata_type == FLAC_METADATA_TYPE_STREAMINFO) {
>  uint32_t samplerate;
>  uint64_t samples;
> +char md5hex[MD5_BYTE_SIZE*2+1]; // hex representation plus null 
> terminator
>  
>  /* STREAMINFO can only occur once */
>  if (found_streaminfo) {
> @@ -133,6 +135,10 @@ static int flac_read_header(AVFormatContext *s)
>  if (samples > 0)
>  st->duration = samples;
>  }
> +
> +ff_data_to_hex(md5hex, st->codecpar->extradata+18, 
> MD5_BYTE_SIZE, 1 /* lowercase */);
> +md5hex[sizeof(md5hex)-1] = '\0';
> +av_dict_set(&s->metadata, "samples_md5", md5hex, 0);

I think "samples_md5" should be documented, so that other decoders can use
the same
i also see a verify_md5() in hevc
and crc seems frequently used in decoders

just mentioning so this all can be kept consistant

thx


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Give a rich man 100$ and he will turn it into 1000$.
Give a poor man 1000$ and he will spend it.


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/2] avcodec/ffv1: split off and share frame header parsing code

2025-02-06 Thread Michael Niedermayer
On Sun, Feb 02, 2025 at 11:16:02PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavcodec/Makefile |   4 +-
>  libavcodec/ffv1.c   |  14 +-
>  libavcodec/ffv1.h   |  35 ++-
>  libavcodec/ffv1_parse.c | 410 +++
>  libavcodec/ffv1dec.c| 459 +++-
>  libavcodec/ffv1enc.c|  14 +-
>  6 files changed, 491 insertions(+), 445 deletions(-)
>  create mode 100644 libavcodec/ffv1_parse.c

probably ok

thx

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

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott



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 v2 2/2] avcodec: add a ffv1 parser

2025-02-06 Thread Michael Niedermayer
On Sun, Feb 02, 2025 at 11:16:03PM -0300, James Almer wrote:
> Only setting frame and stream properties. No packetization is performed.
> 
> Signed-off-by: James Almer 
> ---
>  configure|  1 +
>  libavcodec/Makefile  |  1 +
>  libavcodec/ffv1_parser.c | 86 
>  libavcodec/parsers.c |  1 +
>  4 files changed, 89 insertions(+)
>  create mode 100644 libavcodec/ffv1_parser.c
> 
> diff --git a/configure b/configure
> index 06f641ead0..f09faaf505 100755
> --- a/configure
> +++ b/configure
> @@ -3469,6 +3469,7 @@ vvc_qsv_decoder_select="vvc_mp4toannexb_bsf qsvdec"
>  aac_parser_select="adts_header mpeg4audio"
>  av1_parser_select="cbs_av1"
>  evc_parser_select="evcparse"
> +ffv1_parser_select="rangecoder"
>  ftr_parser_select="adts_header mpeg4audio"
>  h264_parser_select="golomb h264dsp h264parse h264_sei"
>  hevc_parser_select="hevcparse hevc_sei"
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 44bb34182a..973e2c45d6 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -1207,6 +1207,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER)   += 
> dvbsub_parser.o
>  OBJS-$(CONFIG_DVD_NAV_PARSER)  += dvd_nav_parser.o
>  OBJS-$(CONFIG_DVDSUB_PARSER)   += dvdsub_parser.o
>  OBJS-$(CONFIG_EVC_PARSER)  += evc_parser.o
> +OBJS-$(CONFIG_FFV1_PARSER) += ffv1_parser.o ffv1_parse.o ffv1.o
>  OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o
>  OBJS-$(CONFIG_FTR_PARSER)  += ftr_parser.o
>  OBJS-$(CONFIG_G723_1_PARSER)   += g723_1_parser.o
> diff --git a/libavcodec/ffv1_parser.c b/libavcodec/ffv1_parser.c
> new file mode 100644
> index 00..d0b396b693
> --- /dev/null
> +++ b/libavcodec/ffv1_parser.c
> @@ -0,0 +1,86 @@
> +/*
> + * 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 "avcodec.h"
> +#include "ffv1.h"
> +#include "rangecoder.h"
> +
> +typedef struct FFV1ParseContext {
> +FFV1Context f;
> +int got_first;
> +} FFV1ParseContext;
> +
> +static int parse(AVCodecParserContext *s,
> + AVCodecContext *avctx,
> + const uint8_t **poutbuf, int *poutbuf_size,
> + const uint8_t *buf, int buf_size)
> +{
> +FFV1ParseContext *p = s->priv_data;
> +FFV1Context *f = &p->f;
> +RangeCoder c;
> +uint8_t keystate = 128;
> +
> +*poutbuf  = buf;
> +*poutbuf_size = buf_size;
> +
> +if (!p->got_first) {
> +int ret = ff_ffv1_common_init(avctx, f);
> +p->got_first = 1;
> +if (ret < 0)
> +return buf_size;
> +
> +if (avctx->extradata_size > 0 && (ret = 
> ff_ffv1_read_extra_header(f)) < 0)
> +return buf_size;
> +}
> +
> +ff_init_range_decoder(&c, buf, buf_size);
> +ff_build_rac_states(&c, 0.05 * (1LL << 32), 256 - 8);
> +
> +f->avctx = avctx;
> +s->key_frame = get_rac(&c, &keystate);
> +s->pict_type = AV_PICTURE_TYPE_I; //FIXME I vs. P, see ffv1dec.c

id remove the comment, also in ffv1dec.c

patch should be ok

thx

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

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued


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/1] fftools/ffmpeg_opt: Exit with non-zero status when destination exists

2025-02-06 Thread Marth64
Leo:
> If you do, you should consider not just -nostdin but also if reading
> from stdin like a pipe, e.g. ffmpeg -i -  foo.mkv
> this will exit with success if foo.mkv exists without asking on stdin
> (as you'd expect it to not, cause it's reading from stdin)

Agreed, that sounds logical.
I'll look into it.
___
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".