Media attributes

Labelbox automatically computes Media Attributes when you create new Data Rows in the platform. If the data is not accessible when you create the Data Rows, the Media Attributes will not be computed for those Data Rows.

Below is a list of the available Media Attributes.

Parameter

Asset type

Description

mimeType

Video
Image
Text
Tiled imagery

Media type. Will be one of the following:

  • video/mp4

  • image/jpeg

  • text/plain

  • application/x-tms-geo (tiled imagery: EPSG3857)

  • application/x-tms-simple (tiled imagery: Simple)

  • application/json (other)

width

Video
Image

Image or frame width in pixels.

height

Video
Image

Image or frame height in pixels.

codec

Video

Indicates the video compression standard.

duration

Video

Duration of the video in seconds.

frameRate

Video

Frame rate per second.

frameCount

Video

Number of frames in the video.

Use this sample script to retrieve the Media Attributes for a Data Row.

datarow = client.get_data_row(data_row.uid)
print(datarow.media_attributes)

Below are sample responses by asset type.

{
  "data": {
    "dataRow": {
      "mediaAttributes": {
        "width": 3872,
        "height": 2592,
        "mimeType": "image/jpeg"
      }
   }
}
{
  "data": {
    "dataRow": {
      "mediaAttributes": {
        "codec": "avc1",
        "width": 1920,
        "height": 1080,
        "duration": 10,
        "mimeType": "video/mp4",
        "frameRate": 10,
        "frameCount": 100
      }
   }
}
{
  "data": {
    "dataRow": {
      "mediaAttributes": {
        "mimeType": "text/plain"
      }
   }
}
{
  "data": {
    "dataRow": {
      "mediaAttributes": {
        "mimeType": "application/x-tms-geo"
      }
   }
}

Did this page help you?