Skip to content

Recommended Media Attachment Format

The first three example are our recommendation on how to format image, video, and audio media attachments. Further properties are possible, and might make it into this recommendation at one point. Examples:

  • Focal point and blurhash, see Mastodon
  • fps (frames per second) for videos

The final example cannot be recommended yet as it is not widely supported. However, it illustrates how one can provide multiple versions of the media attachments. A high quality and low quality video in this case. The low quality video is enough for most use cases, and is 40 times smaller.

!!! info This recommendation is work in progress. A description of why these choices will hopefully appear as a FEP

Examples

Example 1

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://hollo/@john"
  ],
  "id": "http://pasture-one-actor/actor/pG8qYlViQxc",
  "published": "2024-12-18T19:40:59Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/actor/VJ3wkait6ps",
    "published": "2024-12-18T19:40:59Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://www.w3.org/ns/credentials/v2",
      {
        "size": "https://joinpeertube.org/ns#size"
      }
    ],
    "content": "Recommended Image Format",
    "attachment": [
      {
        "type": "Image",
        "name": "A beautiful cow",
        "url": "http://pasture-one-actor/assets/cow.jpg",
        "width": 100,
        "height": 162,
        "mediaType": "image/jpeg",
        "digestMultibase": "zQmaeDPzhNL32WQZnnzB1H6QJWvvFNEHdViDB71yrxyXU1t",
        "size": 9045
      }
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
hollo
{
  "id": "0193db49-acf8-7cb5-beff-240f33b50bdc",
  "created_at": "2024-12-18T19:40:59.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/VJ3wkait6ps",
  "url": "http://pasture-one-actor/actor/VJ3wkait6ps",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Recommended Image Format",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "0193db49-3b8a-793c-9754-0eebc3c98123",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2024-12-18T19:40:29.878Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "0193db49-b27f-758a-987d-c86523644448",
      "type": "image",
      "url": "http://pasture-one-actor/assets/cow.jpg",
      "preview_url": "http://pasture-one-actor/assets/cow.jpg",
      "remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 100,
          "height": 162,
          "size": "100x162",
          "aspect": 0.6172839506172839
        },
        "small": {
          "width": 100,
          "height": 162,
          "size": "100x162",
          "aspect": 0.6172839506172839
        },
        "focus": {
          "x": 0,
          "y": 0
        }
      },
      "description": null,
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}

Example 2

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://hollo/@john"
  ],
  "id": "http://pasture-one-actor/actor/WaoNXMOcPDs",
  "published": "2024-12-18T19:41:00Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/actor/D1Xyvu8lLjs",
    "published": "2024-12-18T19:41:00Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://www.w3.org/ns/credentials/v2",
      {
        "size": "https://joinpeertube.org/ns#size"
      }
    ],
    "content": "Recommended Video Attachment",
    "attachment": [
      {
        "type": "Video",
        "url": "http://pasture-one-actor/assets/cow_eating.mp4",
        "name": "A beautiful cow eating",
        "width": 256,
        "height": 144,
        "mediaType": "video/mp4",
        "digestMultibase": "zQmSzK5qEe5tpjwGMhmjx9RvVoPkWhEmCwxP2s7wPMpKMoK",
        "size": 54373,
        "duration": "PT3S"
      }
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
hollo
{
  "id": "0193db49-b0e0-7e43-b9ad-dd1c9378947c",
  "created_at": "2024-12-18T19:41:00.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/D1Xyvu8lLjs",
  "url": "http://pasture-one-actor/actor/D1Xyvu8lLjs",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Recommended Video Attachment",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "0193db49-3b8a-793c-9754-0eebc3c98123",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2024-12-18T19:40:29.878Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "0193db49-b5cd-7f60-b806-3882b51a467d",
      "type": "video",
      "url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "preview_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 256,
          "height": 144,
          "size": "256x144",
          "aspect": 1.7777777777777777
        },
        "small": {
          "width": 256,
          "height": 144,
          "size": "256x144",
          "aspect": 1.7777777777777777
        },
        "focus": {
          "x": 0,
          "y": 0
        }
      },
      "description": null,
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}

Example 3

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://hollo/@john"
  ],
  "id": "http://pasture-one-actor/actor/Nebdg0Y5Ftw",
  "published": "2024-12-18T19:41:02Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/actor/UrGMQ0F4ucU",
    "published": "2024-12-18T19:41:02Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://www.w3.org/ns/credentials/v2",
      {
        "size": "https://joinpeertube.org/ns#size"
      }
    ],
    "content": "Recommended Audio Format",
    "attachment": [
      {
        "type": "Audio",
        "url": "http://pasture-one-actor/assets/cow_moo.mp3",
        "name": "A cow mooing",
        "mediaType": "audio/mpeg",
        "digestMultibase": "zQmSXTyLCPqoiGoUUwKRMKgFdddaAUkvQNr29nhB6tahb9Z",
        "size": 67709,
        "duration": "PT2.1S"
      }
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
hollo
{
  "id": "0193db49-b8b0-78bc-b133-8dab2f5374b9",
  "created_at": "2024-12-18T19:41:02.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/UrGMQ0F4ucU",
  "url": "http://pasture-one-actor/actor/UrGMQ0F4ucU",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Recommended Audio Format",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "0193db49-3b8a-793c-9754-0eebc3c98123",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2024-12-18T19:40:29.878Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "0193db49-bb4e-73d8-9684-95dec7e2f00e",
      "type": "audio",
      "url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "preview_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 512,
          "height": 512,
          "size": "512x512",
          "aspect": 1
        },
        "small": {
          "width": 512,
          "height": 512,
          "size": "512x512",
          "aspect": 1
        },
        "focus": {
          "x": 0,
          "y": 0
        }
      },
      "description": null,
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}

Example 4

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://hollo/@john"
  ],
  "id": "http://pasture-one-actor/actor/7WhJZSwvp58",
  "published": "2024-12-18T19:41:03Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/actor/TqRRVfL3v9c",
    "published": "2024-12-18T19:41:03Z",
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://www.w3.org/ns/credentials/v2",
      {
        "size": "https://joinpeertube.org/ns#size"
      }
    ],
    "content": "Multiple formats for video",
    "attachment": [
      {
        "type": "Video",
        "name": "A beautiful cow eating",
        "url": [
          {
            "type": "Link",
            "size": 54373,
            "digest": "zQmSzK5qEe5tpjwGMhmjx9RvVoPkWhEmCwxP2s7wPMpKMoK",
            "width": 256,
            "height": 144,
            "href": "http://pasture-one-actor/assets/cow_eating.mp4",
            "mediaType": "video/mp4"
          },
          {
            "type": "Link",
            "size": 2271723,
            "digest": "zQme2X4rgWuRdmAtGGMSEbdoeRQ2NAL2VptcdRGTYDZbSKG",
            "width": 1920,
            "height": 1080,
            "href": "http://pasture-one-actor/assets/cow_eating_hd.mp4",
            "mediaType": "video/mp4"
          }
        ],
        "duration": "PT3S"
      }
    ],
    "tag": [
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
hollo
{
  "id": "0193db49-bc98-7dca-b47e-b6bf583e14d3",
  "created_at": "2024-12-18T19:41:03.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/TqRRVfL3v9c",
  "url": "http://pasture-one-actor/actor/TqRRVfL3v9c",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Multiple formats for video",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "0193db49-3b8a-793c-9754-0eebc3c98123",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2024-12-18T19:40:29.878Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "0193db49-beb9-7c13-843a-0dd0eacb4727",
      "type": "video",
      "url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "preview_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 512,
          "height": 512,
          "size": "512x512",
          "aspect": 1
        },
        "small": {
          "width": 512,
          "height": 512,
          "size": "512x512",
          "aspect": 1
        },
        "focus": {
          "x": 0,
          "y": 0
        }
      },
      "description": null,
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}