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://sharkey/users/a20inpwa75up0001",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/actor/gicD7Msf0Cc",
"published": "2024-12-20T16:19:24Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a20inpwa75up0001"
],
"id": "http://pasture-one-actor/actor/o_SbP695qiU",
"published": "2024-12-20T16:19:24Z",
"@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": "a20iselcnqmk000k",
"uri": "http://pasture-one-actor/actor/o_SbP695qiU",
"url": "http://pasture-one-actor/actor/o_SbP695qiU",
"account": {
"id": "a20ipc5cnqmk0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-20T16:17:00.864Z",
"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-20T16:19:24.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": "a20iseyrnqmk000j",
"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": [
"http://sharkey/users/a20inpwa75up0001",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/actor/dei4DhYhtx0",
"published": "2024-12-20T16:19:25Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a20inpwa75up0001"
],
"id": "http://pasture-one-actor/actor/z8Aw4bNBsB4",
"published": "2024-12-20T16:19:25Z",
"@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": "a20isfd4nqmk000m",
"uri": "http://pasture-one-actor/actor/z8Aw4bNBsB4",
"url": "http://pasture-one-actor/actor/z8Aw4bNBsB4",
"account": {
"id": "a20ipc5cnqmk0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-20T16:17:00.864Z",
"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-20T16:19:25.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": "a20isfsynqmk000l",
"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": [
"http://sharkey/users/a20inpwa75up0001",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/actor/dz7UdgnuJ0M",
"published": "2024-12-20T16:19:25Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a20inpwa75up0001"
],
"id": "http://pasture-one-actor/actor/5Aflji4kX_Y",
"published": "2024-12-20T16:19:25Z",
"@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": "a20isfd4nqmk000o",
"uri": "http://pasture-one-actor/actor/5Aflji4kX_Y",
"url": "http://pasture-one-actor/actor/5Aflji4kX_Y",
"account": {
"id": "a20ipc5cnqmk0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-20T16:17:00.864Z",
"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-20T16:19:25.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": "a20isg61nqmk000n",
"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": [
"http://sharkey/users/a20inpwa75up0001",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/actor/Xz2NIC0wDHs",
"published": "2024-12-20T16:19:26Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://sharkey/users/a20inpwa75up0001"
],
"id": "http://pasture-one-actor/actor/Ky32hWrGc1k",
"published": "2024-12-20T16:19:26Z",
"@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": "a20isg4wnqmk000p",
"uri": "http://pasture-one-actor/actor/Ky32hWrGc1k",
"url": "http://pasture-one-actor/actor/Ky32hWrGc1k",
"account": {
"id": "a20ipc5cnqmk0002",
"username": "actor",
"acct": "actor@pasture-one-actor",
"fqn": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"created_at": "2024-12-20T16:17:00.864Z",
"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-20T16:19:26.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
}