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://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/fPdRhv3XrdY",
"published": "2025-02-07T20:56:33Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/Ekt3gsmeeug",
"published": "2025-02-07T20:56:33Z",
"@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
}
]
}
}
misskey
{
"id": "a3yszc80pl2g000v",
"createdAt": "2025-02-07T20:48:36.000Z",
"userId": "a3ysz1b3pl2g0002",
"user": {
"id": "a3ysz1b3pl2g0002",
"name": "Test Actor",
"username": "actor",
"host": "pasture-one-actor",
"avatarUrl": "http://misskey/identicon/actor@pasture-one-actor",
"avatarBlurhash": null,
"avatarDecorations": [],
"isBot": false,
"isCat": false,
"instance": {
"name": null,
"softwareName": null,
"softwareVersion": null,
"iconUrl": null,
"faviconUrl": null,
"themeColor": null
},
"emojis": {},
"onlineStatus": "unknown"
},
"text": "Recommended Image Format",
"cw": null,
"visibility": "public",
"localOnly": false,
"reactionAcceptance": null,
"renoteCount": 0,
"repliesCount": 0,
"reactionCount": 0,
"reactions": {},
"reactionEmojis": {},
"emojis": {},
"fileIds": [
"a3yszctapl2g000u"
],
"files": [
{
"id": "a3yszctapl2g000u",
"createdAt": "2025-02-07T20:48:36.766Z",
"name": "cow.jpg",
"type": "image/jpeg",
"md5": "79665fe8c07445157afebd1543f36b71",
"size": 0,
"isSensitive": false,
"blurhash": "ejK^]TI9_3t6NG_4%gRkV[of%hWCIUt7jEo#V@aJbHofazadjYWVkD",
"properties": {
"width": 200,
"height": 164
},
"url": "http://pasture-one-actor/assets/cow.jpg",
"thumbnailUrl": "http://pasture-one-actor/assets/cow.jpg",
"comment": "A beautiful cow",
"folderId": null,
"folder": null,
"userId": "a3ysz1b3pl2g0002",
"user": null
}
],
"replyId": null,
"renoteId": null,
"uri": "http://pasture-one-actor/actor/l0_zVHG5D6c",
"clippedCount": 0
}
mitra
{
"id": "0194e233-36ba-0cb7-e578-338cea23e16e",
"uri": "http://pasture-one-actor/actor/Ekt3gsmeeug",
"url": "http://pasture-one-actor/actor/Ekt3gsmeeug",
"created_at": "2025-02-07T20:56:33Z",
"edited_at": null,
"account": {
"id": "0194e232-b067-124b-0799-4ade30ddd9a9",
"username": "actor",
"acct": "actor@pasture-one-actor",
"actor_id": "http://pasture-one-actor/actor",
"url": "http://pasture-one-actor/actor",
"display_name": "Test Actor",
"created_at": "2025-02-07T20:56:00.359685Z",
"note": "",
"avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
"header": "http://mitra/api/v1/accounts/identicon",
"locked": false,
"mention_policy": "none",
"bot": false,
"identity_proofs": [],
"payment_options": [],
"fields": [],
"emojis": [],
"followers_count": 0,
"following_count": 0,
"subscribers_count": 0,
"statuses_count": 23,
"source": null,
"role": null,
"authentication_methods": null,
"client_config": null
},
"content": "Recommended Image Format",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"reblog": null,
"visibility": "public",
"sensitive": false,
"spoiler_text": "",
"pinned": false,
"replies_count": 0,
"favourites_count": 0,
"reblogs_count": 0,
"poll": null,
"media_attachments": [
{
"id": "0194e233-36b6-9d67-2832-7f0ab7e178a9",
"type": "image",
"url": "http://mitra/media/6e403ee33c2817a06af46b6e362c054aec3b43057ff32d2f7ac7761761e6e1ff.jpg",
"preview_url": "http://mitra/media/6e403ee33c2817a06af46b6e362c054aec3b43057ff32d2f7ac7761761e6e1ff.jpg",
"description": "A beautiful cow"
}
],
"mentions": [
{
"id": "0194e231-607b-c1e5-c5c3-2ce84c557b8b",
"username": "admin",
"acct": "admin",
"url": "http://mitra/users/admin"
}
],
"tags": [],
"emojis": [],
"favourited": false,
"reblogged": false,
"bookmarked": false,
"pleroma": {
"emoji_reactions": [],
"in_reply_to_account_acct": null,
"parent_visible": true,
"quote": null,
"quote_visible": false
},
"ipfs_cid": null,
"links": []
}
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://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/bEGMhCgzvpc",
"published": "2025-02-07T20:56:34Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/wJKjyjAKhUo",
"published": "2025-02-07T20:56:34Z",
"@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"
}
]
}
}
misskey
{
"id": "a3yszczspl2g000x",
"createdAt": "2025-02-07T20:48:37.000Z",
"userId": "a3ysz1b3pl2g0002",
"user": {
"id": "a3ysz1b3pl2g0002",
"name": "Test Actor",
"username": "actor",
"host": "pasture-one-actor",
"avatarUrl": "http://misskey/identicon/actor@pasture-one-actor",
"avatarBlurhash": null,
"avatarDecorations": [],
"isBot": false,
"isCat": false,
"instance": {
"name": null,
"softwareName": null,
"softwareVersion": null,
"iconUrl": null,
"faviconUrl": null,
"themeColor": null
},
"emojis": {},
"onlineStatus": "unknown"
},
"text": "Recommended Video Attachment",
"cw": null,
"visibility": "public",
"localOnly": false,
"reactionAcceptance": null,
"renoteCount": 0,
"repliesCount": 0,
"reactionCount": 0,
"reactions": {},
"reactionEmojis": {},
"emojis": {},
"fileIds": [
"a3yszdiopl2g000w"
],
"files": [
{
"id": "a3yszdiopl2g000w",
"createdAt": "2025-02-07T20:48:37.680Z",
"name": "cow_eating.mp4",
"type": "video/mp4",
"md5": "19e0d3ecdd0230ed857c9c88dd247012",
"size": 0,
"isSensitive": false,
"blurhash": null,
"properties": {},
"url": "http://pasture-one-actor/assets/cow_eating.mp4",
"thumbnailUrl": null,
"comment": "A beautiful cow eating",
"folderId": null,
"folder": null,
"userId": "a3ysz1b3pl2g0002",
"user": null
}
],
"replyId": null,
"renoteId": null,
"uri": "http://pasture-one-actor/actor/r7tSgjZ44Ug",
"clippedCount": 0
}
mitra
{
"id": "0194e233-3cb9-aa29-e0f3-7046d097e355",
"uri": "http://pasture-one-actor/actor/wJKjyjAKhUo",
"url": "http://pasture-one-actor/actor/wJKjyjAKhUo",
"created_at": "2025-02-07T20:56:34Z",
"edited_at": null,
"account": {
"id": "0194e232-b067-124b-0799-4ade30ddd9a9",
"username": "actor",
"acct": "actor@pasture-one-actor",
"actor_id": "http://pasture-one-actor/actor",
"url": "http://pasture-one-actor/actor",
"display_name": "Test Actor",
"created_at": "2025-02-07T20:56:00.359685Z",
"note": "",
"avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
"header": "http://mitra/api/v1/accounts/identicon",
"locked": false,
"mention_policy": "none",
"bot": false,
"identity_proofs": [],
"payment_options": [],
"fields": [],
"emojis": [],
"followers_count": 0,
"following_count": 0,
"subscribers_count": 0,
"statuses_count": 24,
"source": null,
"role": null,
"authentication_methods": null,
"client_config": null
},
"content": "Recommended Video Attachment",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"reblog": null,
"visibility": "public",
"sensitive": false,
"spoiler_text": "",
"pinned": false,
"replies_count": 0,
"favourites_count": 0,
"reblogs_count": 0,
"poll": null,
"media_attachments": [
{
"id": "0194e233-3cb4-16b8-8681-30a68418db8c",
"type": "video",
"url": "http://mitra/media/4514a0bf67069eb36444ace0c4d5d6d4b95be4f01490e6a22ada67bbc3967d0e.mp4",
"preview_url": "http://mitra/media/4514a0bf67069eb36444ace0c4d5d6d4b95be4f01490e6a22ada67bbc3967d0e.mp4",
"description": "A beautiful cow eating"
}
],
"mentions": [
{
"id": "0194e231-607b-c1e5-c5c3-2ce84c557b8b",
"username": "admin",
"acct": "admin",
"url": "http://mitra/users/admin"
}
],
"tags": [],
"emojis": [],
"favourited": false,
"reblogged": false,
"bookmarked": false,
"pleroma": {
"emoji_reactions": [],
"in_reply_to_account_acct": null,
"parent_visible": true,
"quote": null,
"quote_visible": false
},
"ipfs_cid": null,
"links": []
}
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://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/E_a3b8Gdsl0",
"published": "2025-02-07T20:56:36Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/o8QCEUdKwzU",
"published": "2025-02-07T20:56:36Z",
"@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"
}
]
}
}
misskey
{
"id": "a3yszczspl2g000z",
"createdAt": "2025-02-07T20:48:37.000Z",
"userId": "a3ysz1b3pl2g0002",
"user": {
"id": "a3ysz1b3pl2g0002",
"name": "Test Actor",
"username": "actor",
"host": "pasture-one-actor",
"avatarUrl": "http://misskey/identicon/actor@pasture-one-actor",
"avatarBlurhash": null,
"avatarDecorations": [],
"isBot": false,
"isCat": false,
"instance": {
"name": null,
"softwareName": null,
"softwareVersion": null,
"iconUrl": null,
"faviconUrl": null,
"themeColor": null
},
"emojis": {},
"onlineStatus": "unknown"
},
"text": "Recommended Audio Format",
"cw": null,
"visibility": "public",
"localOnly": false,
"reactionAcceptance": null,
"renoteCount": 0,
"repliesCount": 0,
"reactionCount": 0,
"reactions": {},
"reactionEmojis": {},
"emojis": {},
"fileIds": [
"a3yszdrupl2g000y"
],
"files": [
{
"id": "a3yszdrupl2g000y",
"createdAt": "2025-02-07T20:48:38.010Z",
"name": "cow_moo.mp3",
"type": "audio/mpeg",
"md5": "af0b1c1fdd1e74cb559072d725f7de31",
"size": 0,
"isSensitive": false,
"blurhash": null,
"properties": {},
"url": "http://pasture-one-actor/assets/cow_moo.mp3",
"thumbnailUrl": null,
"comment": "A cow mooing",
"folderId": null,
"folder": null,
"userId": "a3ysz1b3pl2g0002",
"user": null
}
],
"replyId": null,
"renoteId": null,
"uri": "http://pasture-one-actor/actor/X_qiCsfw6qo",
"clippedCount": 0
}
mitra
{
"id": "0194e233-4295-13e1-2634-8b2b6c0e6bbf",
"uri": "http://pasture-one-actor/actor/o8QCEUdKwzU",
"url": "http://pasture-one-actor/actor/o8QCEUdKwzU",
"created_at": "2025-02-07T20:56:36Z",
"edited_at": null,
"account": {
"id": "0194e232-b067-124b-0799-4ade30ddd9a9",
"username": "actor",
"acct": "actor@pasture-one-actor",
"actor_id": "http://pasture-one-actor/actor",
"url": "http://pasture-one-actor/actor",
"display_name": "Test Actor",
"created_at": "2025-02-07T20:56:00.359685Z",
"note": "",
"avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
"header": "http://mitra/api/v1/accounts/identicon",
"locked": false,
"mention_policy": "none",
"bot": false,
"identity_proofs": [],
"payment_options": [],
"fields": [],
"emojis": [],
"followers_count": 0,
"following_count": 0,
"subscribers_count": 0,
"statuses_count": 25,
"source": null,
"role": null,
"authentication_methods": null,
"client_config": null
},
"content": "Recommended Audio Format",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"reblog": null,
"visibility": "public",
"sensitive": false,
"spoiler_text": "",
"pinned": false,
"replies_count": 0,
"favourites_count": 0,
"reblogs_count": 0,
"poll": null,
"media_attachments": [
{
"id": "0194e233-4291-1272-78a9-e4c89e65e583",
"type": "audio",
"url": "http://mitra/media/3e33fee4c40cdc62e2744d8cf9b7b65b97e0af17e81170b067a1b8fe49b88f28.m2a",
"preview_url": "http://mitra/media/3e33fee4c40cdc62e2744d8cf9b7b65b97e0af17e81170b067a1b8fe49b88f28.m2a",
"description": "A cow mooing"
}
],
"mentions": [
{
"id": "0194e231-607b-c1e5-c5c3-2ce84c557b8b",
"username": "admin",
"acct": "admin",
"url": "http://mitra/users/admin"
}
],
"tags": [],
"emojis": [],
"favourited": false,
"reblogged": false,
"bookmarked": false,
"pleroma": {
"emoji_reactions": [],
"in_reply_to_account_acct": null,
"parent_visible": true,
"quote": null,
"quote_visible": false
},
"ipfs_cid": null,
"links": []
}
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://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/sU-aPz7U0I8",
"published": "2025-02-07T20:56:38Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mitra/users/admin"
],
"id": "http://pasture-one-actor/actor/9JXHjt1fSV0",
"published": "2025-02-07T20:56:38Z",
"@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"
}
]
}
}
misskey
{
"id": "a3yszdrkpl2g0010",
"createdAt": "2025-02-07T20:48:38.000Z",
"userId": "a3ysz1b3pl2g0002",
"user": {
"id": "a3ysz1b3pl2g0002",
"name": "Test Actor",
"username": "actor",
"host": "pasture-one-actor",
"avatarUrl": "http://misskey/identicon/actor@pasture-one-actor",
"avatarBlurhash": null,
"avatarDecorations": [],
"isBot": false,
"isCat": false,
"instance": {
"name": null,
"softwareName": null,
"softwareVersion": null,
"iconUrl": null,
"faviconUrl": null,
"themeColor": null
},
"emojis": {},
"onlineStatus": "unknown"
},
"text": "Multiple formats for video",
"cw": null,
"visibility": "public",
"localOnly": false,
"reactionAcceptance": null,
"renoteCount": 0,
"repliesCount": 0,
"reactionCount": 0,
"reactions": {},
"reactionEmojis": {},
"emojis": {},
"fileIds": [],
"files": [],
"replyId": null,
"renoteId": null,
"uri": "http://pasture-one-actor/actor/WS8UGGuyEbM",
"clippedCount": 0
}
mitra
{
"id": "0194e233-484b-5541-eabd-68943e3026de",
"uri": "http://pasture-one-actor/actor/9JXHjt1fSV0",
"url": "http://pasture-one-actor/actor/9JXHjt1fSV0",
"created_at": "2025-02-07T20:56:38Z",
"edited_at": null,
"account": {
"id": "0194e232-b067-124b-0799-4ade30ddd9a9",
"username": "actor",
"acct": "actor@pasture-one-actor",
"actor_id": "http://pasture-one-actor/actor",
"url": "http://pasture-one-actor/actor",
"display_name": "Test Actor",
"created_at": "2025-02-07T20:56:00.359685Z",
"note": "",
"avatar": "http://mitra/api/v1/accounts/identicon?input=http://pasture-one-actor/actor",
"header": "http://mitra/api/v1/accounts/identicon",
"locked": false,
"mention_policy": "none",
"bot": false,
"identity_proofs": [],
"payment_options": [],
"fields": [],
"emojis": [],
"followers_count": 0,
"following_count": 0,
"subscribers_count": 0,
"statuses_count": 26,
"source": null,
"role": null,
"authentication_methods": null,
"client_config": null
},
"content": "Multiple formats for video",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"reblog": null,
"visibility": "public",
"sensitive": false,
"spoiler_text": "",
"pinned": false,
"replies_count": 0,
"favourites_count": 0,
"reblogs_count": 0,
"poll": null,
"media_attachments": [],
"mentions": [
{
"id": "0194e231-607b-c1e5-c5c3-2ce84c557b8b",
"username": "admin",
"acct": "admin",
"url": "http://mitra/users/admin"
}
],
"tags": [],
"emojis": [],
"favourited": false,
"reblogged": false,
"bookmarked": false,
"pleroma": {
"emoji_reactions": [],
"in_reply_to_account_acct": null,
"parent_visible": true,
"quote": null,
"quote_visible": false
},
"ipfs_cid": null,
"links": []
}