* [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
@ 2025-03-11 16:55 Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame Romain Beauxis
` (8 more replies)
0 siblings, 9 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
This is a series of patches to allow proper decoding of ogg metadata in chained
`ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
## Changes since last version:
* Moved textual reference output for tests to test/ref/fate
* Updated test binary to only output stream metadata when
AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
Romain Beauxis (8):
libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet
extra data, attach them to the next decoded frame.
tests: Add stream dump test API util.
tests: Add chained ogg/vorbis stream dump test.
libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis
metadata update mechanism.
libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg
packets, add them to ogg stream new_metadata.
tests: Add chained ogg/flac stream dump test.
libavformat/oggparseopus.c: Parse comments from secondary chained
streams header packet.
tests: Add chained ogg/opus stream dump test.
libavcodec/decode.c | 20 +++
libavformat/oggdec.h | 14 ++
libavformat/oggparseflac.c | 21 +++
libavformat/oggparseopus.c | 13 +-
libavformat/oggparsevorbis.c | 25 ++-
tests/Makefile | 4 +
tests/api/Makefile | 2 +-
tests/api/api-dump-stream-meta-test.c | 179 +++++++++++++++++++++
tests/fate/ogg-flac.mak | 11 ++
tests/fate/ogg-opus.mak | 11 ++
tests/fate/ogg-vorbis.mak | 11 ++
tests/ref/fate/ogg-flac-chained-meta.txt | 13 ++
tests/ref/fate/ogg-opus-chained-meta.txt | 27 ++++
tests/ref/fate/ogg-vorbis-chained-meta.txt | 17 ++
14 files changed, 358 insertions(+), 10 deletions(-)
create mode 100644 tests/api/api-dump-stream-meta-test.c
create mode 100644 tests/fate/ogg-flac.mak
create mode 100644 tests/fate/ogg-opus.mak
create mode 100644 tests/fate/ogg-vorbis.mak
create mode 100644 tests/ref/fate/ogg-flac-chained-meta.txt
create mode 100644 tests/ref/fate/ogg-opus-chained-meta.txt
create mode 100644 tests/ref/fate/ogg-vorbis-chained-meta.txt
--
2.39.5 (Apple Git-154)
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 2/8] tests: Add stream dump test API util Romain Beauxis
` (7 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
libavcodec/decode.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index c5a577f4f1..8907e4e5a2 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -97,6 +97,8 @@ typedef struct DecodeContext {
int lcevc_frame;
int width;
int height;
+
+ AVDictionary *pending_metadata;
} DecodeContext;
static DecodeContext *decode_ctx(AVCodecInternal *avci)
@@ -729,6 +731,8 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
{
AVCodecInternal *avci = avctx->internal;
DecodeContext *dc = decode_ctx(avci);
+ const uint8_t *side_metadata;
+ size_t size;
int ret;
if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
@@ -746,6 +750,14 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
ret = av_packet_ref(avci->buffer_pkt, avpkt);
if (ret < 0)
return ret;
+
+ side_metadata = av_packet_get_side_data(avpkt, AV_PKT_DATA_METADATA_UPDATE, &size);
+ if (side_metadata) {
+ av_dict_free(&dc->pending_metadata);
+ ret = av_packet_unpack_dictionary(side_metadata, size, &dc->pending_metadata);
+ if (ret < 0)
+ return ret;
+ }
} else
dc->draining_started = 1;
@@ -815,6 +827,7 @@ fail:
int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
{
AVCodecInternal *avci = avctx->internal;
+ DecodeContext *dc = decode_ctx(avci);
int ret;
if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
@@ -887,6 +900,12 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
}
}
#endif
+
+ if (dc->pending_metadata) {
+ av_dict_copy(&frame->metadata, dc->pending_metadata, AV_DICT_APPEND);
+ av_dict_free(&dc->pending_metadata);
+ }
+
return 0;
fail:
av_frame_unref(frame);
@@ -2323,4 +2342,5 @@ void ff_decode_internal_uninit(AVCodecContext *avctx)
DecodeContext *dc = decode_ctx(avci);
av_refstruct_unref(&dc->lcevc);
+ av_dict_free(&dc->pending_metadata);
}
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 2/8] tests: Add stream dump test API util.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 3/8] tests: Add chained ogg/vorbis stream dump test Romain Beauxis
` (6 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
tests/Makefile | 1 +
tests/api/Makefile | 2 +-
tests/api/api-dump-stream-meta-test.c | 179 ++++++++++++++++++++++++++
3 files changed, 181 insertions(+), 1 deletion(-)
create mode 100644 tests/api/api-dump-stream-meta-test.c
diff --git a/tests/Makefile b/tests/Makefile
index f9f5fc07f3..1f7e5003c2 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -277,6 +277,7 @@ $(FATE_FFPROBE) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_FFPROBE) $(FATE_SAMPLES_FF
$(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF)
$(FATE_SAMPLES_DUMP_DATA) $(FATE_SAMPLES_DUMP_DATA-yes): tools/venc_data_dump$(EXESUF)
$(FATE_SAMPLES_SCALE_SLICE): tools/scale_slice_test$(EXESUF)
+$(FATE_SAMPLES_DUMP_STREAM_META): tests/api/api-dump-stream-meta-test$(EXESUF)
ifdef SAMPLES
FATE += $(FATE_EXTERN)
diff --git a/tests/api/Makefile b/tests/api/Makefile
index c96e636756..a2cb06a729 100644
--- a/tests/api/Makefile
+++ b/tests/api/Makefile
@@ -1,7 +1,7 @@
APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac
APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264
APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264-slice
-APITESTPROGS-yes += api-seek
+APITESTPROGS-yes += api-seek api-dump-stream-meta
APITESTPROGS-$(call DEMDEC, H263, H263) += api-band
APITESTPROGS-$(HAVE_THREADS) += api-threadmessage
APITESTPROGS += $(APITESTPROGS-yes)
diff --git a/tests/api/api-dump-stream-meta-test.c b/tests/api/api-dump-stream-meta-test.c
new file mode 100644
index 0000000000..f44ad476e6
--- /dev/null
+++ b/tests/api/api-dump-stream-meta-test.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2025 Romain Beauxis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/**
+ * Dump stream metadata
+ */
+
+#include "libavcodec/avcodec.h"
+#include "libavformat/avformat.h"
+#include "libavutil/timestamp.h"
+
+static int dump_stream_meta(const char *input_filename) {
+ const AVCodec *codec = NULL;
+ AVPacket *pkt = NULL;
+ AVFrame *fr = NULL;
+ AVFormatContext *fmt_ctx = NULL;
+ AVCodecContext *ctx = NULL;
+ AVCodecParameters *origin_par = NULL;
+ AVStream *st;
+ int audio_stream;
+ int result;
+ char *metadata;
+
+ result = avformat_open_input(&fmt_ctx, input_filename, NULL, NULL);
+ if (result < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Can't open file\n");
+ return result;
+ }
+
+ result = avformat_find_stream_info(fmt_ctx, NULL);
+ if (result < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Can't get stream info\n");
+ goto end;
+ }
+
+ // TODO: add ability to work with video format
+ audio_stream =
+ av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);
+ if (audio_stream < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Can't find audio stream in input file\n");
+ result = audio_stream;
+ goto end;
+ }
+
+ origin_par = fmt_ctx->streams[audio_stream]->codecpar;
+ st = fmt_ctx->streams[audio_stream];
+
+ result = av_dict_get_string(st->metadata, &metadata, '=', ':');
+ if (result < 0)
+ goto end;
+
+ printf("Stream ID: %d, codec name: %s, metadata: %s\n", audio_stream,
+ avcodec_get_name(origin_par->codec_id), metadata);
+
+ codec = avcodec_find_decoder(origin_par->codec_id);
+ if (!codec) {
+ av_log(NULL, AV_LOG_ERROR, "Can't find decoder\n");
+ result = AVERROR_DECODER_NOT_FOUND;
+ goto end;
+ }
+
+ ctx = avcodec_alloc_context3(codec);
+ if (!ctx) {
+ av_log(NULL, AV_LOG_ERROR, "Can't allocate decoder context\n");
+ result = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ result = avcodec_parameters_to_context(ctx, origin_par);
+ if (result) {
+ av_log(NULL, AV_LOG_ERROR, "Can't copy decoder context\n");
+ goto end;
+ }
+
+ result = avcodec_open2(ctx, codec, NULL);
+ if (result < 0) {
+ av_log(ctx, AV_LOG_ERROR, "Can't open decoder\n");
+ goto end;
+ }
+
+ pkt = av_packet_alloc();
+ if (!pkt) {
+ av_log(NULL, AV_LOG_ERROR, "Cannot allocate packet\n");
+ result = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ fr = av_frame_alloc();
+ if (!fr) {
+ av_log(NULL, AV_LOG_ERROR, "Can't allocate frame\n");
+ result = AVERROR(ENOMEM);
+ goto end;
+ }
+
+ for (;;) {
+ result = av_read_frame(fmt_ctx, pkt);
+ if (result)
+ goto end;
+
+ if (pkt->stream_index != audio_stream) {
+ av_packet_unref(pkt);
+ continue;
+ }
+
+ printf("Stream ID: %d, packet PTS: %s, packet DTS: %s\n",
+ pkt->stream_index, av_ts2str(pkt->pts), av_ts2str(pkt->dts));
+
+ if (st->event_flags & AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
+ result = av_dict_get_string(st->metadata, &metadata, '=', ':');
+ if (result < 0)
+ goto end;
+
+ printf("Stream ID: %d, new metadata: %s\n", pkt->stream_index,
+ metadata);
+
+ st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
+ }
+
+ result = avcodec_send_packet(ctx, pkt);
+ av_packet_unref(pkt);
+
+ if (result < 0)
+ goto end;
+
+ result = avcodec_receive_frame(ctx, fr);
+ if (result == AVERROR_EOF) {
+ result = 0;
+ goto end;
+ }
+
+ if (result == AVERROR(EAGAIN))
+ continue;
+
+ result = av_dict_get_string(fr->metadata, &metadata, '=', ':');
+ if (result < 0)
+ goto end;
+
+ printf("Stream ID: %d, frame PTS: %s, metadata: %s\n",
+ pkt->stream_index, av_ts2str(fr->pts), metadata);
+ }
+
+end:
+ av_packet_free(&pkt);
+ av_frame_free(&fr);
+ avformat_close_input(&fmt_ctx);
+ avcodec_free_context(&ctx);
+ return result;
+}
+
+int main(int argc, char **argv) {
+ if (argc < 2) {
+ av_log(NULL, AV_LOG_ERROR, "Incorrect input\n");
+ return 1;
+ }
+
+ if (dump_stream_meta(argv[1]) != AVERROR_EOF)
+ return 1;
+
+ return 0;
+}
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 3/8] tests: Add chained ogg/vorbis stream dump test.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 2/8] tests: Add stream dump test API util Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 4/8] libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis metadata update mechanism Romain Beauxis
` (5 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
tests/Makefile | 1 +
tests/fate/ogg-vorbis.mak | 11 +++++++++++
tests/ref/fate/ogg-vorbis-chained-meta.txt | 17 +++++++++++++++++
3 files changed, 29 insertions(+)
create mode 100644 tests/fate/ogg-vorbis.mak
create mode 100644 tests/ref/fate/ogg-vorbis-chained-meta.txt
diff --git a/tests/Makefile b/tests/Makefile
index 1f7e5003c2..cffa586e8d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -219,6 +219,7 @@ include $(SRC_PATH)/tests/fate/mpeg4.mak
include $(SRC_PATH)/tests/fate/mpegps.mak
include $(SRC_PATH)/tests/fate/mpegts.mak
include $(SRC_PATH)/tests/fate/mxf.mak
+include $(SRC_PATH)/tests/fate/ogg-vorbis.mak
include $(SRC_PATH)/tests/fate/oma.mak
include $(SRC_PATH)/tests/fate/opus.mak
include $(SRC_PATH)/tests/fate/pcm.mak
diff --git a/tests/fate/ogg-vorbis.mak b/tests/fate/ogg-vorbis.mak
new file mode 100644
index 0000000000..d5756dd63c
--- /dev/null
+++ b/tests/fate/ogg-vorbis.mak
@@ -0,0 +1,11 @@
+FATE_OGG_VORBIS += fate-ogg-vorbis-chained-meta
+fate-ogg-vorbis-chained-meta: REF = $(SRC_PATH)/tests/ref/fate/ogg-vorbis-chained-meta.txt
+fate-ogg-vorbis-chained-meta: CMD = $(APITESTSDIR)/api-dump-stream-meta-test$(EXESUF) $(TARGET_SAMPLES)/ogg-vorbis/chained-meta.ogg
+
+FATE_OGG_VORBIS-$(call DEMDEC, OGG, VORBIS) += $(FATE_OGG_VORBIS)
+
+FATE_SAMPLES_DUMP_STREAM_META += $(FATE_OGG_VORBIS-yes)
+
+FATE_EXTERN += $(FATE_OGG_VORBIS-yes)
+
+fate-ogg-vorbis: $(FATE_OGG_VORBIS-yes)
diff --git a/tests/ref/fate/ogg-vorbis-chained-meta.txt b/tests/ref/fate/ogg-vorbis-chained-meta.txt
new file mode 100644
index 0000000000..57cb285b92
--- /dev/null
+++ b/tests/ref/fate/ogg-vorbis-chained-meta.txt
@@ -0,0 +1,17 @@
+Stream ID: 0, codec name: vorbis, metadata: encoder=Lavc61.19.100 libvorbis:title=First Stream
+Stream ID: 0, packet PTS: 0, packet DTS: 0
+Stream ID: 0, new metadata: encoder=Lavc61.19.100 libvorbis:title=First Stream
+Stream ID: 0, packet PTS: 128, packet DTS: 128
+Stream ID: 0, frame PTS: 128, metadata: encoder=Lavc61.19.100 libvorbis:title=First Stream
+Stream ID: 0, packet PTS: 704, packet DTS: 704
+Stream ID: 0, frame PTS: 704, metadata:
+Stream ID: 0, packet PTS: 0, packet DTS: 0
+Stream ID: 0, packet PTS: 0, packet DTS: 0
+Stream ID: 0, new metadata: encoder=Lavc61.19.100 libvorbis:title=Second Stream
+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 libvorbis:title=Second Stream
+Stream ID: 0, packet PTS: 128, packet DTS: 128
+Stream ID: 0, frame PTS: 128, metadata:
+Stream ID: 0, packet PTS: 704, packet DTS: 704
+Stream ID: 0, frame PTS: 704, metadata:
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 4/8] libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis metadata update mechanism.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (2 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 3/8] tests: Add chained ogg/vorbis stream dump test Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 5/8] libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata Romain Beauxis
` (4 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
libavformat/oggdec.h | 14 ++++++++++++++
libavformat/oggparsevorbis.c | 25 +++++++++++++++++--------
2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index 43df23f4cb..c8460a66e9 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -151,6 +151,20 @@ int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m,
int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st,
const uint8_t *buf, int size);
+/**
+ * Parse Vorbis comments, add metadata to an AVStream
+ *
+ * This function also attaches the metadata to the next decoded
+ * packet as AV_PKT_DATA_METADATA_UPDATE
+ *
+ * @note The buffer will be temporarily modifed by this function,
+ * so it needs to be writable. Furthermore it must be padded
+ * by a single byte (not counted in size).
+ * All changes will have been reverted upon return.
+ */
+int ff_vorbis_update_metadata(AVFormatContext *s, AVStream *st,
+ const uint8_t *buf, int size);
+
static inline int
ogg_find_stream (struct ogg * ogg, int serial)
{
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 9f50ab9ffc..308deb7feb 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -263,20 +263,16 @@ static void vorbis_cleanup(AVFormatContext *s, int idx)
}
}
-static int vorbis_update_metadata(AVFormatContext *s, int idx)
+int ff_vorbis_update_metadata(AVFormatContext *s, AVStream *st,
+ const uint8_t *buf, int size)
{
struct ogg *ogg = s->priv_data;
- struct ogg_stream *os = ogg->streams + idx;
- AVStream *st = s->streams[idx];
+ struct ogg_stream *os = ogg->streams + st->index;
int ret;
- if (os->psize <= 8)
- return 0;
-
/* New metadata packet; release old data. */
av_dict_free(&st->metadata);
- ret = ff_vorbis_stream_comment(s, st, os->buf + os->pstart + 7,
- os->psize - 8);
+ ret = ff_vorbis_stream_comment(s, st, buf, size);
if (ret < 0)
return ret;
@@ -293,6 +289,19 @@ static int vorbis_update_metadata(AVFormatContext *s, int idx)
return ret;
}
+static int vorbis_update_metadata(AVFormatContext *s, int idx)
+{
+ struct ogg *ogg = s->priv_data;
+ struct ogg_stream *os = ogg->streams + idx;
+ AVStream *st = s->streams[idx];
+
+ if (os->psize <= 8)
+ return 0;
+
+ return ff_vorbis_update_metadata(s, st, os->buf + os->pstart + 7,
+ os->psize - 8);
+}
+
static int vorbis_header(AVFormatContext *s, int idx)
{
struct ogg *ogg = s->priv_data;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 5/8] libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (3 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 4/8] libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis metadata update mechanism Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 6/8] tests: Add chained ogg/flac stream dump test Romain Beauxis
` (3 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
libavformat/oggparseflac.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c
index f25ed9cc15..29f5904575 100644
--- a/libavformat/oggparseflac.c
+++ b/libavformat/oggparseflac.c
@@ -78,6 +78,25 @@ 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;
+ AVStream *st = s->streams[idx];
+ int ret;
+
+ if (os->psize > 0 && os->buf[os->pstart] &&
+ (os->buf[os->pstart] & 0x7F) == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
+ ret = ff_vorbis_update_metadata(s, st, os->buf + os->pstart + 4,
+ os->psize - 4);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
+}
+
static int
old_flac_header (AVFormatContext * s, int idx)
{
@@ -130,6 +149,7 @@ const struct ogg_codec ff_flac_codec = {
.magic = "\177FLAC",
.magicsize = 5,
.header = flac_header,
+ .packet = flac_packet,
.nb_header = 2,
};
@@ -137,5 +157,6 @@ const struct ogg_codec ff_old_flac_codec = {
.magic = "fLaC",
.magicsize = 4,
.header = old_flac_header,
+ .packet = flac_packet,
.nb_header = 0,
};
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 6/8] tests: Add chained ogg/flac stream dump test.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (4 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 5/8] libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet Romain Beauxis
` (2 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
tests/Makefile | 1 +
tests/fate/ogg-flac.mak | 11 +++++++++++
tests/ref/fate/ogg-flac-chained-meta.txt | 13 +++++++++++++
3 files changed, 25 insertions(+)
create mode 100644 tests/fate/ogg-flac.mak
create mode 100644 tests/ref/fate/ogg-flac-chained-meta.txt
diff --git a/tests/Makefile b/tests/Makefile
index cffa586e8d..a37f2ab587 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -220,6 +220,7 @@ include $(SRC_PATH)/tests/fate/mpegps.mak
include $(SRC_PATH)/tests/fate/mpegts.mak
include $(SRC_PATH)/tests/fate/mxf.mak
include $(SRC_PATH)/tests/fate/ogg-vorbis.mak
+include $(SRC_PATH)/tests/fate/ogg-flac.mak
include $(SRC_PATH)/tests/fate/oma.mak
include $(SRC_PATH)/tests/fate/opus.mak
include $(SRC_PATH)/tests/fate/pcm.mak
diff --git a/tests/fate/ogg-flac.mak b/tests/fate/ogg-flac.mak
new file mode 100644
index 0000000000..083f77feb6
--- /dev/null
+++ b/tests/fate/ogg-flac.mak
@@ -0,0 +1,11 @@
+FATE_OGG_FLAC += fate-ogg-flac-chained-meta
+fate-ogg-flac-chained-meta: REF = $(SRC_PATH)/tests/ref/fate/ogg-flac-chained-meta.txt
+fate-ogg-flac-chained-meta: CMD = $(APITESTSDIR)/api-dump-stream-meta-test$(EXESUF) $(TARGET_SAMPLES)/ogg-flac/chained-meta.ogg
+
+FATE_OGG_FLAC-$(call DEMDEC, OGG, FLAC) += $(FATE_OGG_FLAC)
+
+FATE_SAMPLES_DUMP_STREAM_META += $(FATE_OGG_FLAC-yes)
+
+FATE_EXTERN += $(FATE_OGG_FLAC-yes)
+
+fate-ogg-flac: $(FATE_OGG_FLAC-yes)
diff --git a/tests/ref/fate/ogg-flac-chained-meta.txt b/tests/ref/fate/ogg-flac-chained-meta.txt
new file mode 100644
index 0000000000..48623e60c7
--- /dev/null
+++ b/tests/ref/fate/ogg-flac-chained-meta.txt
@@ -0,0 +1,13 @@
+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, new metadata: encoder=Lavc61.19.100 flac:title=First Stream
+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, new metadata: encoder=Lavc61.19.100 flac:title=Second Stream
+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:
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (5 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 6/8] tests: Add chained ogg/flac stream dump test Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 8/8] tests: Add chained ogg/opus stream dump test Romain Beauxis
2025-03-11 16:56 ` [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
libavformat/oggparseopus.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c
index 218e9df581..fe25ad44f3 100644
--- a/libavformat/oggparseopus.c
+++ b/libavformat/oggparseopus.c
@@ -29,6 +29,7 @@
struct oggopus_private {
int need_comments;
+ int comments_parsed;
unsigned pre_skip;
int64_t cur_dts;
};
@@ -81,7 +82,17 @@ static int opus_header(AVFormatContext *avf, int idx)
if (priv->need_comments) {
if (os->psize < 8 || memcmp(packet, "OpusTags", 8))
return AVERROR_INVALIDDATA;
- ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8);
+
+ if (!priv->comments_parsed) {
+ ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8);
+ priv->comments_parsed = 1;
+ } else {
+ ret = ff_vorbis_update_metadata(avf, st, packet + 8, os->psize - 8);
+
+ if (ret < 0)
+ return ret;
+ }
+
priv->need_comments--;
return 1;
}
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* [FFmpeg-devel] [PATCH v8 8/8] tests: Add chained ogg/opus stream dump test.
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (6 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet Romain Beauxis
@ 2025-03-11 16:55 ` Romain Beauxis
2025-03-11 16:56 ` [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
8 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Romain Beauxis
---
tests/Makefile | 1 +
tests/fate/ogg-opus.mak | 11 ++++++++++
tests/ref/fate/ogg-opus-chained-meta.txt | 27 ++++++++++++++++++++++++
3 files changed, 39 insertions(+)
create mode 100644 tests/fate/ogg-opus.mak
create mode 100644 tests/ref/fate/ogg-opus-chained-meta.txt
diff --git a/tests/Makefile b/tests/Makefile
index a37f2ab587..75b9bcc729 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -221,6 +221,7 @@ include $(SRC_PATH)/tests/fate/mpegts.mak
include $(SRC_PATH)/tests/fate/mxf.mak
include $(SRC_PATH)/tests/fate/ogg-vorbis.mak
include $(SRC_PATH)/tests/fate/ogg-flac.mak
+include $(SRC_PATH)/tests/fate/ogg-opus.mak
include $(SRC_PATH)/tests/fate/oma.mak
include $(SRC_PATH)/tests/fate/opus.mak
include $(SRC_PATH)/tests/fate/pcm.mak
diff --git a/tests/fate/ogg-opus.mak b/tests/fate/ogg-opus.mak
new file mode 100644
index 0000000000..aa89ddde98
--- /dev/null
+++ b/tests/fate/ogg-opus.mak
@@ -0,0 +1,11 @@
+FATE_OGG_OPUS += fate-ogg-opus-chained-meta
+fate-ogg-opus-chained-meta: REF = $(SRC_PATH)/tests/ref/fate/ogg-opus-chained-meta.txt
+fate-ogg-opus-chained-meta: CMD = $(APITESTSDIR)/api-dump-stream-meta-test$(EXESUF) $(TARGET_SAMPLES)/ogg-opus/chained-meta.ogg
+
+FATE_OGG_OPUS-$(call DEMDEC, OGG, OPUS) += $(FATE_OGG_OPUS)
+
+FATE_SAMPLES_DUMP_STREAM_META += $(FATE_OGG_OPUS-yes)
+
+FATE_EXTERN += $(FATE_OGG_OPUS-yes)
+
+fate-ogg-opus: $(FATE_OGG_OPUS-yes)
diff --git a/tests/ref/fate/ogg-opus-chained-meta.txt b/tests/ref/fate/ogg-opus-chained-meta.txt
new file mode 100644
index 0000000000..789b99b4a9
--- /dev/null
+++ b/tests/ref/fate/ogg-opus-chained-meta.txt
@@ -0,0 +1,27 @@
+Stream ID: 0, codec name: opus, metadata: encoder=Lavc61.19.100 libopus:title=First Stream
+Stream ID: 0, packet PTS: -312, packet DTS: -312
+Stream ID: 0, new metadata: encoder=Lavc61.19.100 libopus:title=First Stream
+Stream ID: 0, frame PTS: -312, metadata:
+Stream ID: 0, packet PTS: 648, packet DTS: 648
+Stream ID: 0, frame PTS: 648, metadata:
+Stream ID: 0, packet PTS: 1608, packet DTS: 1608
+Stream ID: 0, frame PTS: 1608, metadata:
+Stream ID: 0, packet PTS: 2568, packet DTS: 2568
+Stream ID: 0, frame PTS: 2568, metadata:
+Stream ID: 0, packet PTS: 3528, packet DTS: 3528
+Stream ID: 0, frame PTS: 3528, metadata:
+Stream ID: 0, packet PTS: 4488, packet DTS: 4488
+Stream ID: 0, frame PTS: 4488, metadata:
+Stream ID: 0, packet PTS: -312, packet DTS: -312
+Stream ID: 0, new metadata: encoder=Lavc61.19.100 libopus:title=Second Stream
+Stream ID: 0, frame PTS: -312, metadata: encoder=Lavc61.19.100 libopus:title=Second Stream
+Stream ID: 0, packet PTS: 648, packet DTS: 648
+Stream ID: 0, frame PTS: 648, metadata:
+Stream ID: 0, packet PTS: 1608, packet DTS: 1608
+Stream ID: 0, frame PTS: 1608, metadata:
+Stream ID: 0, packet PTS: 2568, packet DTS: 2568
+Stream ID: 0, frame PTS: 2568, metadata:
+Stream ID: 0, packet PTS: 3528, packet DTS: 3528
+Stream ID: 0, frame PTS: 3528, metadata:
+Stream ID: 0, packet PTS: 4488, packet DTS: 4488
+Stream ID: 0, frame PTS: 4488, metadata:
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
` (7 preceding siblings ...)
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 8/8] tests: Add chained ogg/opus stream dump test Romain Beauxis
@ 2025-03-11 16:56 ` Romain Beauxis
2025-03-13 13:42 ` Michael Niedermayer
8 siblings, 1 reply; 15+ messages in thread
From: Romain Beauxis @ 2025-03-11 16:56 UTC (permalink / raw)
To: ffmpeg-devel
Le mar. 11 mars 2025 à 11:55, Romain Beauxis
<romain.beauxis@gmail.com> a écrit :
>
> This is a series of patches to allow proper decoding of ogg metadata in chained
> `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
>
> ## Changes since last version:
> * Moved textual reference output for tests to test/ref/fate
> * Updated test binary to only output stream metadata when
> AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
Again, forgot to add that test samples are available here:
https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
> Romain Beauxis (8):
> libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet
> extra data, attach them to the next decoded frame.
> tests: Add stream dump test API util.
> tests: Add chained ogg/vorbis stream dump test.
> libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis
> metadata update mechanism.
> libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg
> packets, add them to ogg stream new_metadata.
> tests: Add chained ogg/flac stream dump test.
> libavformat/oggparseopus.c: Parse comments from secondary chained
> streams header packet.
> tests: Add chained ogg/opus stream dump test.
>
> libavcodec/decode.c | 20 +++
> libavformat/oggdec.h | 14 ++
> libavformat/oggparseflac.c | 21 +++
> libavformat/oggparseopus.c | 13 +-
> libavformat/oggparsevorbis.c | 25 ++-
> tests/Makefile | 4 +
> tests/api/Makefile | 2 +-
> tests/api/api-dump-stream-meta-test.c | 179 +++++++++++++++++++++
> tests/fate/ogg-flac.mak | 11 ++
> tests/fate/ogg-opus.mak | 11 ++
> tests/fate/ogg-vorbis.mak | 11 ++
> tests/ref/fate/ogg-flac-chained-meta.txt | 13 ++
> tests/ref/fate/ogg-opus-chained-meta.txt | 27 ++++
> tests/ref/fate/ogg-vorbis-chained-meta.txt | 17 ++
> 14 files changed, 358 insertions(+), 10 deletions(-)
> create mode 100644 tests/api/api-dump-stream-meta-test.c
> create mode 100644 tests/fate/ogg-flac.mak
> create mode 100644 tests/fate/ogg-opus.mak
> create mode 100644 tests/fate/ogg-vorbis.mak
> create mode 100644 tests/ref/fate/ogg-flac-chained-meta.txt
> create mode 100644 tests/ref/fate/ogg-opus-chained-meta.txt
> create mode 100644 tests/ref/fate/ogg-vorbis-chained-meta.txt
>
> --
> 2.39.5 (Apple Git-154)
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-11 16:56 ` [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
@ 2025-03-13 13:42 ` Michael Niedermayer
2025-03-13 15:33 ` Romain Beauxis
2025-03-16 0:08 ` Romain Beauxis
0 siblings, 2 replies; 15+ messages in thread
From: Michael Niedermayer @ 2025-03-13 13:42 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: samples-request
[-- Attachment #1.1: Type: text/plain, Size: 1069 bytes --]
Hi Romain
On Tue, Mar 11, 2025 at 11:56:37AM -0500, Romain Beauxis wrote:
> Le mar. 11 mars 2025 à 11:55, Romain Beauxis
> <romain.beauxis@gmail.com> a écrit :
> >
> > This is a series of patches to allow proper decoding of ogg metadata in chained
> > `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
> >
> > ## Changes since last version:
> > * Moved textual reference output for tests to test/ref/fate
> > * Updated test binary to only output stream metadata when
> > AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
>
> Again, forgot to add that test samples are available here:
> https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
please always cc samples-request for sample upload requests
also in case this is not documented where you looked, feel free
to send a patch to better document that
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-13 13:42 ` Michael Niedermayer
@ 2025-03-13 15:33 ` Romain Beauxis
2025-03-16 0:08 ` Romain Beauxis
1 sibling, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-13 15:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: samples-request
Le jeu. 13 mars 2025 à 08:43, Michael Niedermayer
<michael@niedermayer.cc> a écrit :
>
> Hi Romain
>
> On Tue, Mar 11, 2025 at 11:56:37AM -0500, Romain Beauxis wrote:
> > Le mar. 11 mars 2025 à 11:55, Romain Beauxis
> > <romain.beauxis@gmail.com> a écrit :
> > >
> > > This is a series of patches to allow proper decoding of ogg metadata in chained
> > > `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
> > >
> > > ## Changes since last version:
> > > * Moved textual reference output for tests to test/ref/fate
> > > * Updated test binary to only output stream metadata when
> > > AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
> >
> > Again, forgot to add that test samples are available here:
> > https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
>
> please always cc samples-request for sample upload requests
Well noted!
> also in case this is not documented where you looked, feel free
> to send a patch to better document that
I see the documentation about it so I think it's properly documented.
But, now I know too!
Thanks,
-- 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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-13 13:42 ` Michael Niedermayer
2025-03-13 15:33 ` Romain Beauxis
@ 2025-03-16 0:08 ` Romain Beauxis
2025-03-17 0:20 ` Michael Niedermayer
1 sibling, 1 reply; 15+ messages in thread
From: Romain Beauxis @ 2025-03-16 0:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: samples-request
Hi all!
Le jeu. 13 mars 2025 à 08:43, Michael Niedermayer
<michael@niedermayer.cc> a écrit :
>
> Hi Romain
>
> On Tue, Mar 11, 2025 at 11:56:37AM -0500, Romain Beauxis wrote:
> > Le mar. 11 mars 2025 à 11:55, Romain Beauxis
> > <romain.beauxis@gmail.com> a écrit :
> > >
> > > This is a series of patches to allow proper decoding of ogg metadata in chained
> > > `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
> > >
> > > ## Changes since last version:
> > > * Moved textual reference output for tests to test/ref/fate
> > > * Updated test binary to only output stream metadata when
> > > AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
> >
> > Again, forgot to add that test samples are available here:
> > https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
Any update on this? Or concerns re: the samples?
I've got more work ready to send, I'd love to finish this patch set to
get the next one rolling.
Thanks y'all!
-- 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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-16 0:08 ` Romain Beauxis
@ 2025-03-17 0:20 ` Michael Niedermayer
2025-03-17 0:59 ` Romain Beauxis
0 siblings, 1 reply; 15+ messages in thread
From: Michael Niedermayer @ 2025-03-17 0:20 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1519 bytes --]
On Sat, Mar 15, 2025 at 07:08:05PM -0500, Romain Beauxis wrote:
> Hi all!
>
>
> Le jeu. 13 mars 2025 à 08:43, Michael Niedermayer
> <michael@niedermayer.cc> a écrit :
> >
> > Hi Romain
> >
> > On Tue, Mar 11, 2025 at 11:56:37AM -0500, Romain Beauxis wrote:
> > > Le mar. 11 mars 2025 à 11:55, Romain Beauxis
> > > <romain.beauxis@gmail.com> a écrit :
> > > >
> > > > This is a series of patches to allow proper decoding of ogg metadata in chained
> > > > `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
> > > >
> > > > ## Changes since last version:
> > > > * Moved textual reference output for tests to test/ref/fate
> > > > * Updated test binary to only output stream metadata when
> > > > AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
> > >
> > > Again, forgot to add that test samples are available here:
> > > https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
>
> Any update on this? Or concerns re: the samples?
>
> I've got more work ready to send, I'd love to finish this patch set to
> get the next one rolling.
the files contain "metadata: encoder=Lavc61.19.100"
So they are version dependant which is a problem for reference files
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams
2025-03-17 0:20 ` Michael Niedermayer
@ 2025-03-17 0:59 ` Romain Beauxis
0 siblings, 0 replies; 15+ messages in thread
From: Romain Beauxis @ 2025-03-17 0:59 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Le dim. 16 mars 2025 à 19:20, Michael Niedermayer <michael@niedermayer.cc>
a écrit :
>
> On Sat, Mar 15, 2025 at 07:08:05PM -0500, Romain Beauxis wrote:
> > Hi all!
> >
> >
> > Le jeu. 13 mars 2025 à 08:43, Michael Niedermayer
> > <michael@niedermayer.cc> a écrit :
> > >
> > > Hi Romain
> > >
> > > On Tue, Mar 11, 2025 at 11:56:37AM -0500, Romain Beauxis wrote:
> > > > Le mar. 11 mars 2025 à 11:55, Romain Beauxis
> > > > <romain.beauxis@gmail.com> a écrit :
> > > > >
> > > > > This is a series of patches to allow proper decoding of ogg
metadata in chained
> > > > > `ogg/vorbis, `ogg/flac` and `ogg/opus` streams.
> > > > >
> > > > > ## Changes since last version:
> > > > > * Moved textual reference output for tests to test/ref/fate
> > > > > * Updated test binary to only output stream metadata when
> > > > > AVSTREAM_EVENT_FLAG_METADATA_UPDATED flag is set.
> > > >
> > > > Again, forgot to add that test samples are available here:
> > > >
https://www.dropbox.com/scl/fo/xrtrna2rxr1j354hrtymq/AGwemlxHYecBLNmQ8Fsy--4?rlkey=lzilr4m9w4gfdqygoe172vvy8&dl=0
> >
> > Any update on this? Or concerns re: the samples?
> >
> > I've got more work ready to send, I'd love to finish this patch set to
> > get the next one rolling.
>
> the files contain "metadata: encoder=Lavc61.19.100"
>
> So they are version dependant which is a problem for reference files
Can you elaborate on that?
Vorbis comments standard requires that the encoder be the first comment in
the comment block and that's the value.
The version written as the encoder is static metadata, I fail to see how it
would change with any future version of libavc, it is just a marker of the
version that was used when the file was created.
If that can help, I'm happy to update the files to show any other value for
the encoder, though.
-- 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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-03-17 1:00 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-11 16:55 [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 2/8] tests: Add stream dump test API util Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 3/8] tests: Add chained ogg/vorbis stream dump test Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 4/8] libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis metadata update mechanism Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 5/8] libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 6/8] tests: Add chained ogg/flac stream dump test Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet Romain Beauxis
2025-03-11 16:55 ` [FFmpeg-devel] [PATCH v8 8/8] tests: Add chained ogg/opus stream dump test Romain Beauxis
2025-03-11 16:56 ` [FFmpeg-devel] [PATCH v8 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis
2025-03-13 13:42 ` Michael Niedermayer
2025-03-13 15:33 ` Romain Beauxis
2025-03-16 0:08 ` Romain Beauxis
2025-03-17 0:20 ` Michael Niedermayer
2025-03-17 0:59 ` Romain Beauxis
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git