Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PR] libavformat/matroskadec.c: export profile container metadata to (PR #21787)
@ 2026-02-18 17:42 toots via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: toots via ffmpeg-devel @ 2026-02-18 17:42 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: toots

PR #21787 opened by toots
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21787
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21787.patch


>From 518aaeb592a43dddc27f4d89d32639d277ad8bfe Mon Sep 17 00:00:00 2001
From: Romain Beauxis <romain.beauxis@gmail.com>
Date: Wed, 18 Feb 2026 11:40:50 -0600
Subject: [PATCH] libavformat/matroskadec.c: export profile container metadata
 to distinguish between matroska and webm at runtime.

---
 doc/APIchanges                       | 3 +++
 libavformat/matroskadec.c            | 1 +
 tests/fate/matroska.mak              | 7 +++++++
 tests/ref/fate/matroska-profile-mkv  | 3 +++
 tests/ref/fate/matroska-profile-webm | 3 +++
 5 files changed, 17 insertions(+)
 create mode 100644 tests/ref/fate/matroska-profile-mkv
 create mode 100644 tests/ref/fate/matroska-profile-webm

diff --git a/doc/APIchanges b/doc/APIchanges
index 2b43139b48..52aec6cce6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
 
 API changes, most recent first:
 
+2026-02-18 - xxxxxxxxxx - lavf 62.9.100 - matroskadec.c
+  Export profile metadata to distinguish between matroska and webm at runtime.
+
 2026-02-13 - xxxxxxxxxx - lavu 60.25.100 - avassert.h
   Deprecate av_assert0_fpu() and av_assert2_fpu() without replacement.
 
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 503b99b286..417b3f458c 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3390,6 +3390,7 @@ static int matroska_read_header(AVFormatContext *s)
                                   1000 / AV_TIME_BASE;
     av_dict_set(&s->metadata, "title", matroska->title, 0);
     av_dict_set(&s->metadata, "encoder", matroska->muxingapp, 0);
+    av_dict_set(&s->metadata, "profile", matroska->is_webm ? "webm" : "matroska", 0);
 
     if (matroska->date_utc.size == 8)
         matroska_metadata_creation_time(&s->metadata, AV_RB64(matroska->date_utc.data));
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 90e3db3217..79787c8c89 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -281,6 +281,13 @@ fate-matroska-side-data-pref-packet: CMD = run ffprobe$(PROGSSUF)$(EXESUF) $(TAR
     -select_streams v:0 -show_streams -show_frames -show_entries stream=stream_side_data:frame=frame_side_data_list -side_data_prefer_packet mastering_display_metadata,content_light_level
 FATE_MATROSKA_FFPROBE-$(call ALLYES, MATROSKA_DEMUXER HEVC_DECODER) += fate-matroska-side-data-pref-codec fate-matroska-side-data-pref-packet
 
+# Test that the matroska demuxer correctly exports the EBML DocType as profile metadata
+FATE_MATROSKA_FFPROBE-$(call DEMDEC, MATROSKA, PRORES) += fate-matroska-profile-mkv
+fate-matroska-profile-mkv: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries format_tags=profile -v 0 $(TARGET_SAMPLES)/mkv/prores_zlib.mkv
+
+FATE_MATROSKA_FFPROBE-$(call DEMDEC, MATROSKA, VP9) += fate-matroska-profile-webm
+fate-matroska-profile-webm: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries format_tags=profile -v 0 $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm
+
 FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes)
 FATE_SAMPLES_FFPROBE += $(FATE_MATROSKA_FFPROBE-yes)
 FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_MATROSKA_FFMPEG_FFPROBE-yes)
diff --git a/tests/ref/fate/matroska-profile-mkv b/tests/ref/fate/matroska-profile-mkv
new file mode 100644
index 0000000000..58ded133b8
--- /dev/null
+++ b/tests/ref/fate/matroska-profile-mkv
@@ -0,0 +1,3 @@
+[FORMAT]
+TAG:profile=matroska
+[/FORMAT]
diff --git a/tests/ref/fate/matroska-profile-webm b/tests/ref/fate/matroska-profile-webm
new file mode 100644
index 0000000000..0f428c8d97
--- /dev/null
+++ b/tests/ref/fate/matroska-profile-webm
@@ -0,0 +1,3 @@
+[FORMAT]
+TAG:profile=webm
+[/FORMAT]
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-18 17:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-18 17:42 [FFmpeg-devel] [PR] libavformat/matroskadec.c: export profile container metadata to (PR #21787) toots via ffmpeg-devel

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