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.

The recommended format is documented in FEP-1311: Media Attachments.

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://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/4Zs6hrV_-y8",
  "published": "2025-07-31T10:40:47Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/actor/79EK_Pgt9O0",
    "published": "2025-07-31T10:40:47Z",
    "@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
      }
    ]
  }
}
mastodon
{
  "id": "114947420868553448",
  "created_at": "2025-07-31T10:40:47.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/79EK_Pgt9O0",
  "url": "http://pasture-one-actor/actor/79EK_Pgt9O0",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Recommended Image Format",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "114947419241946686",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-07-31T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 24,
    "last_status_at": "2025-07-31",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "114947420861989776",
      "type": "image",
      "url": "http://localhost:2970/system/cache/media_attachments/files/114/947/420/861/989/776/original/a6e29ba1dd6cad33.jpg",
      "preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/947/420/861/989/776/small/a6e29ba1dd6cad33.jpg",
      "remote_url": "http://pasture-one-actor/assets/cow.jpg",
      "preview_remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 200,
          "height": 164,
          "size": "200x164",
          "aspect": 1.2195121951219512
        },
        "small": {
          "width": 200,
          "height": 164,
          "size": "200x164",
          "aspect": 1.2195121951219512
        }
      },
      "description": "A beautiful cow",
      "blurhash": "UjL4Z_Di_3s._4%gNHRkyEWBMxt7kDV@aJbH"
    }
  ],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": 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://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/oFHgRNSiDT4",
  "published": "2025-07-31T10:40:48Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/actor/LII2uoQoUTg",
    "published": "2025-07-31T10:40:48Z",
    "@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"
      }
    ]
  }
}
mastodon
{
  "id": "114947420947779441",
  "created_at": "2025-07-31T10:40:48.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/LII2uoQoUTg",
  "url": "http://pasture-one-actor/actor/LII2uoQoUTg",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Recommended Video Attachment",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "114947419241946686",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-07-31T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 25,
    "last_status_at": "2025-07-31",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "114947420931846214",
      "type": "gifv",
      "url": "http://localhost:2970/system/cache/media_attachments/files/114/947/420/931/846/214/original/9b15f06d2515edc4.mp4",
      "preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/947/420/931/846/214/small/9b15f06d2515edc4.png",
      "remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "preview_remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 256,
          "height": 144,
          "frame_rate": "25/1",
          "duration": 3.0,
          "bitrate": 144994
        },
        "small": {
          "width": 256,
          "height": 144,
          "size": "256x144",
          "aspect": 1.7777777777777777
        }
      },
      "description": "A beautiful cow eating",
      "blurhash": "UTEMdgveNaXU-trVWCOFKRNFnPWCKPNdn#xE"
    }
  ],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": 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://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/VG6htvo_B7s",
  "published": "2025-07-31T10:40:49Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/actor/Vfa1bNr9WuA",
    "published": "2025-07-31T10:40:49Z",
    "@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"
      }
    ]
  }
}
mastodon
{
  "id": "114947421007804171",
  "created_at": "2025-07-31T10:40:49.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/Vfa1bNr9WuA",
  "url": "http://pasture-one-actor/actor/Vfa1bNr9WuA",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Recommended Audio Format",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "114947419241946686",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-07-31T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 26,
    "last_status_at": "2025-07-31",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "114947420995741536",
      "type": "audio",
      "url": "http://localhost:2970/system/cache/media_attachments/files/114/947/420/995/741/536/original/4fe38d9112b1e8b5.mp3",
      "preview_url": null,
      "remote_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "preview_remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "duration": 2.142041,
          "bitrate": 131018
        }
      },
      "description": "A cow mooing",
      "blurhash": null
    }
  ],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": 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://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/69hvuAdG4QY",
  "published": "2025-07-31T10:40:50Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/actor/j4-IeCOAIM4",
    "published": "2025-07-31T10:40:50Z",
    "@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"
      }
    ]
  }
}
mastodon
{
  "id": "114947421080517628",
  "created_at": "2025-07-31T10:40:50.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/actor/j4-IeCOAIM4",
  "url": "http://pasture-one-actor/actor/j4-IeCOAIM4",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Multiple formats for video",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "114947419241946686",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-07-31T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 27,
    "last_status_at": "2025-07-31",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [
    {
      "id": "114947421065833055",
      "type": "gifv",
      "url": "http://localhost:2970/system/cache/media_attachments/files/114/947/421/065/833/055/original/cea3e6139b7382ad.mp4",
      "preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/947/421/065/833/055/small/cea3e6139b7382ad.png",
      "remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "preview_remote_url": null,
      "text_url": null,
      "meta": {
        "original": {
          "width": 256,
          "height": 144,
          "frame_rate": "25/1",
          "duration": 3.0,
          "bitrate": 144994
        },
        "small": {
          "width": 256,
          "height": 144,
          "size": "256x144",
          "aspect": 1.7777777777777777
        }
      },
      "description": "A beautiful cow eating",
      "blurhash": "UTEMdgveNaXU-trVWCOFKRNFnPWCKPNdn#xE"
    }
  ],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}