<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.43 (Ruby 4.0.7) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-mahy-mimi-av-metadata-02" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.35.0 -->
  <front>
    <title abbrev="MIMI Content AV Metadata">Audio, Video, and Image Metadata extensions for the More Instant Messaging Interoperability (MIMI) Content format</title>
    <seriesInfo name="Internet-Draft" value="draft-mahy-mimi-av-metadata-02"/>
    <author fullname="Rohan Mahy">
      <organization/>
      <address>
        <email>rohan.mahy@gmail.com</email>
      </address>
    </author>
    <date year="2026" month="November" day="01"/>
    <area>Applications and Real-Time</area>
    <workgroup>More Instant Messaging Interoperability</workgroup>
    <keyword>mimi content</keyword>
    <keyword>image metadata</keyword>
    <keyword>audio metadata</keyword>
    <keyword>video metadata</keyword>
    <abstract>
      <?line 38?>

<t>The More Instant Messaging Interoperability (MIMI) content format is a container for rich content, which can reference image, video, and audio files.
This document describes metadata for these files to allow for more pleasant rendering.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://rohanmahy.github.io/mimi-av-metadata/draft-mahy-mimi-av-metadata.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-mahy-mimi-av-metadata/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        More Instant Messaging Interoperability Working Group mailing list (<eref target="mailto:mimi@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/mimi/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/mimi/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/rohanmahy/mimi-av-metadata"/>.</t>
    </note>
  </front>
  <middle>
    <?line 43?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The MIMI content format <xref target="I-D.ietf-mimi-content"/> can convey a variety of media types, as either inline or referenced external content.
In messaging applications it is common to display audio, video, and static image content, collectively audio/video (AV).
The layout for messaging applications often reserves a placeholder for the AV content.
While it is common for static images to be immediately displayed, audio and video content is often not immediately downloaded and rendered.
Even if image data is downloaded immediately, if there is a network or server delay there can be time when the aspect ratio or dimensions of the image are not yet know.
It is therefore useful to have some rendering hints about the media for more pleasant rendering.
This document defines extensions to the MIMI content format to provide these hints.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

<t>This document uses a variety of terms from the MIMI content format definition, especially <tt>NestedPart</tt>, <tt>SinglePart</tt>, <tt>ExternalPart</tt>, and <tt>MultiPart</tt>.</t>
    </section>
    <section anchor="mechanism">
      <name>AV Metadata Extensions</name>
      <t>The AV Metadata MIMI content extension is an array of AV metadata entries.
Each AV metadata entry is a CBOR map of AV metadata properties, all of which are optional except the <tt>part_index</tt> and <tt>type</tt>. The semantics of the individual property fields is as follows:</t>
      <ul spacing="normal">
        <li>
          <t><tt>part_index</tt>: refers to the order of MIMI parts from the relevant part inside the NestedPart structure in a MIMI content message. It can refer to a <tt>SinglePart</tt> or <tt>ExternalPart</tt>.</t>
        </li>
        <li>
          <t><tt>type</tt>: an integer enumeration representing the media type (not-including the subtype). audio is 1, image is 2, and video is 3. An extension socket is defined, although its need is not anticipated.</t>
        </li>
        <li>
          <t><tt>width</tt>: the width of the image or video in pixels</t>
        </li>
        <li>
          <t><tt>height</tt>: the height of the image or video in pixels</t>
        </li>
        <li>
          <t><tt>duration</tt>: the duration of the audio or video in milliseconds, expressed as an unsigned integer</t>
        </li>
        <li>
          <t><tt>preview_index</tt>: for a video part, the <tt>partIndex</tt> of another related part that represents its image preview. It can refer to a <tt>SinglePart</tt> or <tt>ExternalPart</tt>, or a <tt>MultiPart</tt> with <tt>chooseOne</tt> <tt>partSemantics</tt> which contains only <tt>SinglePart</tt> or <tt>ExternalPart</tt> types, all of which must be an image with a disposition value of <tt>preview</tt>.</t>
        </li>
        <li>
          <t><tt>accessibility_text</tt>: this text could be rendered instead of the audio, image, or video when various accessiblity settings are enabled, or during no or slow network access when a cached or preview image is not available.</t>
        </li>
        <li>
          <t><tt>rotation</tt>: one of four values: 0, 90, 180, or 270. This integer refers to the number of degrees of clockwise rotation (in 90 degree increments) needed to correctly view the image.</t>
        </li>
      </ul>
      <ul empty="true">
        <li>
          <t>Note that an orientation field is not necessary. Any image and video with a <tt>width</tt> field which is larger than its <tt>height</tt> is assumed to have a landscape mode orientation, while one with a <tt>height</tt> larger than its width is assumed to have a portrait mode orientation.</t>
        </li>
      </ul>
      <t>The following snippet of Concise Data Definition Language (CDDL) <xref target="RFC8160"/>  is used to formally define the structure of the extension.</t>
      <sourcecode type="cddl"><![CDATA[
av_metadata_array = (
    "av_metadata" : [ * metadata_entry ]
)

metadata_entry = {
    &(part_index: 1) : uint16,
    &(type: 2)       : audio / image / video / $ext_media,
    ? &(width: 3)              : uint,
    ? &(height: 4)             : uint,
    ? &(duration: 5)           : uint,
    ? &(preview_index: 6)      : uint16,
    ? &(accessibility_text: 7) : tstr,
    ? &(rotation: 8)           : 0 / 90 / 180 / 270
    $ext_av_metadata
}

uint16 = uint .size 2

audio = 1
image = 2
video = 3
]]></sourcecode>
    </section>
    <section anchor="example">
      <name>Example</name>
      <t>Below is an example of a video of puppies, a preview image, and an audio clip.</t>
      <sourcecode type="cbor-diag"><![CDATA[
"av_metadata" : [
  {
     /partIndex /         1: 2,
     /type      /         2: 3, /video/
     /width     /         3: 1920,
     /height    /         4: 1080,
     /duration  /         5: 37000, / in milliseconds /
     /preview_index /     6: 4,
     /accessibility_text/ 7: "two golden retriever puppies playing in" +
                             "overgrown grass lit with low sunlight"
  },
  {
     /partIndex /         1: 4,
     /type      /         2: 2, /image/
     /width     /         3: 1920,
     /height    /         4: 1080
  },
  {
     /partIndex /         1: 7,
     /type      /         2: 1, /audio/
     /duration  /         5: 9450, / in milliseconds /
     /accessibility_text/ 7: "uproarious laughter"
  }
]
]]></sourcecode>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA is requested to add the following entries to the MIMI Content Extension Keys registry.</t>
      <section anchor="av-metadata-mimi-content-extension-key">
        <name>av-metadata MIMI Content Extension Key</name>
        <t>The following completed registration template is provided:</t>
        <ul spacing="normal">
          <li>
            <t>Key: TBD1 (suggested value 6)</t>
          </li>
          <li>
            <t>Name: av-metadata</t>
          </li>
          <li>
            <t>Type: array</t>
          </li>
          <li>
            <t>Recommended: Y</t>
          </li>
          <li>
            <t>Reference: <xref target="mechanism"/> of this document</t>
          </li>
        </ul>
      </section>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="I-D.ietf-mimi-content">
        <front>
          <title>More Instant Messaging Interoperability (MIMI) message content</title>
          <author fullname="Rohan Mahy" initials="R." surname="Mahy">
            <organization>Rohan Mahy Consulting Services</organization>
          </author>
          <date day="4" month="July" year="2026"/>
          <abstract>
            <t>   This document describes content semantics common in Instant Messaging
   (IM) systems and describes a profile suitable for instant messaging
   interoperability of messages end-to-end encrypted inside the MLS
   (Message Layer Security) Protocol.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-mimi-content-09"/>
      </reference>
      <reference anchor="RFC2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC8160">
        <front>
          <title>IUTF8 Terminal Mode in Secure Shell (SSH)</title>
          <author fullname="S. Tatham" initials="S." surname="Tatham"/>
          <author fullname="D. Tucker" initials="D." surname="Tucker"/>
          <date month="April" year="2017"/>
          <abstract>
            <t>This document specifies a new opcode in the Secure Shell terminal modes encoding. The new opcode describes the widely used IUTF8 terminal mode bit, which indicates that terminal I/O uses UTF-8 character encoding.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8160"/>
        <seriesInfo name="DOI" value="10.17487/RFC8160"/>
      </reference>
    </references>
    <?line 173?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Z/27bOBL+X0/Bcw+HeM8/4jRtGmHT3TRJb43Lj16SdlEs
ioSWaJuoJOpIKom3SJ/lnuWe7L4hKdly2rQFLkATieRwODPffDNU+/1+ZKXN
RMw6+1UqVY+9k6nAH16kbJzzmWAnwvKUW87EnRWFkaowbKo0s3PMKS3YuDCW
FxYLjeEzWcwwYoVWpdB8IjNpF2zjZHwy7rIDhQmshHjObSfik4kWN9BN083s
/rtGZydKuBUzpRcxk8VURVGqkoLnOG+q+dT2cz5f9HOZyz6/6edBqr+5FZlq
kktDp7WLEsvHR5evGXvCeGYUFMoiFaXAr8J2eqwjUmmVljyjl/H+K/yBhZ3x
+eXrTlRU+UToOMLWIo4S2A83VCZmVlciwvGfRlwLTi4sy0zixM5H5MFzwbP+
pcxFJ7pV+uNMq6okc7/PbZ3oo1hALo0j1mdkJUu8j+hduujUNtMIpwi2Rm4o
mMuRG1FUMIGxHz4IY96Nnd9hBi35B+1A4zmXGcbpdL9KYacDpWc0znUyx/jc
2tLEwyEtoyF5Iwb1siENDCda3RoxpA2GJDiTdl5NIKrVnBcU4OF6gGlZhmgY
u6KhWT7wOwykeiA4fAQ1g7nNs04U8crOlSaXQwtj0yrLPOLOSQE7gaybgAG8
kH+6aMduRHhfuIMMSMevMxoZJCqPosJhHubHUURQXr5F/T5iNzFW88RG0eWP
51XSyismAT43xmUhtEtWLZN5vazHbufuFdZoMRVaFInwcOp5xPj093CaykyY
AU6FXZF8VU6KUmESLSfCNNiqKcEIL8GsQq5l6tZN5GRPmQluyCBNiadh0MDb
nss0zUQUPSEDtUqrhHwaPEHMsGbfp09/GfcPHYx8FMP8/b2zCW83YgEX3HCN
NQumpjhmKrnDsIFxhglABK6RRQYXUa43jkg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