Media Samples

sample

Represents a video, audio or subtitle media sample. Media samples support the following properties:

PropertyTypeDescription
durationintegerSample duration expressed in media timescale ticks.
dataobjectReferences the sample data.
propertiesobjectSample specific properties.
metadataarrayLists each type of metadata attached to the sample.
analysisarrayLists each type of analysis performed on the sample.

The following properties are specific to video samples:

PropertyTypeDescription
typeenumIndicates whether the picture represents an I, P or B frame.
structureenumIndicates whether the picture is frame or a field (upper, lower, top or bottom).
offsetintegerComposition offset expressed in media timescale ticks.
{
  "audio": [
    {
      "format": "sowt",
      "sample_rate": {
        "numerator": 48000,
        "denominator": 1
      },
      "duration": 6471336,
      "bit_rate": 1536000,
      "language": "eng",
      "channels": 2,
      "label": [
        "L",
        "R"
      ],
      "bits_per_sample": 16,
      "properties": {
        "Mpeg2TransportStreamPid": 102,
        "PrimingSamples": 240
      },
      "extension": [
        {
          "type": "mp2l",
          "language": [
            {
              "language_code": "eng",
              "audio_type": 0
            }
          ],
          "$annotation": {
            "type": "MPEG-2 Language Descriptor (ISO 13818-1)"
          }
        }
      ],
      "sample": [
        {
          "duration": 4800,
          "data": {
            "type": "byte",
            "length": 19200
          },
          "analysis": [
            {
              "type": "loud",
              "momentary_loudness": -18.147150,
              "short_term_loudness": -21.153015,
              "ungated_loudness": -24.851980,
              "level_gated_loudness": -22.105360,
              "speech_gated_loudness": -24.799536,
              "speech_percentage": 93.170006,
              "loudness_range": 6.500000,
              "sample_peak": -9.692958,
              "true_peak": -9.668571,
              "$annotation": {
                "type": "EBU R 128 Audio Loudness"
              }
            }
          ]
        }
      ],
      "$annotation": {
        "format": "PCM, 16-Bit Little-Endian Signed Integer",
        "sample_rate": "48.0 kHz",
        "duration": "134.820 seconds",
        "bit_rate": "1.536 Mbit/s"
      }
    }
  ]
}

data

References data within a media container. The data reference describes the location of the data and the method used to retrieve the data.

PropertyTypeDescription
typestringFour character code that identifies the type of data reference.
lengthintegerData length in bytes.
positionintegerData position within the container.

metadata

Represents a specific type of metadata attached to a media sample.

PropertyTypeDescription
typestringFour character code that identifies the metadata.
dataobjectReferences the sample metadata.

analysis

Represents a specific type of analysis performed on a media sample.

PropertyTypeDescription
typestringFour character code that identifies the analysis results.