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://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/-blKgvXNPzE",
"published": "2024-12-04T18:55:36Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/XtZu1rX137E",
"published": "2024-12-04T18:55:36Z",
"@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": "a1dtbneo2s8k000j",
"uri": "http://pasture-one-actor/actor/XtZu1rX137E",
"url": "http://pasture-one-actor/actor/XtZu1rX137E",
"account": {
"id": "a1dt8ksn2s8k0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-04T18:53:12.647Z",
"followers_count": 0,
"following_count": 0,
"statuses_count": 11,
"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
},
"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": "2024-12-04T18:55:36.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": "a1dtbo4f2s8k000i",
"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
},
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/ob9QrYtc3Cs",
"published": "2024-12-04T18:55:37Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/K3LA8r8APB8",
"published": "2024-12-04T18:55:37Z",
"@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": "a1dtbo6g2s8k000l",
"uri": "http://pasture-one-actor/actor/K3LA8r8APB8",
"url": "http://pasture-one-actor/actor/K3LA8r8APB8",
"account": {
"id": "a1dt8ksn2s8k0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-04T18:53:12.647Z",
"followers_count": 0,
"following_count": 0,
"statuses_count": 12,
"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
},
"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": "2024-12-04T18:55:37.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": "a1dtborx2s8k000k",
"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": {},
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/TQF4J6j79cM",
"published": "2024-12-04T18:55:38Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/hdG8H2_hRsA",
"published": "2024-12-04T18:55:38Z",
"@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": "a1dtboy82s8k000n",
"uri": "http://pasture-one-actor/actor/hdG8H2_hRsA",
"url": "http://pasture-one-actor/actor/hdG8H2_hRsA",
"account": {
"id": "a1dt8ksn2s8k0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-04T18:53:12.647Z",
"followers_count": 0,
"following_count": 0,
"statuses_count": 13,
"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
},
"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": "2024-12-04T18:55:38.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": "a1dtbpck2s8k000m",
"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": {},
"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": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/Z1GO9yl-SVk",
"published": "2024-12-04T18:55:39Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a1dt71ulqgq90001"
],
"id": "http://pasture-one-actor/actor/CtqfIybVMTc",
"published": "2024-12-04T18:55:39Z",
"@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": "a1dtbpq02s8k000o",
"uri": "http://pasture-one-actor/actor/CtqfIybVMTc",
"url": "http://pasture-one-actor/actor/CtqfIybVMTc",
"account": {
"id": "a1dt8ksn2s8k0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-04T18:53:12.647Z",
"followers_count": 0,
"following_count": 0,
"statuses_count": 14,
"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
},
"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": "2024-12-04T18:55:39.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
}