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://akkoma/users/witch",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/S5Szzuugy50",
  "published": "2024-12-05T08:18:48Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://akkoma/users/witch"
    ],
    "id": "http://pasture-one-actor/actor/qDqgbPpNQPw",
    "published": "2024-12-05T08:18:48Z",
    "@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
      }
    ]
  }
}
akkoma
{
  "spoiler_text": "",
  "text": null,
  "pinned": false,
  "pleroma": {
    "content": {
      "text/plain": "Recommended Image Format"
    },
    "context": "http://pasture-one-actor/actor/qDqgbPpNQPw",
    "conversation_id": 409389443,
    "direct_conversation_id": null,
    "emoji_reactions": [],
    "expires_at": null,
    "in_reply_to_account_acct": null,
    "local": false,
    "parent_visible": false,
    "pinned_at": null,
    "spoiler_text": {
      "text/plain": ""
    },
    "thread_muted": false
  },
  "uri": "http://pasture-one-actor/actor/qDqgbPpNQPw",
  "favourites_count": 0,
  "language": null,
  "quote": null,
  "bookmarked": false,
  "reblog": null,
  "id": "AojIeFMkyMURluUeSe",
  "in_reply_to_account_id": null,
  "card": null,
  "in_reply_to_id": null,
  "replies_count": 0,
  "mentions": [
    {
      "acct": "witch",
      "id": "AojIV6CzqQRHJVYonQ",
      "url": "http://akkoma/users/witch",
      "username": "witch"
    }
  ],
  "url": "http://pasture-one-actor/actor/qDqgbPpNQPw",
  "emojis": [],
  "content": "Recommended Image Format",
  "created_at": "2024-12-05T08:18:48.000Z",
  "muted": false,
  "favourited": false,
  "quote_id": null,
  "edited_at": null,
  "poll": null,
  "application": null,
  "akkoma": {
    "source": null
  },
  "sensitive": false,
  "visibility": "public",
  "emoji_reactions": [],
  "reblogs_count": 0,
  "reblogged": false,
  "tags": [],
  "account": {
    "acct": "actor@pasture-one-actor",
    "akkoma": {
      "instance": {
        "favicon": null,
        "name": "pasture-one-actor",
        "nodeinfo": {}
      },
      "permit_followback": false,
      "status_ttl_days": null
    },
    "avatar": "http://akkoma/images/avi.png",
    "avatar_static": "http://akkoma/images/avi.png",
    "bot": false,
    "created_at": "2024-12-05T08:18:32.000Z",
    "display_name": "Test Actor",
    "emojis": [],
    "fields": [],
    "followers_count": 0,
    "following_count": 0,
    "fqn": "actor@pasture-one-actor",
    "header": "http://akkoma/images/banner.png",
    "header_static": "http://akkoma/images/banner.png",
    "id": "AojIcm7iD7NwmtkqsS",
    "last_status_at": "2024-12-05",
    "locked": false,
    "note": "",
    "pleroma": {
      "also_known_as": [],
      "ap_id": "http://pasture-one-actor/actor",
      "background_image": null,
      "favicon": null,
      "hide_favorites": true,
      "hide_followers": false,
      "hide_followers_count": false,
      "hide_follows": false,
      "hide_follows_count": false,
      "is_admin": false,
      "is_confirmed": true,
      "is_moderator": false,
      "is_suggested": false,
      "relationship": {},
      "skip_thread_containment": false,
      "tags": []
    },
    "source": {
      "fields": [],
      "note": "",
      "pleroma": {
        "actor_type": "Person",
        "discoverable": false
      },
      "sensitive": false
    },
    "statuses_count": 23,
    "url": "http://pasture-one-actor/actor",
    "username": "actor"
  },
  "media_attachments": [
    {
      "blurhash": null,
      "description": "A beautiful cow",
      "id": "-1149766120",
      "meta": {
        "original": {
          "aspect": 0.6172839506172839,
          "height": 162,
          "width": 100
        }
      },
      "pleroma": {
        "mime_type": "image/jpeg"
      },
      "preview_url": "http://pasture-one-actor/assets/cow.jpg",
      "remote_url": "http://pasture-one-actor/assets/cow.jpg",
      "text_url": "http://pasture-one-actor/assets/cow.jpg",
      "type": "image",
      "url": "http://pasture-one-actor/assets/cow.jpg"
    }
  ]
}

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://akkoma/users/witch",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/g7tRwuYGwZY",
  "published": "2024-12-05T08:18:49Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://akkoma/users/witch"
    ],
    "id": "http://pasture-one-actor/actor/2Q9HpR-AdfY",
    "published": "2024-12-05T08:18:49Z",
    "@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"
      }
    ]
  }
}
akkoma
{
  "spoiler_text": "",
  "text": null,
  "pinned": false,
  "pleroma": {
    "content": {
      "text/plain": "Recommended Video Attachment"
    },
    "context": "http://pasture-one-actor/actor/2Q9HpR-AdfY",
    "conversation_id": 22323493,
    "direct_conversation_id": null,
    "emoji_reactions": [],
    "expires_at": null,
    "in_reply_to_account_acct": null,
    "local": false,
    "parent_visible": false,
    "pinned_at": null,
    "spoiler_text": {
      "text/plain": ""
    },
    "thread_muted": false
  },
  "uri": "http://pasture-one-actor/actor/2Q9HpR-AdfY",
  "favourites_count": 0,
  "language": null,
  "quote": null,
  "bookmarked": false,
  "reblog": null,
  "id": "AojIeJQ5ttXKLQ5NDc",
  "in_reply_to_account_id": null,
  "card": null,
  "in_reply_to_id": null,
  "replies_count": 0,
  "mentions": [
    {
      "acct": "witch",
      "id": "AojIV6CzqQRHJVYonQ",
      "url": "http://akkoma/users/witch",
      "username": "witch"
    }
  ],
  "url": "http://pasture-one-actor/actor/2Q9HpR-AdfY",
  "emojis": [],
  "content": "Recommended Video Attachment",
  "created_at": "2024-12-05T08:18:49.000Z",
  "muted": false,
  "favourited": false,
  "quote_id": null,
  "edited_at": null,
  "poll": null,
  "application": null,
  "akkoma": {
    "source": null
  },
  "sensitive": false,
  "visibility": "public",
  "emoji_reactions": [],
  "reblogs_count": 0,
  "reblogged": false,
  "tags": [],
  "account": {
    "acct": "actor@pasture-one-actor",
    "akkoma": {
      "instance": {
        "favicon": null,
        "name": "pasture-one-actor",
        "nodeinfo": {}
      },
      "permit_followback": false,
      "status_ttl_days": null
    },
    "avatar": "http://akkoma/images/avi.png",
    "avatar_static": "http://akkoma/images/avi.png",
    "bot": false,
    "created_at": "2024-12-05T08:18:32.000Z",
    "display_name": "Test Actor",
    "emojis": [],
    "fields": [],
    "followers_count": 0,
    "following_count": 0,
    "fqn": "actor@pasture-one-actor",
    "header": "http://akkoma/images/banner.png",
    "header_static": "http://akkoma/images/banner.png",
    "id": "AojIcm7iD7NwmtkqsS",
    "last_status_at": "2024-12-05",
    "locked": false,
    "note": "",
    "pleroma": {
      "also_known_as": [],
      "ap_id": "http://pasture-one-actor/actor",
      "background_image": null,
      "favicon": null,
      "hide_favorites": true,
      "hide_followers": false,
      "hide_followers_count": false,
      "hide_follows": false,
      "hide_follows_count": false,
      "is_admin": false,
      "is_confirmed": true,
      "is_moderator": false,
      "is_suggested": false,
      "relationship": {},
      "skip_thread_containment": false,
      "tags": []
    },
    "source": {
      "fields": [],
      "note": "",
      "pleroma": {
        "actor_type": "Person",
        "discoverable": false
      },
      "sensitive": false
    },
    "statuses_count": 24,
    "url": "http://pasture-one-actor/actor",
    "username": "actor"
  },
  "media_attachments": [
    {
      "blurhash": null,
      "description": "A beautiful cow eating",
      "id": "70207247",
      "meta": {
        "original": {
          "aspect": 1.7777777777777777,
          "height": 144,
          "width": 256
        }
      },
      "pleroma": {
        "mime_type": "video/mp4"
      },
      "preview_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "text_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "type": "video",
      "url": "http://pasture-one-actor/assets/cow_eating.mp4"
    }
  ]
}

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://akkoma/users/witch",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/y1Ohf16Q2Bs",
  "published": "2024-12-05T08:18:49Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://akkoma/users/witch"
    ],
    "id": "http://pasture-one-actor/actor/9e92hoyVlrs",
    "published": "2024-12-05T08:18: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"
      }
    ]
  }
}
akkoma
{
  "spoiler_text": "",
  "text": null,
  "pinned": false,
  "pleroma": {
    "content": {
      "text/plain": "Recommended Audio Format"
    },
    "context": "http://pasture-one-actor/actor/9e92hoyVlrs",
    "conversation_id": 1769146039,
    "direct_conversation_id": null,
    "emoji_reactions": [],
    "expires_at": null,
    "in_reply_to_account_acct": null,
    "local": false,
    "parent_visible": false,
    "pinned_at": null,
    "spoiler_text": {
      "text/plain": ""
    },
    "thread_muted": false
  },
  "uri": "http://pasture-one-actor/actor/9e92hoyVlrs",
  "favourites_count": 0,
  "language": null,
  "quote": null,
  "bookmarked": false,
  "reblog": null,
  "id": "AojIeNceH9xJNVzSLI",
  "in_reply_to_account_id": null,
  "card": null,
  "in_reply_to_id": null,
  "replies_count": 0,
  "mentions": [
    {
      "acct": "witch",
      "id": "AojIV6CzqQRHJVYonQ",
      "url": "http://akkoma/users/witch",
      "username": "witch"
    }
  ],
  "url": "http://pasture-one-actor/actor/9e92hoyVlrs",
  "emojis": [],
  "content": "Recommended Audio Format",
  "created_at": "2024-12-05T08:18:49.000Z",
  "muted": false,
  "favourited": false,
  "quote_id": null,
  "edited_at": null,
  "poll": null,
  "application": null,
  "akkoma": {
    "source": null
  },
  "sensitive": false,
  "visibility": "public",
  "emoji_reactions": [],
  "reblogs_count": 0,
  "reblogged": false,
  "tags": [],
  "account": {
    "acct": "actor@pasture-one-actor",
    "akkoma": {
      "instance": {
        "favicon": null,
        "name": "pasture-one-actor",
        "nodeinfo": {}
      },
      "permit_followback": false,
      "status_ttl_days": null
    },
    "avatar": "http://akkoma/images/avi.png",
    "avatar_static": "http://akkoma/images/avi.png",
    "bot": false,
    "created_at": "2024-12-05T08:18:32.000Z",
    "display_name": "Test Actor",
    "emojis": [],
    "fields": [],
    "followers_count": 0,
    "following_count": 0,
    "fqn": "actor@pasture-one-actor",
    "header": "http://akkoma/images/banner.png",
    "header_static": "http://akkoma/images/banner.png",
    "id": "AojIcm7iD7NwmtkqsS",
    "last_status_at": "2024-12-05",
    "locked": false,
    "note": "",
    "pleroma": {
      "also_known_as": [],
      "ap_id": "http://pasture-one-actor/actor",
      "background_image": null,
      "favicon": null,
      "hide_favorites": true,
      "hide_followers": false,
      "hide_followers_count": false,
      "hide_follows": false,
      "hide_follows_count": false,
      "is_admin": false,
      "is_confirmed": true,
      "is_moderator": false,
      "is_suggested": false,
      "relationship": {},
      "skip_thread_containment": false,
      "tags": []
    },
    "source": {
      "fields": [],
      "note": "",
      "pleroma": {
        "actor_type": "Person",
        "discoverable": false
      },
      "sensitive": false
    },
    "statuses_count": 25,
    "url": "http://pasture-one-actor/actor",
    "username": "actor"
  },
  "media_attachments": [
    {
      "blurhash": null,
      "description": "A cow mooing",
      "id": "1474550563",
      "pleroma": {
        "mime_type": "audio/mpeg"
      },
      "preview_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "remote_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "text_url": "http://pasture-one-actor/assets/cow_moo.mp3",
      "type": "audio",
      "url": "http://pasture-one-actor/assets/cow_moo.mp3"
    }
  ]
}

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://akkoma/users/witch",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/actor/xmVuupkmarg",
  "published": "2024-12-05T08:18:50Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://akkoma/users/witch"
    ],
    "id": "http://pasture-one-actor/actor/xUS_H0-Jedk",
    "published": "2024-12-05T08:18: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"
      }
    ]
  }
}
akkoma
{
  "spoiler_text": "",
  "text": null,
  "pinned": false,
  "pleroma": {
    "content": {
      "text/plain": "Multiple formats for video"
    },
    "context": "http://pasture-one-actor/actor/xUS_H0-Jedk",
    "conversation_id": 1912203372,
    "direct_conversation_id": null,
    "emoji_reactions": [],
    "expires_at": null,
    "in_reply_to_account_acct": null,
    "local": false,
    "parent_visible": false,
    "pinned_at": null,
    "spoiler_text": {
      "text/plain": ""
    },
    "thread_muted": false
  },
  "uri": "http://pasture-one-actor/actor/xUS_H0-Jedk",
  "favourites_count": 0,
  "language": null,
  "quote": null,
  "bookmarked": false,
  "reblog": null,
  "id": "AojIeRoqfk5iOVjFui",
  "in_reply_to_account_id": null,
  "card": null,
  "in_reply_to_id": null,
  "replies_count": 0,
  "mentions": [
    {
      "acct": "witch",
      "id": "AojIV6CzqQRHJVYonQ",
      "url": "http://akkoma/users/witch",
      "username": "witch"
    }
  ],
  "url": "http://pasture-one-actor/actor/xUS_H0-Jedk",
  "emojis": [],
  "content": "Multiple formats for video",
  "created_at": "2024-12-05T08:18:50.000Z",
  "muted": false,
  "favourited": false,
  "quote_id": null,
  "edited_at": null,
  "poll": null,
  "application": null,
  "akkoma": {
    "source": null
  },
  "sensitive": false,
  "visibility": "public",
  "emoji_reactions": [],
  "reblogs_count": 0,
  "reblogged": false,
  "tags": [],
  "account": {
    "acct": "actor@pasture-one-actor",
    "akkoma": {
      "instance": {
        "favicon": null,
        "name": "pasture-one-actor",
        "nodeinfo": {}
      },
      "permit_followback": false,
      "status_ttl_days": null
    },
    "avatar": "http://akkoma/images/avi.png",
    "avatar_static": "http://akkoma/images/avi.png",
    "bot": false,
    "created_at": "2024-12-05T08:18:32.000Z",
    "display_name": "Test Actor",
    "emojis": [],
    "fields": [],
    "followers_count": 0,
    "following_count": 0,
    "fqn": "actor@pasture-one-actor",
    "header": "http://akkoma/images/banner.png",
    "header_static": "http://akkoma/images/banner.png",
    "id": "AojIcm7iD7NwmtkqsS",
    "last_status_at": "2024-12-05",
    "locked": false,
    "note": "",
    "pleroma": {
      "also_known_as": [],
      "ap_id": "http://pasture-one-actor/actor",
      "background_image": null,
      "favicon": null,
      "hide_favorites": true,
      "hide_followers": false,
      "hide_followers_count": false,
      "hide_follows": false,
      "hide_follows_count": false,
      "is_admin": false,
      "is_confirmed": true,
      "is_moderator": false,
      "is_suggested": false,
      "relationship": {},
      "skip_thread_containment": false,
      "tags": []
    },
    "source": {
      "fields": [],
      "note": "",
      "pleroma": {
        "actor_type": "Person",
        "discoverable": false
      },
      "sensitive": false
    },
    "statuses_count": 26,
    "url": "http://pasture-one-actor/actor",
    "username": "actor"
  },
  "media_attachments": [
    {
      "blurhash": null,
      "description": "A beautiful cow eating",
      "id": "70207247",
      "meta": {
        "original": {
          "aspect": 1.7777777777777777,
          "height": 144,
          "width": 256
        }
      },
      "pleroma": {
        "mime_type": "video/mp4"
      },
      "preview_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "text_url": "http://pasture-one-actor/assets/cow_eating.mp4",
      "type": "video",
      "url": "http://pasture-one-actor/assets/cow_eating.mp4"
    }
  ]
}