After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791918 - Add KLV meta and add support for it in matroska mux/demux
Add KLV meta and add support for it in matroska mux/demux
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 791415
Blocks:
 
 
Reported: 2017-12-24 11:42 UTC by Tim-Philipp Müller
Modified: 2018-11-03 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
buffer: add gst_buffer_get_n_meta() convenience function (core) (2.54 KB, patch)
2017-12-24 11:42 UTC, Tim-Philipp Müller
committed Details | Review
tag: add GstMeta for KLV metadata (18.43 KB, patch)
2017-12-24 11:43 UTC, Tim-Philipp Müller
reviewed Details | Review
matroska-mux: write KLV metas attached to buffers as BlockAdditions (3.91 KB, patch)
2017-12-24 11:44 UTC, Tim-Philipp Müller
reviewed Details | Review
matroska-demux: extract KLV metadata from BlockAdditionals (6.12 KB, patch)
2017-12-24 11:44 UTC, Tim-Philipp Müller
needs-work Details | Review
TESTING: v4l2src: add KLV metadata with unix timestamp and GPS location to each frame (4.34 KB, patch)
2017-12-24 11:45 UTC, Tim-Philipp Müller
rejected Details | Review

Description Tim-Philipp Müller 2017-12-24 11:42:24 UTC
Created attachment 365925 [details] [review]
buffer: add gst_buffer_get_n_meta() convenience function (core)

This adds a GstKLVMeta to libgsttag, which allows attaching arbitrary metadata in KLV format to buffers.

Plus patches to read/write those to/from Matroska as BLOCKADDITIONALs.

And an extra patch to v4l2src for testing which is not for merging.
Comment 1 Tim-Philipp Müller 2017-12-24 11:43:17 UTC
Created attachment 365926 [details] [review]
tag: add GstMeta for KLV metadata

Can be used to attach arbitrary metadata to buffers,
such as timestamps, GPS data, etc.
    
See ITU Recommendation BT.1563-1 or SMPTE 336M for the
KLV standard, and MISB EG 0902 (MISB Minimum Metadata Set)
and other MISB standards and recommended practices for
examples of KLV metadata local data sets for a variety
of use cases.
Comment 2 Tim-Philipp Müller 2017-12-24 11:44:00 UTC
Created attachment 365927 [details] [review]
matroska-mux: write KLV metas attached to buffers as BlockAdditions
Comment 3 Tim-Philipp Müller 2017-12-24 11:44:26 UTC
Created attachment 365928 [details] [review]
matroska-demux: extract KLV metadata from BlockAdditionals
Comment 4 Tim-Philipp Müller 2017-12-24 11:45:06 UTC
Created attachment 365929 [details] [review]
TESTING: v4l2src: add KLV metadata with unix timestamp and GPS location to each frame
Comment 5 Sebastian Dröge (slomo) 2018-01-03 14:12:25 UTC
Review of attachment 365926 [details] [review]:

Could also mention SMPTE ST380 (http://ieeexplore.ieee.org/document/7291569/) as another example.

::: gst-libs/gst/tag/klv.c
@@ +146,3 @@
+  meta = (GstKLVMeta *) gst_buffer_add_meta (buffer, GST_KLV_META_INFO, NULL);
+
+  GST_TRACE ("Adding %u bytes of KLV data to buffer %p", (guint) size, buffer);

Might want to also print the type here?

@@ +162,3 @@
+ *
+ * Attaches #GstKLVMeta metadata to @buffer with the given parameters,
+ * Does not take ownership of @data.

Should it contain exactly one KLV item, or one or more?

Should there be API to get the K/L/V directly from a buffer (or in case of "one or more" an iterator over the data)?

::: gst-libs/gst/tag/klv.h
@@ +36,3 @@
+  /*< private >*/
+  GstMeta meta;
+} GstKLVMeta;

Why have the struct definition in the header if it's opaque anyway?

@@ +56,3 @@
+
+GST_EXPORT
+GstKLVMeta        * gst_buffer_add_klv_meta_take_data (GstBuffer * buffer, guint8 * data, gsize size);

And maybe a take_data_full() that takes a user_data and GDestroyNotify?

@@ +67,3 @@
+
+GST_EXPORT
+GstKLVMeta        * gst_buffer_get_klv_meta (GstBuffer * buffer);

Can there only be one per buffer?
Comment 6 Sebastian Dröge (slomo) 2018-01-03 14:14:07 UTC
Review of attachment 365927 [details] [review]:

Is there a spec for this? Block additions AFAIU are codec specific, or not?
Comment 7 Sebastian Dröge (slomo) 2018-01-03 14:16:56 UTC
Review of attachment 365928 [details] [review]:

::: gst/matroska/matroska-demux.c
@@ +3501,3 @@
+  /* read all BlockMore sub-entries */
+  while (ret == GST_FLOW_OK && gst_ebml_read_has_remaining (ebml, 1, TRUE)) {
+

Weird newline
Comment 8 GStreamer system administrator 2018-11-03 12:02:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/410.