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": [
    "http://sharkey/users/a52e8ostm0s60001",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/vp2rx7Gw50Y",
  "published": "2025-03-07T13:48:14Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://sharkey/users/a52e8ostm0s60001"
    ],
    "id": "http://pasture-one-actor/actor/YCaTYlLgyu0",
    "published": "2025-03-07T13:48:14Z",
    "@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
      }
    ]
  }
}
sharkey
{
  "id": "a52ealgwe2tn000w",
  "uri": "http://pasture-one-actor/actor/YCaTYlLgyu0",
  "url": "http://pasture-one-actor/actor/YCaTYlLgyu0",
  "account": {
    "id": "a52ea999e2tn0002",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "fqn": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "created_at": "2025-03-07T13:47:58.173Z",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 24,
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "avatar_static": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "header": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "header_static": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "emojis": [],
    "moved": null,
    "fields": [],
    "bot": false,
    "discoverable": true,
    "noindex": false,
    "group": null,
    "suspended": false,
    "limited": false
  },
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "content": "<p><span>Recommended Image Format</span></p>",
  "content_type": "text/x.misskeymarkdown",
  "text": "Recommended Image Format",
  "created_at": "2025-03-07T13:48:14.000Z",
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "reblogged": false,
  "favourited": false,
  "muted": false,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "media_attachments": [
    {
      "id": "a52eam1ge2tn000v",
      "type": "image",
      "url": "http://pasture-one-actor/assets/cow.jpg",
      "remote_url": "http://pasture-one-actor/assets/cow.jpg",
      "preview_url": "http://pasture-one-actor/assets/cow.jpg",
      "text_url": "http://pasture-one-actor/assets/cow.jpg",
      "meta": {
        "width": 200,
        "height": 164,
        "original": {
          "width": 200,
          "height": 164,
          "size": "200x164",
          "aspect": 1.2195121951219512,
          "frame_rate": "undefined"
        },
        "size": "200x164",
        "aspect": 1.2195121951219512
      },
      "description": "A beautiful cow",
      "blurhash": "ejK^]TI9_3t6NG_4%gRkV[of%hWCIUt7jEo#V@aJbHofazadjYWVkD"
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "poll": null,
  "application": null,
  "language": null,
  "pinned": false,
  "reactions": [],
  "emoji_reactions": [],
  "bookmarked": false,
  "quote": null,
  "edited_at": 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": [
    "http://sharkey/users/a52e8ostm0s60001",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/My2XBt00syE",
  "published": "2025-03-07T13:48:15Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://sharkey/users/a52e8ostm0s60001"
    ],
    "id": "http://pasture-one-actor/actor/NRkueRUPn30",
    "published": "2025-03-07T13:48:15Z",
    "@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"
      }
    ]
  }
}
sharkey
{
  "id": "a52eam8oe2tn000y",
  "uri": "http://pasture-one-actor/actor/NRkueRUPn30",
  "url": "http://pasture-one-actor/actor/NRkueRUPn30",
  "account": {
    "id": "a52ea999e2tn0002",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "fqn": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "created_at": "2025-03-07T13:47:58.173Z",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 25,
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "avatar_static": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "header": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "header_static": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "emojis": [],
    "moved": null,
    "fields": [],
    "bot": false,
    "discoverable": true,
    "noindex": false,
    "group": null,
    "suspended": false,
    "limited": false
  },
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "content": "<p><span>Recommended Video Attachment</span></p>",
  "content_type": "text/x.misskeymarkdown",
  "text": "Recommended Video Attachment",
  "created_at": "2025-03-07T13:48:15.000Z",
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "reblogged": false,
  "favourited": false,
  "muted": false,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "media_attachments": [
    {
      "id": "a52eamrle2tn000x",
      "type": "video",
      "url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "preview_url": null,
      "text_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "meta": {
        "original": {
          "frame_rate": "undefined"
        }
      },
      "description": "A beautiful cow eating",
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "poll": null,
  "application": null,
  "language": null,
  "pinned": false,
  "reactions": [],
  "emoji_reactions": [],
  "bookmarked": false,
  "quote": null,
  "edited_at": 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": [
    "http://sharkey/users/a52e8ostm0s60001",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/cK6bi5dmmvo",
  "published": "2025-03-07T13:48:16Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://sharkey/users/a52e8ostm0s60001"
    ],
    "id": "http://pasture-one-actor/actor/X-76toKmMw8",
    "published": "2025-03-07T13:48:16Z",
    "@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"
      }
    ]
  }
}
sharkey
{
  "id": "a52ean0ge2tn0010",
  "uri": "http://pasture-one-actor/actor/X-76toKmMw8",
  "url": "http://pasture-one-actor/actor/X-76toKmMw8",
  "account": {
    "id": "a52ea999e2tn0002",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "fqn": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "created_at": "2025-03-07T13:47:58.173Z",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 26,
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "avatar_static": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "header": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "header_static": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "emojis": [],
    "moved": null,
    "fields": [],
    "bot": false,
    "discoverable": true,
    "noindex": false,
    "group": null,
    "suspended": false,
    "limited": false
  },
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "content": "<p><span>Recommended Audio Format</span></p>",
  "content_type": "text/x.misskeymarkdown",
  "text": "Recommended Audio Format",
  "created_at": "2025-03-07T13:48:16.000Z",
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "reblogged": false,
  "favourited": false,
  "muted": false,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "media_attachments": [
    {
      "id": "a52ean6be2tn000z",
      "type": "audio",
      "url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "remote_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "preview_url": null,
      "text_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "meta": {
        "original": {
          "frame_rate": "undefined"
        }
      },
      "description": "A cow mooing",
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "card": null,
  "poll": null,
  "application": null,
  "language": null,
  "pinned": false,
  "reactions": [],
  "emoji_reactions": [],
  "bookmarked": false,
  "quote": null,
  "edited_at": 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": [
    "http://sharkey/users/a52e8ostm0s60001",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/bX8twQNJtxI",
  "published": "2025-03-07T13:48:16Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://sharkey/users/a52e8ostm0s60001"
    ],
    "id": "http://pasture-one-actor/actor/QaxBd_xazq4",
    "published": "2025-03-07T13:48:16Z",
    "@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"
      }
    ]
  }
}
sharkey
{
  "id": "a52ean0ge2tn0011",
  "uri": "http://pasture-one-actor/actor/QaxBd_xazq4",
  "url": "http://pasture-one-actor/actor/QaxBd_xazq4",
  "account": {
    "id": "a52ea999e2tn0002",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "fqn": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "created_at": "2025-03-07T13:47:58.173Z",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 27,
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "avatar_static": "https://dev.joinsharkey.org/static-assets/avatar.png",
    "header": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "header_static": "https://dev.joinsharkey.org/static-assets/transparent.png",
    "emojis": [],
    "moved": null,
    "fields": [],
    "bot": false,
    "discoverable": true,
    "noindex": false,
    "group": null,
    "suspended": false,
    "limited": false
  },
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "content": "<p><span>Multiple formats for video</span></p>",
  "content_type": "text/x.misskeymarkdown",
  "text": "Multiple formats for video",
  "created_at": "2025-03-07T13:48:16.000Z",
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "reblogged": false,
  "favourited": false,
  "muted": false,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "poll": null,
  "application": null,
  "language": null,
  "pinned": false,
  "reactions": [],
  "emoji_reactions": [],
  "bookmarked": false,
  "quote": null,
  "edited_at": null
}