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/KgmmysSeSnY",
"published": "2024-12-20T15:09:27Z",
"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/rHZzC5qGOmM",
"published": "2024-12-20T15:09:27Z",
"@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": "",
"pinned": false,
"pleroma": {
"content": {
"text/plain": "Recommended Image Format"
},
"context": "http://pasture-one-actor/actor/rHZzC5qGOmM",
"conversation_id": 929407493,
"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/rHZzC5qGOmM",
"favourites_count": 0,
"language": null,
"quote": null,
"bookmarked": false,
"reblog": null,
"id": "ApEz0JBcBlKf2r7o0W",
"in_reply_to_account_id": null,
"card": null,
"in_reply_to_id": null,
"replies_count": 0,
"mentions": [
{
"acct": "witch",
"id": "ApEyqrmbMm9h0LuKOG",
"url": "http://akkoma/users/witch",
"username": "witch"
}
],
"url": "http://pasture-one-actor/actor/rHZzC5qGOmM",
"emojis": [],
"text": null,
"content": "Recommended Image Format",
"created_at": "2024-12-20T15:09:27.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-20T15:09:11.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": "ApEyyndhzfx2ulXukK",
"last_status_at": "2024-12-20",
"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/yz80ITUm5LQ",
"published": "2024-12-20T15:09:28Z",
"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/tBLLDtOlcyc",
"published": "2024-12-20T15:09:28Z",
"@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": "",
"pinned": false,
"pleroma": {
"content": {
"text/plain": "Recommended Video Attachment"
},
"context": "http://pasture-one-actor/actor/tBLLDtOlcyc",
"conversation_id": 2133079311,
"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/tBLLDtOlcyc",
"favourites_count": 0,
"language": null,
"quote": null,
"bookmarked": false,
"reblog": null,
"id": "ApEz0NCpFCg3VlipRw",
"in_reply_to_account_id": null,
"card": null,
"in_reply_to_id": null,
"replies_count": 0,
"mentions": [
{
"acct": "witch",
"id": "ApEyqrmbMm9h0LuKOG",
"url": "http://akkoma/users/witch",
"username": "witch"
}
],
"url": "http://pasture-one-actor/actor/tBLLDtOlcyc",
"emojis": [],
"text": null,
"content": "Recommended Video Attachment",
"created_at": "2024-12-20T15:09:28.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-20T15:09:11.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": "ApEyyndhzfx2ulXukK",
"last_status_at": "2024-12-20",
"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/kdkuZwzdoXU",
"published": "2024-12-20T15:09:28Z",
"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/aLgWZb0N1A4",
"published": "2024-12-20T15:09:28Z",
"@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": "",
"pinned": false,
"pleroma": {
"content": {
"text/plain": "Recommended Audio Format"
},
"context": "http://pasture-one-actor/actor/aLgWZb0N1A4",
"conversation_id": 21416186,
"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/aLgWZb0N1A4",
"favourites_count": 0,
"language": null,
"quote": null,
"bookmarked": false,
"reblog": null,
"id": "ApEz0RP1dmoSWlSd1M",
"in_reply_to_account_id": null,
"card": null,
"in_reply_to_id": null,
"replies_count": 0,
"mentions": [
{
"acct": "witch",
"id": "ApEyqrmbMm9h0LuKOG",
"url": "http://akkoma/users/witch",
"username": "witch"
}
],
"url": "http://pasture-one-actor/actor/aLgWZb0N1A4",
"emojis": [],
"text": null,
"content": "Recommended Audio Format",
"created_at": "2024-12-20T15:09:28.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-20T15:09:11.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": "ApEyyndhzfx2ulXukK",
"last_status_at": "2024-12-20",
"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/oQq4B8uGvsE",
"published": "2024-12-20T15:09:29Z",
"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/tO_82-It4nw",
"published": "2024-12-20T15:09:29Z",
"@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": "",
"pinned": false,
"pleroma": {
"content": {
"text/plain": "Multiple formats for video"
},
"context": "http://pasture-one-actor/actor/tO_82-It4nw",
"conversation_id": 2146632001,
"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/tO_82-It4nw",
"favourites_count": 0,
"language": null,
"quote": null,
"bookmarked": false,
"reblog": null,
"id": "ApEz0VTmU2zfAfiTzM",
"in_reply_to_account_id": null,
"card": null,
"in_reply_to_id": null,
"replies_count": 0,
"mentions": [
{
"acct": "witch",
"id": "ApEyqrmbMm9h0LuKOG",
"url": "http://akkoma/users/witch",
"username": "witch"
}
],
"url": "http://pasture-one-actor/actor/tO_82-It4nw",
"emojis": [],
"text": null,
"content": "Multiple formats for video",
"created_at": "2024-12-20T15:09:29.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-20T15:09:11.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": "ApEyyndhzfx2ulXukK",
"last_status_at": "2024-12-20",
"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"
}
]
}