Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Marton
> Balint
> Sent: Freitag, 9. Mai 2025 14:06
> To: ffmpeg-devel@ffmpeg.org
> Cc: Marton Balint 
> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to
> the end of the status line
> 
> Elapsed time is much less important than the actual progress, and I am
> guessing
> several ffmpeg CLI frontends use the existing status line for showing
> progress,
> so putting a new field in the beginning is less optimal anyway.

I agree that it might not be the most important part of the stats,
yet, from experience, it is quite often useful.

How about adding it to the end, then?

Thanks,
sw



> 
> Related to ticket #11582.
> 
> Signed-off-by: Marton Balint 
> ---
>  fftools/ffmpeg.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 24d43e6197..2e575e7b10 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t
> timer_start, int64_t cur_ti
>  av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
>  av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
> 
> -secs = (int)t;
> -ms = (int)((t - secs) * 1000);
> -mins = secs / 60;
> -secs %= 60;
> -hours = mins / 60;
> -mins %= 60;
> -
> -av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs,
> ms / 10);
> -
>  for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
>  const float q = ost->enc ? atomic_load(&ost->quality) / (float)
> FF_QP2LAMBDA : -1;
> 
> @@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t
> timer_start, int64_t cur_ti
>  av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
>  }
> 
> +secs = (int)t;
> +ms = (int)((t - secs) * 1000);
> +mins = secs / 60;
> +secs %= 60;
> +hours = mins / 60;
> +mins %= 60;
> +
> +av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs,
> ms / 10);
> +
>  if (print_stats || is_last_report) {
>  const char end = is_last_report ? '\n' : '\r';
>  if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
> --
> 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".
___
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] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of James Almer
> Sent: Freitag, 9. Mai 2025 18:25
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to the end of the status line
> 
> On 5/9/2025 9:06 AM, Marton Balint wrote:
> > Elapsed time is much less important than the actual progress, and I am
> guessing
> > several ffmpeg CLI frontends use the existing status line for showing
> progress,
> > so putting a new field in the beginning is less optimal anyway.
> 
> LGTM, but for the record, we don't guarantee the printed output to be
> unchanged across versions, so anyone having scripts depending on that
> will have a bad time.

I think usually, such parsing scripts would parse that line by tokens, no?

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 v5 6/7] ogg/vorbis: implement header packet skip in chained ogg bitstreams.

2025-05-09 Thread Romain Beauxis
---
 libavcodec/vorbisdec.c |  37 +
 libavformat/oggparsevorbis.c   | 174 +
 tests/ref/fate/ogg-vorbis-chained-meta.txt |   3 -
 3 files changed, 117 insertions(+), 97 deletions(-)

diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index a778dc6b58..f069ac6ab3 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1776,39 +1776,17 @@ static int vorbis_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
 GetBitContext *gb = &vc->gb;
 float *channel_ptrs[255];
 int i, len, ret;
+const int8_t *new_extradata;
+size_t new_extradata_size;
 
 ff_dlog(NULL, "packet length %d \n", buf_size);
 
-if (*buf == 1 && buf_size > 7) {
-if ((ret = init_get_bits8(gb, buf + 1, buf_size - 1)) < 0)
-return ret;
-
-vorbis_free(vc);
-if ((ret = vorbis_parse_id_hdr(vc))) {
-av_log(avctx, AV_LOG_ERROR, "Id header corrupt.\n");
-vorbis_free(vc);
-return ret;
-}
-
-av_channel_layout_uninit(&avctx->ch_layout);
-if (vc->audio_channels > 8) {
-avctx->ch_layout.order   = AV_CHANNEL_ORDER_UNSPEC;
-avctx->ch_layout.nb_channels = vc->audio_channels;
-} else {
-av_channel_layout_copy(&avctx->ch_layout, 
&ff_vorbis_ch_layouts[vc->audio_channels - 1]);
-}
-
-avctx->sample_rate = vc->audio_samplerate;
-return buf_size;
-}
-
-if (*buf == 3 && buf_size > 7) {
-av_log(avctx, AV_LOG_DEBUG, "Ignoring comment header\n");
-return buf_size;
-}
+new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+&new_extradata_size);
 
-if (*buf == 5 && buf_size > 7 && vc->channel_residues && !vc->modes) {
-if ((ret = init_get_bits8(gb, buf + 1, buf_size - 1)) < 0)
+if (new_extradata && *new_extradata == 5 && new_extradata_size > 7 &&
+vc->channel_residues && !vc->modes) {
+if ((ret = init_get_bits8(gb, new_extradata + 1, new_extradata_size - 
1)) < 0)
 return ret;
 
 if ((ret = vorbis_parse_setup_hdr(vc))) {
@@ -1816,7 +1794,6 @@ static int vorbis_decode_frame(AVCodecContext *avctx, 
AVFrame *frame,
 vorbis_free(vc);
 return ret;
 }
-return buf_size;
 }
 
 if (!vc->channel_residues || !vc->modes) {
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 9f50ab9ffc..452728b54d 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -293,6 +293,62 @@ static int vorbis_update_metadata(AVFormatContext *s, int 
idx)
 return ret;
 }
 
+static int vorbis_parse_header(AVFormatContext *s, AVStream *st,
+   const uint8_t *p, unsigned int psize)
+{
+unsigned blocksize, bs0, bs1;
+int srate;
+int channels;
+
+if (psize != 30)
+return AVERROR_INVALIDDATA;
+
+p += 7; /* skip "\001vorbis" tag */
+
+if (bytestream_get_le32(&p) != 0) /* vorbis_version */
+return AVERROR_INVALIDDATA;
+
+channels = bytestream_get_byte(&p);
+if (st->codecpar->ch_layout.nb_channels &&
+channels != st->codecpar->ch_layout.nb_channels) {
+av_log(s, AV_LOG_ERROR, "Channel change is not supported\n");
+return AVERROR_PATCHWELCOME;
+}
+st->codecpar->ch_layout.nb_channels = channels;
+srate   = bytestream_get_le32(&p);
+p += 4; // skip maximum bitrate
+st->codecpar->bit_rate = bytestream_get_le32(&p); // nominal bitrate
+p += 4; // skip minimum bitrate
+
+blocksize = bytestream_get_byte(&p);
+bs0   = blocksize & 15;
+bs1   = blocksize >> 4;
+
+if (bs0 > bs1)
+return AVERROR_INVALIDDATA;
+if (bs0 < 6 || bs1 > 13)
+return AVERROR_INVALIDDATA;
+
+if (bytestream_get_byte(&p) != 1) /* framing_flag */
+return AVERROR_INVALIDDATA;
+
+st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+st->codecpar->codec_id   = AV_CODEC_ID_VORBIS;
+
+if (srate > 0) {
+if (st->codecpar->sample_rate &&
+srate != st->codecpar->sample_rate) {
+av_log(s, AV_LOG_ERROR, "Sample rate change is not supported\n");
+return AVERROR_PATCHWELCOME;
+}
+
+st->codecpar->sample_rate = srate;
+avpriv_set_pts_info(st, 64, 1, srate);
+}
+
+return 1;
+}
+
 static int vorbis_header(AVFormatContext *s, int idx)
 {
 struct ogg *ogg = s->priv_data;
@@ -300,6 +356,7 @@ static int vorbis_header(AVFormatContext *s, int idx)
 struct ogg_stream *os = ogg->streams + idx;
 struct oggvorbis_private *priv;
 int pkt_type = os->buf[os->pstart];
+int ret;
 
 if (!os->private) {
 os->private = av_mallocz(sizeof(struct oggvorbis_private));
@@ -327,56 +384,18 @@ static int vorbis_header(AVFormatContext *s, int idx)
 
 priv->len[pkt_type >> 1]= os-

[FFmpeg-devel] [PATCH v5 5/7] libavformat/oggdec.{c, h}: Add new_extradata, use it to pass extradata to the next decoded packet.

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggdec.c | 11 +++
 libavformat/oggdec.h |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 5557eb4a14..cb77cdd994 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -77,6 +77,7 @@ static void free_stream(AVFormatContext *s, int i)
 
 av_freep(&stream->private);
 av_freep(&stream->new_metadata);
+av_freep(&stream->new_extradata);
 }
 
 //FIXME We could avoid some structure duplication
@@ -888,6 +889,16 @@ retry:
 os->new_metadata_size = 0;
 }
 
+if (os->new_extradata) {
+ret = av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA,
+  os->new_extradata, 
os->new_extradata_size);
+if (ret < 0)
+return ret;
+
+os->new_extradata = NULL;
+os->new_extradata_size = 0;
+}
+
 return psize;
 }
 
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index bc670d0f1e..5083de646c 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -94,6 +94,8 @@ struct ogg_stream {
 int end_trimming; ///< set the number of packets to drop from the end
 uint8_t *new_metadata;
 size_t new_metadata_size;
+uint8_t *new_extradata;
+size_t new_extradata_size;
 void *private;
 };
 
-- 
2.39.5 (Apple Git-154)

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

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


[FFmpeg-devel] [PATCH v5 7/7] libavformat/oggdec.h: Change paket function documentation to return 1 on header packets only.

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggdec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 5083de646c..c15fbe738e 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -42,8 +42,8 @@ struct ogg_codec {
  * Attempt to process a packet as a data packet
  * @return < 0 (AVERROR) code or -1 on error
  * == 0 if the packet was a regular data packet.
- * == 0 or 1 if the packet was a header from a chained bitstream.
- *   (1 will cause the packet to be skiped in calling code 
(ogg_packet())
+ * == 1 if the packet was a header from a chained bitstream.
+ *This will cause the packet to be skiped in calling code 
(ogg_packet()
  */
 int (*packet)(AVFormatContext *, int);
 /**
-- 
2.39.5 (Apple Git-154)

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

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


[FFmpeg-devel] [PATCH] avformat/mpegts: update stream info when PMT ES stream_type changes

2025-05-09 Thread Pavel Koshevoy
I have a several .ts captures where video and audio codec changes
even though the PMT version does not change and the PIDs stay the same.
This happens during transition to/from slate (mpeg2 video and audio)
to network broadcast (hevc video and eac3 audio in private PES).

I've updated fate ts-demux expected results.
---
 libavformat/mpegts.c| 4 +++-
 tests/ref/fate/ts-demux | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 54594b3a11..deb69a0548 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -940,6 +940,8 @@ static int mpegts_set_stream_info(AVStream *st, PESContext 
*pes,
 mpegts_find_stream_type(st, pes->stream_type, ISO_types);
 if (pes->stream_type == STREAM_TYPE_AUDIO_MPEG2 || pes->stream_type == 
STREAM_TYPE_AUDIO_AAC)
 sti->request_probe = 50;
+if (pes->stream_type == STREAM_TYPE_PRIVATE_DATA)
+sti->request_probe = AVPROBE_SCORE_STREAM_RETRY;
 if ((prog_reg_desc == AV_RL32("HDMV") ||
  prog_reg_desc == AV_RL32("HDPR")) &&
 st->codecpar->codec_id == AV_CODEC_ID_NONE) {
@@ -2508,7 +2510,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 if (!st)
 goto out;
 
-if (pes && !pes->stream_type)
+if (pes && pes->stream_type != stream_type)
 mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc);
 
 add_pid_to_program(prg, pid);
diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
index 6a830d0d99..d56cc27937 100644
--- a/tests/ref/fate/ts-demux
+++ b/tests/ref/fate/ts-demux
@@ -24,6 +24,6 @@ 
packet|codec_type=video|stream_index=0|pts=3912686363|pts_time=43474.292922|dts=
 
packet|codec_type=audio|stream_index=1|pts=3912644825|pts_time=43473.831389|dts=3912644825|dts_time=43473.831389|duration=2880|duration_time=0.032000|size=906|pos=474888|flags=K__|data_hash=CRC32:0893d398
 
packet|codec_type=audio|stream_index=2|pts=3912645580|pts_time=43473.839778|dts=3912645580|dts_time=43473.839778|duration=2880|duration_time=0.032000|size=354|pos=491808|flags=K__|data_hash=CRC32:f5963fa6
 
stream|index=0|codec_name=mpeg2video|profile=4|codec_type=video|codec_tag_string=[2][0][0][0]|codec_tag=0x0002|width=1280|height=720|coded_width=0|coded_height=0|has_b_frames=1|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=4|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|ts_id=32776|ts_packetsize=188|id=0x31|r_frame_rate=6/1001|avg_frame_rate=6/1001|time_base=1/9|start_pts=3912669846|start_time=43474.109400|duration_ts=19519|duration=0.216878|bit_rate=1500|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=15|extradata_size=150|extradata_hash=CRC32:53134fa8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|
 
disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|side_datum/cpb_properties:side_data_type=CPB
 
properties|side_datum/cpb_properties:max_bitrate=1500|side_datum/cpb_properties:min_bitrate=0|side_datum/cpb_properties:avg_bitrate=0|side_datum/cpb_properties:buffer_size=9781248|side_datum/cpb_properties:vbv_delay=-1
-stream|index=1|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=6|channel_layout=5.1(side)|bits_per_sample=0|initial_padding=0|dmix_mode=0|ltrt_cmixlev=0.00|ltrt_surmixlev=0.00|loro_cmixlev=0.00|loro_surmixlev=0.00|ts_id=32776|ts_packetsize=188|id=0x34|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/9|start_pts=3912633305|start_time=43473.703389|duration_ts=14400|duration=0.16|bit_rate=384000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|
 
disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:language=eng
-stream|index=2|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|dmix_mode=0|ltrt_cmixlev=0.00|ltrt_surmixlev=0.

[FFmpeg-devel] [PATCH v5 3/7] ogg/opus: implement header packet skip in chained ogg bitstreams.

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggdec.c |  4 --
 libavformat/oggparseopus.c   | 87 
 tests/ref/fate/ogg-opus-chained-meta.txt |  1 -
 3 files changed, 60 insertions(+), 32 deletions(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 9baf8040a9..5557eb4a14 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -239,10 +239,6 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t 
serial, char *magic,
 os->start_trimming = 0;
 os->end_trimming = 0;
 
-/* Chained files have extradata as a new packet */
-if (codec == &ff_opus_codec)
-os->header = -1;
-
 return i;
 }
 
diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c
index 218e9df581..65b93b4053 100644
--- a/libavformat/oggparseopus.c
+++ b/libavformat/oggparseopus.c
@@ -36,6 +36,51 @@ struct oggopus_private {
 #define OPUS_SEEK_PREROLL_MS 80
 #define OPUS_HEAD_SIZE 19
 
+static int parse_opus_header(AVFormatContext *avf, AVStream *st, struct 
ogg_stream *os,
+ struct oggopus_private *priv, uint8_t *packet,
+ size_t psize)
+{
+int channels;
+int ret;
+
+if (psize < OPUS_HEAD_SIZE || (AV_RL8(packet + 8) & 0xF0) != 0)
+return AVERROR_INVALIDDATA;
+
+st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+st->codecpar->codec_id   = AV_CODEC_ID_OPUS;
+
+channels = AV_RL8(packet + 9);
+if (st->codecpar->ch_layout.nb_channels &&
+channels != st->codecpar->ch_layout.nb_channels) {
+av_log(avf, AV_LOG_ERROR, "Channel change is not supported\n");
+return AVERROR_PATCHWELCOME;
+}
+
+st->codecpar->ch_layout.nb_channels = channels;
+
+priv->pre_skip= AV_RL16(packet + 10);
+st->codecpar->initial_padding = priv->pre_skip;
+os->start_trimming = priv->pre_skip;
+/*orig_sample_rate= AV_RL32(packet + 12);*/
+/*gain= AV_RL16(packet + 16);*/
+/*channel_map = AV_RL8 (packet + 18);*/
+
+ret = ff_alloc_extradata(st->codecpar, os->psize);
+if (ret < 0)
+return ret;
+
+memcpy(st->codecpar->extradata, packet, os->psize);
+
+st->codecpar->sample_rate = 48000;
+st->codecpar->seek_preroll = av_rescale(OPUS_SEEK_PREROLL_MS,
+st->codecpar->sample_rate, 1000);
+avpriv_set_pts_info(st, 64, 1, 48000);
+
+priv->need_comments = 1;
+
+return 1;
+}
+
 static int opus_header(AVFormatContext *avf, int idx)
 {
 struct ogg *ogg  = avf->priv_data;
@@ -43,7 +88,6 @@ static int opus_header(AVFormatContext *avf, int idx)
 AVStream *st = avf->streams[idx];
 struct oggopus_private *priv = os->private;
 uint8_t *packet  = os->buf + os->pstart;
-int ret;
 
 if (!priv) {
 priv = os->private = av_mallocz(sizeof(*priv));
@@ -51,32 +95,8 @@ static int opus_header(AVFormatContext *avf, int idx)
 return AVERROR(ENOMEM);
 }
 
-if (os->flags & OGG_FLAG_BOS) {
-if (os->psize < OPUS_HEAD_SIZE || (AV_RL8(packet + 8) & 0xF0) != 0)
-return AVERROR_INVALIDDATA;
-st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
-st->codecpar->codec_id   = AV_CODEC_ID_OPUS;
-st->codecpar->ch_layout.nb_channels = AV_RL8(packet + 9);
-
-priv->pre_skip= AV_RL16(packet + 10);
-st->codecpar->initial_padding = priv->pre_skip;
-os->start_trimming = priv->pre_skip;
-/*orig_sample_rate= AV_RL32(packet + 12);*/
-/*gain= AV_RL16(packet + 16);*/
-/*channel_map = AV_RL8 (packet + 18);*/
-
-if ((ret = ff_alloc_extradata(st->codecpar, os->psize)) < 0)
-return ret;
-
-memcpy(st->codecpar->extradata, packet, os->psize);
-
-st->codecpar->sample_rate = 48000;
-st->codecpar->seek_preroll = av_rescale(OPUS_SEEK_PREROLL_MS,
-st->codecpar->sample_rate, 
1000);
-avpriv_set_pts_info(st, 64, 1, 48000);
-priv->need_comments = 1;
-return 1;
-}
+if (os->flags & OGG_FLAG_BOS)
+return parse_opus_header(avf, st, os, priv, packet, os->psize);
 
 if (priv->need_comments) {
 if (os->psize < 8 || memcmp(packet, "OpusTags", 8))
@@ -125,6 +145,19 @@ static int opus_packet(AVFormatContext *avf, int idx)
 return AVERROR_INVALIDDATA;
 }
 
+ if (os->psize > 8 && !memcmp(packet, "OpusHead", 8)) {
+ret = parse_opus_header(avf, st, os, priv, packet, os->psize);
+if (ret < 0)
+return ret;
+
+return 1;
+}
+
+if (os->psize > 8 && !memcmp(packet, "OpusTags", 8)) {
+priv->need_comments = 0;
+return 1;
+}
+
 if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & 
OGG_FLAG_EOS)) {
 int seg, d;
 int duration;
diff --git a/tests/ref/fate/ogg-opus-chained

[FFmpeg-devel] [PATCH v5 0/7] Remove chained ogg stream header packets from the demuxer

2025-05-09 Thread Romain Beauxis
## Changes since last revision:
* Added mechanism to pass new extradata when decoding ogg packets.
* Use it to pass new ogg/vorbis setup data to the vorbis decoder.
* Add checks for format change when parsing subsequent ogg/vorbis and
  ogg/opus chained streams

Romain Beauxis (7):
  libavformat/oggdec.h: Document packet function return value.
  libavformat/oggdec.{c,h}: Implement packet skip on packet return value
of 1
  ogg/opus: implement header packet skip in chained ogg bitstreams.
  ogg/flac: implement header packet skip in chained ogg bitstreams.
  libavformat/oggdec.{c,h}: Add new_extradata, use it to pass extradata
to the next decoded packet.
  ogg/vorbis: implement header packet skip in chained ogg bitstreams.
  libavformat/oggdec.h: Change paket function documentation to return 1
on header packets only.

 libavcodec/vorbisdec.c |  37 +
 libavformat/oggdec.c   |  37 +++--
 libavformat/oggdec.h   |   9 ++
 libavformat/oggparseflac.c |  28 +++-
 libavformat/oggparseopus.c |  87 +++
 libavformat/oggparsevorbis.c   | 174 +
 tests/ref/fate/ogg-flac-chained-meta.txt   |   2 -
 tests/ref/fate/ogg-opus-chained-meta.txt   |   1 -
 tests/ref/fate/ogg-vorbis-chained-meta.txt |   3 -
 9 files changed, 237 insertions(+), 141 deletions(-)

-- 
2.39.5 (Apple Git-154)

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

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


Re: [FFmpeg-devel] [PATCH v10 06/15] fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()

2025-05-09 Thread softworkz .



> -Original Message-
> From: Stefano Sabatini 
> Sent: Donnerstag, 8. Mai 2025 23:39
> To: softworkz . 
> Cc: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH v10 06/15] fftools/textformat: Introduce
> AVTextFormatOptions for avtext_context_open()
> 
> On date Thursday 2025-05-08 00:25:28 +, softworkz . wrote:
> > > -Original Message-
> > > From: Stefano Sabatini 
> > > Sent: Donnerstag, 8. Mai 2025 02:06
> > > To: FFmpeg development discussions and patches 
> > > Cc: softworkz 
> > > Subject: Re: [FFmpeg-devel] [PATCH v10 06/15] fftools/textformat:
> Introduce
> > > AVTextFormatOptions for avtext_context_open()
> > >
> > > On date Sunday 2025-05-04 02:57:17 +, softworkz wrote:
> > > > From: softworkz 
> > > >
> > > > This allows future addition of options without
> > > > changes to the signature of avtext_context_open().
> > > >
> > > > Reviewed-by: Stefano Sabatini 
> > > > Signed-off-by: softworkz 
> > > > ---
> > > >  fftools/ffprobe.c | 13 +
> > > >  fftools/textformat/avtextformat.c | 21 -
> > > >  fftools/textformat/avtextformat.h | 16 +---
> > > >  3 files changed, 26 insertions(+), 24 deletions(-)
> > > >
> > > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> > > > index f5c83925b9..1277b1e4f9 100644
> > > > --- a/fftools/ffprobe.c
> > > > +++ b/fftools/ffprobe.c
> > > > @@ -3168,10 +3168,15 @@ int main(int argc, char **argv)
> > > >  if (ret < 0)
> > > >  goto end;
> > > >
> > > > -if ((ret = avtext_context_open(&tctx, f, wctx, f_args,
> > > > -   sections, FF_ARRAY_ELEMS(sections),
> > > show_value_unit,
> > > > -use_value_prefix,
> use_byte_value_binary_prefix,
> > > use_value_sexagesimal_format,
> > > > -show_optional_fields, show_data_hash)) >=
> 0) {
> > >
> > > > +AVTextFormatOptions tf_options = {
> > > > +.show_optional_fields = show_optional_fields,
> > > > +.show_value_unit = show_value_unit,
> > > > +.use_value_prefix = use_value_prefix,
> > > > +.use_byte_value_binary_prefix = use_byte_value_binary_prefix,
> > > > +.use_value_sexagesimal_format = use_value_sexagesimal_format,
> > > > +};
> > > > +
> > > > +if ((ret = avtext_context_open(&tctx, f, wctx, f_args, sections,
> > > FF_ARRAY_ELEMS(sections), tf_options, show_data_hash)) >= 0) {
> > > >  if (f == &avtextformatter_xml)
> > > >  tctx->string_validation_utf8_flags |=
> > > AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES;
> > > >
> > > > diff --git a/fftools/textformat/avtextformat.c
> > > b/fftools/textformat/avtextformat.c
> > > > index b2c3aa3fc7..91469ef576 100644
> > > > --- a/fftools/textformat/avtextformat.c
> > > > +++ b/fftools/textformat/avtextformat.c
> > > > @@ -125,13 +125,7 @@ void avtext_context_close(AVTextFormatContext
> **ptctx)
> > > >
> > > >
> > > >  int avtext_context_open(AVTextFormatContext **ptctx, const
> AVTextFormatter
> > > *formatter, AVTextWriterContext *writer_context, const char *args,
> > > > -const AVTextFormatSection *sections, int
> > > nb_sections,
> > > > -int show_value_unit,
> > > > -int use_value_prefix,
> > > > -int use_byte_value_binary_prefix,
> > > > -int use_value_sexagesimal_format,
> > > > -int show_optional_fields,
> > > > -char *show_data_hash)
> > > > +const AVTextFormatSection *sections, int
> > > nb_sections, AVTextFormatOptions options, char *show_data_hash)
> > > >  {
> > > >  AVTextFormatContext *tctx;
> > > >  int i, ret = 0;
> > > > @@ -154,11 +148,11 @@ int avtext_context_open(AVTextFormatContext
> **ptctx,
> > > const AVTextFormatter *form
> > > >  goto fail;
> > > >  }
> > > >
> > > > -tctx->show_value_unit = show_value_unit;
> > > > -tctx->use_value_prefix = use_value_prefix;
> > > > -tctx->use_byte_value_binary_prefix = use_byte_value_binary_prefix;
> > > > -tctx->use_value_sexagesimal_format = use_value_sexagesimal_format;
> > > > -tctx->show_optional_fields = show_optional_fields;
> > > > +tctx->show_value_unit = options.show_value_unit;
> > > > +tctx->use_value_prefix = options.use_value_prefix;
> > > > +tctx->use_byte_value_binary_prefix =
> > > options.use_byte_value_binary_prefix;
> > > > +tctx->use_value_sexagesimal_format =
> > > options.use_value_sexagesimal_format;
> > > > +tctx->show_optional_fields = options.show_optional_fields;
> > > >
> > > >  if (nb_sections > SECTION_MAX_NB_SECTIONS) {
> > > >  av_log(tctx, AV_LOG_ERROR, "The number of section definitions
> (%d)
> > > is larger than the maximum allowed (%d)\n", nb_sections,
> > > SECTION_MAX_NB_SECTIONS);
> > > > @@ -201,7 +195,7 @@ int avtext_context_ope

[FFmpeg-devel] [PATCH v1] avcodec/apv_encoder: Updated APV encoder to set the encoder output to OAPV_CFG_VAL_AU_BS_FMT_NONE format (the only AU without bitstream format)

2025-05-09 Thread Dawid Kozinski
Signed-off-by: Dawid Kozinski 
---
 libavcodec/liboapvenc.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/liboapvenc.c b/libavcodec/liboapvenc.c
index 0c95489bc9..d338b33e2d 100644
--- a/libavcodec/liboapvenc.c
+++ b/libavcodec/liboapvenc.c
@@ -307,6 +307,18 @@ static av_cold int liboapve_init(AVCodecContext *avctx)
 return AVERROR_EXTERNAL;
 }
 
+{
+int size, value;
+
+value = OAPV_CFG_VAL_AU_BS_FMT_NONE;
+size = 4;
+ret = oapve_config(apv->id, OAPV_CFG_SET_AU_BS_FMT, &value, &size);
+if(OAPV_FAILED(ret)) {
+av_log(avctx, AV_LOG_ERROR, "Failed to set config for using 
encoder output format\n");
+return AVERROR_EXTERNAL;
+}
+}
+
 apv->ifrms.frm[FRM_IDX].imgb = apv_imgb_create(avctx);
 if (apv->ifrms.frm[FRM_IDX].imgb == NULL)
 return AVERROR(ENOMEM);
-- 
2.34.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] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread Marton Balint




On Fri, 9 May 2025, softworkz . wrote:





-Original Message-
From: ffmpeg-devel  On Behalf Of Marton
Balint
Sent: Freitag, 9. Mai 2025 14:06
To: ffmpeg-devel@ffmpeg.org
Cc: Marton Balint 
Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to
the end of the status line

Elapsed time is much less important than the actual progress, and I am
guessing
several ffmpeg CLI frontends use the existing status line for showing
progress,
so putting a new field in the beginning is less optimal anyway.


I agree that it might not be the most important part of the stats,
yet, from experience, it is quite often useful.

How about adding it to the end, then?


This patch does exactly that.

Regards,
Marton



Thanks,
sw





Related to ticket #11582.

Signed-off-by: Marton Balint 
---
 fftools/ffmpeg.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 24d43e6197..2e575e7b10 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t
timer_start, int64_t cur_ti
 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);

-secs = (int)t;
-ms = (int)((t - secs) * 1000);
-mins = secs / 60;
-secs %= 60;
-hours = mins / 60;
-mins %= 60;
-
-av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs,
ms / 10);
-
 for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
 const float q = ost->enc ? atomic_load(&ost->quality) / (float)
FF_QP2LAMBDA : -1;

@@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t
timer_start, int64_t cur_ti
 av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
 }

+secs = (int)t;
+ms = (int)((t - secs) * 1000);
+mins = secs / 60;
+secs %= 60;
+hours = mins / 60;
+mins %= 60;
+
+av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs,
ms / 10);
+
 if (print_stats || is_last_report) {
 const char end = is_last_report ? '\n' : '\r';
 if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
--
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".

___
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] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread softworkz .


> -Original Message-
> From: ffmpeg-devel  On Behalf Of Marton
> Balint
> Sent: Freitag, 9. Mai 2025 20:56
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to the end of the status line
> 
> 
> 
> On Fri, 9 May 2025, softworkz . wrote:
> 
> >
> >
> >> -Original Message-
> >> From: ffmpeg-devel  On Behalf Of Marton
> >> Balint
> >> Sent: Freitag, 9. Mai 2025 14:06
> >> To: ffmpeg-devel@ffmpeg.org
> >> Cc: Marton Balint 
> >> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to
> >> the end of the status line
> >>
> >> Elapsed time is much less important than the actual progress, and I am
> >> guessing
> >> several ffmpeg CLI frontends use the existing status line for showing
> >> progress,
> >> so putting a new field in the beginning is less optimal anyway.
> >
> > I agree that it might not be the most important part of the stats,
> > yet, from experience, it is quite often useful.
> >
> > How about adding it to the end, then?
> 
> This patch does exactly that.
> 
> Regards,
> Marton

Oh, apologies. I stopped reading after the - prefixed lines 😊

Thank you,
sw

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


Re: [FFmpeg-devel] [PATCH] avformat/mpegts: update stream info when PMT ES stream_type changes

2025-05-09 Thread Pavel Koshevoy
I will send a new patch with additional changes to handle stream_type ==
STREAM_TYPE_PRIVATE_DATA.

Pavel


On Tue, Apr 22, 2025 at 6:51 PM Pavel Koshevoy  wrote:

> I have a couple of .ts captures where video and audio codec changes
> even though the PMT version does not change and the PIDs stay the same.
>
> I've updated fate ts-demux expected results.
> ---
>  libavformat/mpegts.c| 2 +-
>  tests/ref/fate/ts-demux | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 54594b3a11..8a72d6988a 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2508,7 +2508,7 @@ static void pmt_cb(MpegTSFilter *filter, const
> uint8_t *section, int section_len
>  if (!st)
>  goto out;
>
> -if (pes && !pes->stream_type)
> +if (pes && pes->stream_type != stream_type)
>  mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc);
>
>  add_pid_to_program(prg, pid);
> diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
> index 6a830d0d99..d56cc27937 100644
> --- a/tests/ref/fate/ts-demux
> +++ b/tests/ref/fate/ts-demux
> @@ -24,6 +24,6 @@
> packet|codec_type=video|stream_index=0|pts=3912686363|pts_time=43474.292922|dts=
>
>  
> packet|codec_type=audio|stream_index=1|pts=3912644825|pts_time=43473.831389|dts=3912644825|dts_time=43473.831389|duration=2880|duration_time=0.032000|size=906|pos=474888|flags=K__|data_hash=CRC32:0893d398
>
>  
> packet|codec_type=audio|stream_index=2|pts=3912645580|pts_time=43473.839778|dts=3912645580|dts_time=43473.839778|duration=2880|duration_time=0.032000|size=354|pos=491808|flags=K__|data_hash=CRC32:f5963fa6
>  
> stream|index=0|codec_name=mpeg2video|profile=4|codec_type=video|codec_tag_string=[2][0][0][0]|codec_tag=0x0002|width=1280|height=720|coded_width=0|coded_height=0|has_b_frames=1|sample_aspect_ratio=1:1|display_aspect_ratio=16:9|pix_fmt=yuv420p|level=4|color_range=tv|color_space=unknown|color_transfer=unknown|color_primaries=unknown|chroma_location=left|field_order=progressive|refs=1|ts_id=32776|ts_packetsize=188|id=0x31|r_frame_rate=6/1001|avg_frame_rate=6/1001|time_base=1/9|start_pts=3912669846|start_time=43474.109400|duration_ts=19519|duration=0.216878|bit_rate=1500|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=15|extradata_size=150|extradata_hash=CRC32:53134fa8|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|side_datum/cpb_properties:side_data_type=CPB
> properties|side_datum/cpb_properties:max_bitrate=1500|side_datum/cpb_properties:min_bitrate=0|side_datum/cpb_properties:avg_bitrate=0|side_datum/cpb_properties:buffer_size=9781248|side_datum/cpb_properties:vbv_delay=-1
>
> -stream|index=1|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=6|channel_layout=5.1(side)|bits_per_sample=0|initial_padding=0|dmix_mode=0|ltrt_cmixlev=0.00|ltrt_surmixlev=0.00|loro_cmixlev=0.00|loro_surmixlev=0.00|ts_id=32776|ts_packetsize=188|id=0x34|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/9|start_pts=3912633305|start_time=43473.703389|duration_ts=14400|duration=0.16|bit_rate=384000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0|tag:language=eng
>
> -stream|index=2|codec_name=ac3|profile=unknown|codec_type=audio|codec_tag_string=[4][0][0][0]|codec_tag=0x0004|sample_fmt=fltp|sample_rate=48000|channels=2|channel_layout=stereo|bits_per_sample=0|initial_padding=0|dmix_mode=0|ltrt_cmixlev=0.00|ltrt_surmixlev=0.00|loro_cmixlev=0.00|loro_surmixlev=0.00|ts_id=32776|ts_packetsize=188|id=0x35|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/9|start_pts=3912634060|start_time=43473.711778|duration_ts=14400|duration=0.16|bit_rate=192000|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=5|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|dispos

Re: [FFmpeg-devel] [PATCH] avformat/wavdec: increase requested probe score for codec probe

2025-05-09 Thread Marton Balint




On Fri, 9 May 2025, Michael Niedermayer wrote:


On Fri, May 09, 2025 at 12:28:00AM +0200, Marton Balint wrote:

Codec probing was primarily added to the wav demuxer to support DTS-in-wav
files, but DTS probing functions return AVPROBE_SCORE_EXTENSION+1, so we can be
a bit more strict with the required score.

This fixes MP3 misdetections for some wav files.

Fixes ticket #11581.

Signed-off-by: Marton Balint 
---
 libavformat/wavdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index dc7e49abc4..c65e0a2723 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -178,7 +178,7 @@ static void handle_stream_probing(AVStream *st)
 {
 if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) {
 FFStream *const sti = ffstream(st);
-sti->request_probe = AVPROBE_SCORE_EXTENSION;
+sti->request_probe = AVPROBE_SCORE_EXTENSION + 1;
 sti->probe_packets = FFMIN(sti->probe_packets, 32);
 }
 }


please add a testcase to fate, if possible. Such corner cases
are important to be in fate


Sample is in the ticket, so it should be pretty trivial to do so. Can't we 
fund someone to do this and the other fixed trac tickets without fate 
tests?


Thanks,
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 v1] avcodec/apv_encoder: Updated APV encoder to set the encoder output to OAPV_CFG_VAL_AU_BS_FMT_NONE format (the only AU without bitstream format)

2025-05-09 Thread James Almer

On 5/9/2025 8:52 AM, Dawid Kozinski wrote:

Signed-off-by: Dawid Kozinski 
---
  libavcodec/liboapvenc.c | 12 
  1 file changed, 12 insertions(+)

diff --git a/libavcodec/liboapvenc.c b/libavcodec/liboapvenc.c
index 0c95489bc9..d338b33e2d 100644
--- a/libavcodec/liboapvenc.c
+++ b/libavcodec/liboapvenc.c
@@ -307,6 +307,18 @@ static av_cold int liboapve_init(AVCodecContext *avctx)
  return AVERROR_EXTERNAL;
  }
  
+{

+int size, value;
+
+value = OAPV_CFG_VAL_AU_BS_FMT_NONE;
+size = 4;
+ret = oapve_config(apv->id, OAPV_CFG_SET_AU_BS_FMT, &value, &size);
+if(OAPV_FAILED(ret)) {
+av_log(avctx, AV_LOG_ERROR, "Failed to set config for using encoder 
output format\n");
+return AVERROR_EXTERNAL;
+}
+}
+
  apv->ifrms.frm[FRM_IDX].imgb = apv_imgb_create(avctx);
  if (apv->ifrms.frm[FRM_IDX].imgb == NULL)
  return AVERROR(ENOMEM);


Before we start adding support for recent API additions, liboapv needs 
to have versioning. See 
https://github.com/AcademySoftwareFoundation/openapv/issues/86
Otherwise, we have no way to ensure certain symbols are present and 
compilation will fail if you don't have the correct git master snapshot.




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] Fw: GSoC 2025: We have a few extra slots for orgs needing 1 more contributor (random drawing)

2025-05-09 Thread Michael Niedermayer
Hi all

forwarding this, just in case any contributors finished their qualification 
task after
the deadline and their mentors want them considered for this

[for MENTORS]: In that case please mail Thilo and me ASAP

- Forwarded message from summerofcode-nore...@google.com -

Date: Thu, 08 May 2025 20:13:24 -0700
From: summerofcode-nore...@google.com
To: mich...@niedermayer.cc
Subject: GSoC 2025: We have a few extra slots for orgs  needing 1 more 
contributor (random drawing)

Google Summer of Code


Due to some organizations relinquishing GSoC contributor slots and some 
contributors withdrawing without organizational replacements in the last 48 
hours, a random drawing will be held for approximately 5 available slots. This 
number may increase slightly by the end of the upcoming weekend.

Organizations that had one specific GSoC contributor they strongly wished they 
could have selected are invited to fill out this form before Sunday, May 11th 
at 2200 UTC. Only one contributor request is allowed per organization, and the 
organization must be in agreement about their chosen candidate.

The selected organizations and their chosen contributors will be notified 
Monday around 1800 UTC.

This new process is being implemented because some organizations realized they 
had missed ranking a project, made errors in ranking proposals, or did not 
receive all the slots they had hoped for and would like an opportunity to 
include a key contributor.

Best,

Stephanie




https://summerofcode.withgoogle.com

For any questions, please contact gsoc-supp...@google.com. Replies to this 
message go to an unmonitored mailbox.

© 2025 Google LLC, 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA







- End forwarded message -

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread Marton Balint
Elapsed time is much less important than the actual progress, and I am guessing
several ffmpeg CLI frontends use the existing status line for showing progress,
so putting a new field in the beginning is less optimal anyway.

Related to ticket #11582.

Signed-off-by: Marton Balint 
---
 fftools/ffmpeg.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 24d43e6197..2e575e7b10 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t 
timer_start, int64_t cur_ti
 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
 
-secs = (int)t;
-ms = (int)((t - secs) * 1000);
-mins = secs / 60;
-secs %= 60;
-hours = mins / 60;
-mins %= 60;
-
-av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs, 
ms / 10);
-
 for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
 const float q = ost->enc ? atomic_load(&ost->quality) / (float) 
FF_QP2LAMBDA : -1;
 
@@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t 
timer_start, int64_t cur_ti
 av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
 }
 
+secs = (int)t;
+ms = (int)((t - secs) * 1000);
+mins = secs / 60;
+secs %= 60;
+hours = mins / 60;
+mins %= 60;
+
+av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs, 
ms / 10);
+
 if (print_stats || is_last_report) {
 const char end = is_last_report ? '\n' : '\r';
 if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
-- 
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] avformat/apvdec: remove unused variable

2025-05-09 Thread Leo Izen

On 5/5/25 16:31, Marvin Scholz wrote:

---
  libavformat/apvdec.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/libavformat/apvdec.c b/libavformat/apvdec.c
index e53c9ed085..1e5497bcd3 100644
--- a/libavformat/apvdec.c
+++ b/libavformat/apvdec.c
@@ -53,7 +53,6 @@ static int apv_extract_header_info(GetByteContext *gbc)
  
  if (info->pbu_type == APV_PBU_ACCESS_UNIT_INFORMATION) {

  unsigned int num_frames = bytestream2_get_be16(gbc);
-int pbu_type;
  
  if (num_frames < 1)

  return AVERROR_INVALIDDATA;


I almost sent an identical patch, good thing I checked the ML.

LGTM, will apply.

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


Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line

2025-05-09 Thread James Almer

On 5/9/2025 9:06 AM, Marton Balint wrote:

Elapsed time is much less important than the actual progress, and I am guessing
several ffmpeg CLI frontends use the existing status line for showing progress,
so putting a new field in the beginning is less optimal anyway.


LGTM, but for the record, we don't guarantee the printed output to be 
unchanged across versions, so anyone having scripts depending on that 
will have a bad time.




Related to ticket #11582.

Signed-off-by: Marton Balint 
---
  fftools/ffmpeg.c | 18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 24d43e6197..2e575e7b10 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t 
timer_start, int64_t cur_ti
  av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
  av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
  
-secs = (int)t;

-ms = (int)((t - secs) * 1000);
-mins = secs / 60;
-secs %= 60;
-hours = mins / 60;
-mins %= 60;
-
-av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs, 
ms / 10);
-
  for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
  const float q = ost->enc ? atomic_load(&ost->quality) / (float) 
FF_QP2LAMBDA : -1;
  
@@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti

  av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
  }
  
+secs = (int)t;

+ms = (int)((t - secs) * 1000);
+mins = secs / 60;
+secs %= 60;
+hours = mins / 60;
+mins %= 60;
+
+av_bprintf(&buf, " elapsed=%"PRId64":%02d:%02d.%02d", hours, mins, secs, 
ms / 10);
+
  if (print_stats || is_last_report) {
  const char end = is_last_report ? '\n' : '\r';
  if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {




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 v5 4/7] ogg/flac: implement header packet skip in chained ogg bitstreams.

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggparseflac.c   | 28 ++--
 tests/ref/fate/ogg-flac-chained-meta.txt |  2 --
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c
index f25ed9cc15..d66b85b09e 100644
--- a/libavformat/oggparseflac.c
+++ b/libavformat/oggparseflac.c
@@ -27,6 +27,8 @@
 #include "oggdec.h"
 
 #define OGG_FLAC_METADATA_TYPE_STREAMINFO 0x7F
+#define OGG_FLAC_MAGIC "\177FLAC"
+#define OGG_FLAC_MAGIC_SIZE sizeof(OGG_FLAC_MAGIC)-1
 
 static int
 flac_header (AVFormatContext * s, int idx)
@@ -78,6 +80,27 @@ flac_header (AVFormatContext * s, int idx)
 return 1;
 }
 
+static int
+flac_packet (AVFormatContext * s, int idx)
+{
+struct ogg *ogg = s->priv_data;
+struct ogg_stream *os = ogg->streams + idx;
+
+if (os->psize > OGG_FLAC_MAGIC_SIZE &&
+!memcmp(
+os->buf + os->pstart,
+OGG_FLAC_MAGIC,
+OGG_FLAC_MAGIC_SIZE))
+return 1;
+
+if (os->psize > 0 &&
+((os->buf[os->pstart] & 0x7F) == FLAC_METADATA_TYPE_VORBIS_COMMENT)) {
+return 1;
+}
+
+return 0;
+}
+
 static int
 old_flac_header (AVFormatContext * s, int idx)
 {
@@ -127,10 +150,11 @@ fail:
 }
 
 const struct ogg_codec ff_flac_codec = {
-.magic = "\177FLAC",
-.magicsize = 5,
+.magic = OGG_FLAC_MAGIC,
+.magicsize = OGG_FLAC_MAGIC_SIZE,
 .header = flac_header,
 .nb_header = 2,
+.packet = flac_packet,
 };
 
 const struct ogg_codec ff_old_flac_codec = {
diff --git a/tests/ref/fate/ogg-flac-chained-meta.txt 
b/tests/ref/fate/ogg-flac-chained-meta.txt
index ad20ba935f..28e22aa29e 100644
--- a/tests/ref/fate/ogg-flac-chained-meta.txt
+++ b/tests/ref/fate/ogg-flac-chained-meta.txt
@@ -5,8 +5,6 @@ Stream ID: 0, frame PTS: 0, metadata: N/A
 Stream ID: 0, packet PTS: 4608, packet DTS: 4608
 Stream ID: 0, frame PTS: 4608, metadata: N/A
 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: N/A
 Stream ID: 0, packet PTS: 4608, packet DTS: 4608
 Stream ID: 0, frame PTS: 4608, metadata: N/A
-- 
2.39.5 (Apple Git-154)

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

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


[FFmpeg-devel] [PATCH v5 2/7] libavformat/oggdec.{c, h}: Implement packet skip on packet return value of 1

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggdec.c | 22 ++
 libavformat/oggdec.h |  1 +
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 5339fdd32c..9baf8040a9 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -605,20 +605,26 @@ static int ogg_packet(AVFormatContext *s, int *sid, int 
*dstart, int *dsize,
 } else {
 os->pflags= 0;
 os->pduration = 0;
+
+ret = 0;
 if (os->codec && os->codec->packet) {
 if ((ret = os->codec->packet(s, idx)) < 0) {
 av_log(s, AV_LOG_ERROR, "Packet processing failed: %s\n", 
av_err2str(ret));
 return ret;
 }
 }
-if (sid)
-*sid = idx;
-if (dstart)
-*dstart = os->pstart;
-if (dsize)
-*dsize = os->psize;
-if (fpos)
-*fpos = os->sync_pos;
+
+if (!ret) {
+if (sid)
+*sid = idx;
+if (dstart)
+*dstart = os->pstart;
+if (dsize)
+*dsize = os->psize;
+if (fpos)
+*fpos = os->sync_pos;
+}
+
 os->pstart  += os->psize;
 os->psize= 0;
 if(os->pstart == os->bufpos)
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 5225b77a07..bc670d0f1e 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -43,6 +43,7 @@ struct ogg_codec {
  * @return < 0 (AVERROR) code or -1 on error
  * == 0 if the packet was a regular data packet.
  * == 0 or 1 if the packet was a header from a chained bitstream.
+ *   (1 will cause the packet to be skiped in calling code 
(ogg_packet())
  */
 int (*packet)(AVFormatContext *, int);
 /**
-- 
2.39.5 (Apple Git-154)

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

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


[FFmpeg-devel] [PATCH v5 1/7] libavformat/oggdec.h: Document packet function return value.

2025-05-09 Thread Romain Beauxis
---
 libavformat/oggdec.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 43df23f4cb..5225b77a07 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -38,6 +38,12 @@ struct ogg_codec {
  * -1 if an error occurred or for unsupported stream
  */
 int (*header)(AVFormatContext *, int);
+/**
+ * Attempt to process a packet as a data packet
+ * @return < 0 (AVERROR) code or -1 on error
+ * == 0 if the packet was a regular data packet.
+ * == 0 or 1 if the packet was a header from a chained bitstream.
+ */
 int (*packet)(AVFormatContext *, int);
 /**
  * Translate a granule into a timestamp.
-- 
2.39.5 (Apple Git-154)

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

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


Re: [FFmpeg-devel] [PATCH 1/7] avcodec/mmvideo: fix paltte index

2025-05-09 Thread Peter Ross
On Thu, May 08, 2025 at 11:57:32PM +0200, Michael Niedermayer wrote:
> Fixes: 
> 391935573/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MMVIDEO_fuzzer-4655048979709952
> Fixes: out of array access
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mmvideo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
> index 7313507debc..2a0c855992e 100644
> --- a/libavcodec/mmvideo.c
> +++ b/libavcodec/mmvideo.c
> @@ -91,7 +91,7 @@ static void mm_decode_pal(MmContext *s)
>  int start = bytestream2_get_le16(&s->gb);
>  int count = bytestream2_get_le16(&s->gb);
>  for (int i = 0; i < count; i++)
> -s->palette[start+i] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) << 
> 2);
> +s->palette[(start+i)&0xFF] = 0xFFU << 24 | 
> (bytestream2_get_be24(&s->gb) << 2);
>  }
>

please apply

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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 4/7] avformat/iff: Check nb_channels == 0 in MHDR

2025-05-09 Thread Peter Ross
On Thu, May 08, 2025 at 11:57:35PM +0200, Michael Niedermayer wrote:
> Fixes: division by 0
> Fixes: 
> 395163171/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-542604339373670
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/iff.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/iff.c b/libavformat/iff.c
> index 7142a06e98f..9402be48c98 100644
> --- a/libavformat/iff.c
> +++ b/libavformat/iff.c
> @@ -510,6 +510,8 @@ static int iff_read_header(AVFormatContext *s)
>  sta->codecpar->ch_layout = 
> (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
>  else if (sta->codecpar->ch_layout.nb_channels == 2)
>  sta->codecpar->ch_layout = 
> (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
> +else if (sta->codecpar->ch_layout.nb_channels == 0)
> +return AVERROR_INVALIDDATA;
>  break;
>  
>  case ID_ABIT:

please apply

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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 6/7] avcodec/rv60dec: inter also fails with qp >= 32

2025-05-09 Thread Peter Ross
On Thu, May 08, 2025 at 11:57:37PM +0200, Michael Niedermayer wrote:
> Fixes: out of array read in decode_cu_16x16()
> Fixes: 
> 398049430/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5525836849807360
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/rv60dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
> index 24981015a94..d704ae512c2 100644
> --- a/libavcodec/rv60dec.c
> +++ b/libavcodec/rv60dec.c
> @@ -1791,7 +1791,7 @@ static int decode_cu_r(RV60Context * s, AVFrame * 
> frame, ThreadContext * thread,
>  ttype = cu.pu_type == PU_FULL ? TRANSFORM_8X8 : TRANSFORM_4X4;
>  
>  is_intra = cu.cu_type == CU_INTRA;
> -if (is_intra && qp >= 32)
> +if (qp >= 32)
>  return AVERROR_INVALIDDATA;
>  cu_pos = ((xpos & 63) >> 3) + ((ypos & 63) >> 3) * 8;

please apply

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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 4/7] avformat/iff: Check nb_channels == 0 in MHDR

2025-05-09 Thread Michael Niedermayer
On Fri, May 09, 2025 at 07:07:19PM +1000, Peter Ross wrote:
> On Thu, May 08, 2025 at 11:57:35PM +0200, Michael Niedermayer wrote:
> > Fixes: division by 0
> > Fixes: 
> > 395163171/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-542604339373670
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/iff.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavformat/iff.c b/libavformat/iff.c
> > index 7142a06e98f..9402be48c98 100644
> > --- a/libavformat/iff.c
> > +++ b/libavformat/iff.c
> > @@ -510,6 +510,8 @@ static int iff_read_header(AVFormatContext *s)
> >  sta->codecpar->ch_layout = 
> > (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
> >  else if (sta->codecpar->ch_layout.nb_channels == 2)
> >  sta->codecpar->ch_layout = 
> > (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
> > +else if (sta->codecpar->ch_layout.nb_channels == 0)
> > +return AVERROR_INVALIDDATA;
> >  break;
> >  
> >  case ID_ABIT:
> 
> please apply

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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

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


Re: [FFmpeg-devel] [PATCH] avformat/wavdec: increase requested probe score for codec probe

2025-05-09 Thread Michael Niedermayer
On Fri, May 09, 2025 at 12:28:00AM +0200, Marton Balint wrote:
> Codec probing was primarily added to the wav demuxer to support DTS-in-wav
> files, but DTS probing functions return AVPROBE_SCORE_EXTENSION+1, so we can 
> be
> a bit more strict with the required score.
> 
> This fixes MP3 misdetections for some wav files.
> 
> Fixes ticket #11581.
> 
> Signed-off-by: Marton Balint 
> ---
>  libavformat/wavdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index dc7e49abc4..c65e0a2723 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -178,7 +178,7 @@ static void handle_stream_probing(AVStream *st)
>  {
>  if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) {
>  FFStream *const sti = ffstream(st);
> -sti->request_probe = AVPROBE_SCORE_EXTENSION;
> +sti->request_probe = AVPROBE_SCORE_EXTENSION + 1;
>  sti->probe_packets = FFMIN(sti->probe_packets, 32);
>  }
>  }

please add a testcase to fate, if possible. Such corner cases
are important to be in fate

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- 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 1/7] avcodec/mmvideo: fix paltte index

2025-05-09 Thread Michael Niedermayer
On Fri, May 09, 2025 at 07:06:42PM +1000, Peter Ross wrote:
> On Thu, May 08, 2025 at 11:57:32PM +0200, Michael Niedermayer wrote:
> > Fixes: 
> > 391935573/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MMVIDEO_fuzzer-4655048979709952
> > Fixes: out of array access
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/mmvideo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
> > index 7313507debc..2a0c855992e 100644
> > --- a/libavcodec/mmvideo.c
> > +++ b/libavcodec/mmvideo.c
> > @@ -91,7 +91,7 @@ static void mm_decode_pal(MmContext *s)
> >  int start = bytestream2_get_le16(&s->gb);
> >  int count = bytestream2_get_le16(&s->gb);
> >  for (int i = 0; i < count; i++)
> > -s->palette[start+i] = 0xFFU << 24 | (bytestream2_get_be24(&s->gb) 
> > << 2);
> > +s->palette[(start+i)&0xFF] = 0xFFU << 24 | 
> > (bytestream2_get_be24(&s->gb) << 2);
> >  }
> >
> 
> please apply

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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 7/7] avcodec/hevc/ps: Fix dependant layer id check

2025-05-09 Thread Michael Niedermayer
On Thu, May 08, 2025 at 07:10:38PM -0300, James Almer wrote:
> On 5/8/2025 6:57 PM, Michael Niedermayer wrote:
> > Fixes: shift exponent 49 is too large for 32-bit type 'int'
> > Fixes: 
> > 398060145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5023082406543360
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >   libavcodec/hevc/ps.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
> > index 24f4218931d..4b021ea9c1f 100644
> > --- a/libavcodec/hevc/ps.c
> > +++ b/libavcodec/hevc/ps.c
> > @@ -652,8 +652,8 @@ static int decode_vps_ext(GetBitContext *gb, 
> > AVCodecContext *avctx, HEVCVPS *vps
> >   /* Consequence of established layer dependencies */
> >   if (layer1_id_included &&
> > -layer1_id_included != ((1 << vps->layer_id_in_nuh[0]) |
> > -   (1 << vps->layer_id_in_nuh[1]))) {
> > +layer1_id_included != ((1ULL << vps->layer_id_in_nuh[0]) |
> > +   (1ULL << vps->layer_id_in_nuh[1]))) {
> 
> LGTM.

will apply

thx

[...]

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


Re: [FFmpeg-devel] [PATCH 6/7] avcodec/rv60dec: inter also fails with qp >= 32

2025-05-09 Thread Michael Niedermayer
On Fri, May 09, 2025 at 07:07:51PM +1000, Peter Ross wrote:
> On Thu, May 08, 2025 at 11:57:37PM +0200, Michael Niedermayer wrote:
> > Fixes: out of array read in decode_cu_16x16()
> > Fixes: 
> > 398049430/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5525836849807360
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/rv60dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/rv60dec.c b/libavcodec/rv60dec.c
> > index 24981015a94..d704ae512c2 100644
> > --- a/libavcodec/rv60dec.c
> > +++ b/libavcodec/rv60dec.c
> > @@ -1791,7 +1791,7 @@ static int decode_cu_r(RV60Context * s, AVFrame * 
> > frame, ThreadContext * thread,
> >  ttype = cu.pu_type == PU_FULL ? TRANSFORM_8X8 : TRANSFORM_4X4;
> >  
> >  is_intra = cu.cu_type == CU_INTRA;
> > -if (is_intra && qp >= 32)
> > +if (qp >= 32)
> >  return AVERROR_INVALIDDATA;
> >  cu_pos = ((xpos & 63) >> 3) + ((ypos & 63) >> 3) * 8;
> 
> please apply

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


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 v2] avfilter/vf_lut3d_opencl Initial support for OpenCL implementation of vf_lut3d.

2025-05-09 Thread Jan Studený via ffmpeg-devel
Hi,
Since this is my first FFmpeg patch I’m not sure if I should include anything 
extra to make the review easier, like logs, test results, or more explanation.

Please let me know if there’s anything I can add or do differently.

Best regards,

Jan Studený
On May 1, 2025 at 20:13 +0300, Jan Studený , wrote:

> The comile error is fixed by adding opencl dependency to configure.
>
> ---
> configure | 1 +
> libavfilter/Makefile | 1 +
> libavfilter/allfilters.c | 1 +
> libavfilter/opencl/lut3d.cl | 177 +
> libavfilter/opencl_source.h | 2 +
> libavfilter/vf_lut3d_opencl.c | 460 ++
> 6 files changed, 642 insertions(+)
> create mode 100644 libavfilter/opencl/lut3d.cl
> create mode 100644 libavfilter/vf_lut3d_opencl.c
>
> diff --git a/configure b/configure
> index ee270b770c..9b9ea3b39b 100755
> --- a/configure
> +++ b/configure
> @@ -3934,6 +3934,7 @@ ladspa_filter_deps="ladspa libdl"
> lcevc_filter_deps="liblcevc_dec"
> lensfun_filter_deps="liblensfun version3"
> libplacebo_filter_deps="libplacebo vulkan"
> +lut3d_opencl_filter_deps="opencl"
> lv2_filter_deps="lv2"
> mcdeint_filter_deps="avcodec gpl"
> metadata_filter_deps="avformat"
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 7c0d879ec9..6524d0f91a 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -378,6 +378,7 @@ OBJS-$(CONFIG_LUT1D_FILTER) += vf_lut3d.o
> OBJS-$(CONFIG_LUT_FILTER) += vf_lut.o
> OBJS-$(CONFIG_LUT2_FILTER) += vf_lut2.o framesync.o
> OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o framesync.o
> +OBJS-$(CONFIG_LUT3D_OPENCL_FILTER) += vf_lut3d_opencl.o opencl.o 
> opencl/lut3d.o
> OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o
> OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o
> OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 740d9ab265..72c2f48ac4 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -353,6 +353,7 @@ extern const FFFilter ff_vf_lut;
> extern const FFFilter ff_vf_lut1d;
> extern const FFFilter ff_vf_lut2;
> extern const FFFilter ff_vf_lut3d;
> +extern const FFFilter ff_vf_lut3d_opencl;
> extern const FFFilter ff_vf_lutrgb;
> extern const FFFilter ff_vf_lutyuv;
> extern const FFFilter ff_vf_maskedclamp;
> diff --git a/libavfilter/opencl/lut3d.cl b/libavfilter/opencl/lut3d.cl
> new file mode 100644
> index 00..16dfecdc4e
> --- /dev/null
> +++ b/libavfilter/opencl/lut3d.cl
> @@ -0,0 +1,177 @@
> +/*
> + * Copyright (c) 2025 Jan Studeny
> + *
> + * 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
> + */
> +
> +typedef struct rgbvec {
> + float r, g, b, a;
> +} rgbvec;
> +
> +#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
> +
> +#define NEAR(x) ((int)((x) + .5))
> +#define PREV(x) ((int)(x))
> +#define NEXT(x) (MIN((int)(x) + 1, lut_edge_size - 1))
> +
> +/**
> + * Get the nearest defined point
> + */
> +static rgbvec interp_nearest(float4 px, __global const rgbvec *lut, int 
> lut_edge_size)
> +{
> + int r = NEAR(px[0]);
> + int g = NEAR(px[1]);
> + int b = NEAR(px[2]);
> + int index = r * lut_edge_size * lut_edge_size + g * lut_edge_size + b;
> + return lut[index];
> +}
> +
> +static float lerpf(float v0, float v1, float f)
> +{
> + return v0 + (v1 - v0) * f;
> +}
> +
> +static rgbvec lerp(const rgbvec *v0, const rgbvec *v1, float f)
> +{
> + rgbvec v = {
> + lerpf(v0->r, v1->r, f), lerpf(v0->g, v1->g, f), lerpf(v0->b, v1->b, f)
> + };
> + return v;
> +}
> +/**
> + * Interpolate using the 8 vertices of a cube
> + * @see https://en.wikipedia.org/wiki/Trilinear_interpolation
> + */
> +static rgbvec interp_trilinear(float4 px, __global const rgbvec *lut, int 
> lut_edge_size)
> +{
> + const int lutsize2 = lut_edge_size * lut_edge_size;
> + const int lutsize = lut_edge_size;
> +
> + const int prev[] = { PREV(px[0]), PREV(px[1]), PREV(px[2]) };
> + const int next[] = { NEXT(px[0]), NEXT(px[1]), NEXT(px[2]) };
> +
> + const rgbvec d = {
> + px[0] - prev[0],
> + px[1] - prev[1],
> + px[2] - prev[2]
> + };
> +
> + const rgbvec c000 = lut[prev[0] * lutsize2 + prev[1] * lutsize + prev[2]];
> + const rgbvec c001 = lut[prev[0] * lutsize2 + prev[1] * lutsize + next[2]];
> + const rgbvec c010 = lut[prev[0] * lutsize2 + next[1] 

Re: [FFmpeg-devel] [PATCH 0/5] doc/developer: Add subsection about patch submission via FFstaging

2025-05-09 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Nicolas
> George
> Sent: Donnerstag, 8. Mai 2025 14:47
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH 0/5] doc/developer: Add subsection about
> patch submission via FFstaging
> 
> Lynne (HE12025-05-08):
> > If its mentioned as part of our documentation, it's official.
> 
> I second your objection to this.
> 
> This proposal comes from softworkz, who has been here barely two
> minutes

For the record, if we consider the existence of FFmpeg as an hour,
like you are seeming to allude to and look at the first commit as
evidence for being here, then we get to the following results:

+---++
| Fabrice   | 60 min |
+---++
| Michael   | 58 min |
+---++
| Nicolas   | 44 min |
+---++
| James | 32 min |
+---++
| softworkz | 22 min |
+---++
| Andreas   | 16 min |
+---++
| Lynne | 15 min |
+---++

It obviously doesn't say anything about the amount of contribution,
but well - it was _your_ analogy.

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