Media attributes

Overview of Labelbox computed 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.

ParameterAsset typeDescription
mimeTypeVideo
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)
widthVideo
Image
Image or frame width in pixels.
heightVideo
Image
Image or frame height in pixels.
codecVideoIndicates the video compression standard.
durationVideoDuration of the video in seconds.
frameRateVideoFrame rate per second.
frameCountVideoNumber 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 some 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"
      }
   }
}