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://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/8rLpkNfIuIA",
"published": "2024-12-20T15:17:45Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/2HP2FAPstKk",
"published": "2024-12-20T15:17:45Z",
"@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
}
],
"tag": [
{
"type": "Mention",
"href": "http://gotosocial/users/cookie"
}
]
}
}
gotosocial
{
"id": "01JFJAASD8QGEH3E83AQYK0YWP",
"created_at": "2024-12-20T15:17:45.000Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": null,
"uri": "http://pasture-one-actor/actor/2HP2FAPstKk",
"url": "http://pasture-one-actor/actor/2HP2FAPstKk",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"pinned": false,
"content": "Recommended Image Format",
"reblog": null,
"account": {
"id": "01JFJAA18CP9BZJX9ZG0ZFP1B6",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": true,
"discoverable": false,
"bot": false,
"created_at": "2024-12-20T15:17:20.279Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"header": "http://gotosocial/assets/default_header.png",
"header_static": "http://gotosocial/assets/default_header.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 23,
"last_status_at": "2024-12-20T15:17:45.000Z",
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "01JFJAAT65N7C55H6NAPX8X8T4",
"type": "image",
"url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/original/01JFJAAT65N7C55H6NAPX8X8T4.jpg",
"text_url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/original/01JFJAAT65N7C55H6NAPX8X8T4.jpg",
"preview_url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/small/01JFJAAT65N7C55H6NAPX8X8T4.jpg",
"remote_url": "http://pasture-one-actor/assets/cow.jpg",
"preview_remote_url": null,
"meta": {
"original": {
"width": 200,
"height": 164,
"size": "200x164",
"aspect": 1.2195122
},
"small": {
"width": 200,
"height": 164,
"size": "200x164",
"aspect": 1.2195122
},
"focus": {
"x": 0,
"y": 0
}
},
"description": "A beautiful cow",
"blurhash": "LnL4d3I9?cxt_4%NR+WB%ha}Mxt7"
}
],
"mentions": [
{
"id": "01SGRZ2Z14DEXHEBR8ETCSMZKJ",
"username": "cookie",
"url": "http://gotosocial/@cookie",
"acct": "cookie"
}
],
"tags": [],
"emojis": [],
"card": null,
"poll": 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://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/pYKirXJqaLY",
"published": "2024-12-20T15:17:46Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/YuFReSNHpqw",
"published": "2024-12-20T15:17:46Z",
"@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"
}
],
"tag": [
{
"type": "Mention",
"href": "http://gotosocial/users/cookie"
}
]
}
}
gotosocial
{
"id": "01JFJAATCGWPAZE81ZTNG85A3X",
"created_at": "2024-12-20T15:17:46.000Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": null,
"uri": "http://pasture-one-actor/actor/YuFReSNHpqw",
"url": "http://pasture-one-actor/actor/YuFReSNHpqw",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"pinned": false,
"content": "Recommended Video Attachment",
"reblog": null,
"account": {
"id": "01JFJAA18CP9BZJX9ZG0ZFP1B6",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": true,
"discoverable": false,
"bot": false,
"created_at": "2024-12-20T15:17:20.279Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"header": "http://gotosocial/assets/default_header.png",
"header_static": "http://gotosocial/assets/default_header.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 24,
"last_status_at": "2024-12-20T15:17:46.000Z",
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "01JFJAATVPYJY4NW638YZQT8ZZ",
"type": "video",
"url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/original/01JFJAATVPYJY4NW638YZQT8ZZ.mp4",
"text_url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/original/01JFJAATVPYJY4NW638YZQT8ZZ.mp4",
"preview_url": "http://gotosocial/fileserver/01JFJAA18CP9BZJX9ZG0ZFP1B6/attachment/small/01JFJAATVPYJY4NW638YZQT8ZZ.jpg",
"remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
"preview_remote_url": null,
"meta": {
"original": {
"width": 256,
"height": 144,
"frame_rate": "25/1",
"duration": 3,
"bitrate": 140376
},
"small": {
"width": 256,
"height": 144,
"size": "256x144",
"aspect": 1.7777778
}
},
"description": "A beautiful cow eating",
"blurhash": "L00000fQfQfQfQfQfQfQfQfQfQfQ"
}
],
"mentions": [
{
"id": "01SGRZ2Z14DEXHEBR8ETCSMZKJ",
"username": "cookie",
"url": "http://gotosocial/@cookie",
"acct": "cookie"
}
],
"tags": [],
"emojis": [],
"card": null,
"poll": 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://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/02Ue2tO39Nk",
"published": "2024-12-20T15:17:47Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/MCJ5Msk0l2I",
"published": "2024-12-20T15:17:47Z",
"@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"
}
],
"tag": [
{
"type": "Mention",
"href": "http://gotosocial/users/cookie"
}
]
}
}
gotosocial
{
"id": "01JFJAAVBRAQCH5MFX3RYJ3ESX",
"created_at": "2024-12-20T15:17:47.000Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": null,
"uri": "http://pasture-one-actor/actor/MCJ5Msk0l2I",
"url": "http://pasture-one-actor/actor/MCJ5Msk0l2I",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"pinned": false,
"content": "Recommended Audio Format<hr><p><i lang=\"en\">\u2139\ufe0f Note from gotosocial: 1 attachment in this status could not be downloaded. Treat the following external link with care:</i></p><ul><li><a href=\"http://pasture-one-actor/assets/cow_moo.mp3\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">cow_moo.mp3</a> [A cow mooing]</li></ul>",
"reblog": null,
"account": {
"id": "01JFJAA18CP9BZJX9ZG0ZFP1B6",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": true,
"discoverable": false,
"bot": false,
"created_at": "2024-12-20T15:17:20.279Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"header": "http://gotosocial/assets/default_header.png",
"header_static": "http://gotosocial/assets/default_header.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 25,
"last_status_at": "2024-12-20T15:17:47.000Z",
"emojis": [],
"fields": []
},
"media_attachments": [],
"mentions": [
{
"id": "01SGRZ2Z14DEXHEBR8ETCSMZKJ",
"username": "cookie",
"url": "http://gotosocial/@cookie",
"acct": "cookie"
}
],
"tags": [],
"emojis": [],
"card": null,
"poll": 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://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/NP0EcfPVlZk",
"published": "2024-12-20T15:17:47Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://gotosocial/users/cookie"
],
"id": "http://pasture-one-actor/actor/TjEKWLWuxQU",
"published": "2024-12-20T15:17:47Z",
"@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"
}
],
"tag": [
{
"type": "Mention",
"href": "http://gotosocial/users/cookie"
}
]
}
}
gotosocial
{
"id": "01JFJAAVBRP3XZBGKCKQJ3M518",
"created_at": "2024-12-20T15:17:47.000Z",
"in_reply_to_id": null,
"in_reply_to_account_id": null,
"sensitive": false,
"spoiler_text": "",
"visibility": "public",
"language": null,
"uri": "http://pasture-one-actor/actor/TjEKWLWuxQU",
"url": "http://pasture-one-actor/actor/TjEKWLWuxQU",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"pinned": false,
"content": "Multiple formats for video",
"reblog": null,
"account": {
"id": "01JFJAA18CP9BZJX9ZG0ZFP1B6",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": true,
"discoverable": false,
"bot": false,
"created_at": "2024-12-20T15:17:20.279Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon3.png",
"header": "http://gotosocial/assets/default_header.png",
"header_static": "http://gotosocial/assets/default_header.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 26,
"last_status_at": "2024-12-20T15:17:47.000Z",
"emojis": [],
"fields": []
},
"media_attachments": [],
"mentions": [
{
"id": "01SGRZ2Z14DEXHEBR8ETCSMZKJ",
"username": "cookie",
"url": "http://gotosocial/@cookie",
"acct": "cookie"
}
],
"tags": [],
"emojis": [],
"card": null,
"poll": null
}