Metadata Operators

The following metadata operators can be applied to a video, audio or subtitle stream.

Operator

Type

Description

detach

object

Extracts metadata from a media stream.

attach

object

Inserts metadata into a media stream.

merge

object

Merges metadata from another media stream.

detach

The detach operator extracts a specific type of metadata from a media stream. If a root is specified the metadata is extracted from that element type, otherwise the operator searches all root elements.

Property

Type

Description

type

string

Four character code identifying the type of metadata to detach.

root

string

Four character code identifying the root element.

filter

object

A filter that is applied to the stream after the metadata is dettached.

For example the following will extract c708 metadata (CEA-708 captions) from the a72c metadata (ATSC A72 SEI messages):

---
input:
  container:
  - name: input1
    video:
    - name: v1
      detach:
      - type: 'c708'
        root: 'a72c'
{
  "input": {
    "container": [
      {
        "name": "input1",
        "video": [
          {
            "name": "v1",
            "detach": [
              {
                "type": "c708",
                "root": "a72c"
              }
            ]
          }
        ]
      }
    ]
  }
}

attach

The attach operator inserts a specific type of metadata into a media stream. The metadata is inserted into a specific root element.

Property

Type

Description

type

string

Four character code identifying the type of metadata to attach.

root

string

Four character code identifying the root element.

filter

object

A filter that is applied to the stream before the metadata is attached.

For example the following copies c708 metadata (CEA-708 captions) from the input rd11 element (SMPTE RDD11 Ancillary Data) to the output a72c element (ATSC A72 SEI messages):

---
input:
  container:
  - name: input1
    video:
    - name: v1
      detach:
      - type: 'c708'
        root: 'rd11'
output:
  container:
  - name: output1
    type: 'mp4 '
    video:
    - route:
        name: v1
      attach:
      - type: 'c708'
        root: 'a72c'
{
  "input": {
    "container": [
      {
        "name": "input1",
        "video": [
          {
            "name": "v1",
            "detach": [
              {
                "type": "c708",
                "root": "rd11"
              }
            ]
          }
        ]
      }
    ]
  },
  "output": {
    "container": [
      {
        "name": "output1",
        "type": "mp4 ",
        "video": [
          {
            "route": {
              "name": "v1"
            },
            "attach": [
              {
                "type": "c708",
                "root": "a72c"
              }
            ]
          }
        ]
      }
    ]
  }
}

merge

The merge operator combines the metadata from a source input stream with the metadata in the target input or output stream. This operator is used to:

  • inject the metadata from a "sidecar" container into a video or audio stream
  • convert a subtitle stream to the equivalent caption or teletext metadata and inject that metadata into a video stream

Property

Type

Description

name

string

Identifies the input stream to merge.

filter

array

A list of filters that are applied to the named stream before the metadata is merged.

combine

object

Combines multiple subtitle streams (typically containing different languages) into a single stream. The combined subtitle stream is then merged as metadata (typically captions or teletext) into the target stream.

For example the following merges sidecar HDR10+ metadata:

---
input:
  container:
  - name: hdr10plus
    video:
    - name: metadata
  - name: media
    video:
    - name: picture
      merge:
        name: metadata
{
  "input": {
    "container": [
      {
        "name": "hdr10plus",
        "video": [
          {
            "name": "metadata"
          }
        ]
      },
      {
        "name": "media",
        "video": [
          {
            "name": "picture",
            "merge": {
              "name": "metadata"
            }
          }
        ]
      }
    ]
  }
}

Did this page help you?