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://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/00ijpio3LQc",
"published": "2025-07-10T16:24:04Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/YV68B3Gpz40",
"published": "2025-07-10T16:24:04Z",
"@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
}
]
}
}
mastodon
{
"id": "114829862197050866",
"created_at": "2025-07-10T16:24:04.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/YV68B3Gpz40",
"url": "http://pasture-one-actor/actor/YV68B3Gpz40",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"edited_at": null,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"content": "Recommended Image Format",
"filtered": [],
"reblog": null,
"account": {
"id": "114829860566519273",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"bot": false,
"discoverable": false,
"indexable": false,
"group": false,
"created_at": "2025-07-10T00:00:00.000Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"uri": "http://pasture-one-actor/actor",
"avatar": "http://mastodon/avatars/original/missing.png",
"avatar_static": "http://mastodon/avatars/original/missing.png",
"header": "http://mastodon/headers/original/missing.png",
"header_static": "http://mastodon/headers/original/missing.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 24,
"last_status_at": "2025-07-10",
"hide_collections": true,
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "114829862186259097",
"type": "image",
"url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/186/259/097/original/c673404fac206808.jpg",
"preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/186/259/097/small/c673404fac206808.jpg",
"remote_url": "http://pasture-one-actor/assets/cow.jpg",
"preview_remote_url": null,
"text_url": null,
"meta": {
"original": {
"width": 200,
"height": 164,
"size": "200x164",
"aspect": 1.2195121951219512
},
"small": {
"width": 200,
"height": 164,
"size": "200x164",
"aspect": 1.2195121951219512
}
},
"description": "A beautiful cow",
"blurhash": "UjL4Z_Di_3s._4%gNHRkyEWBMxt7kDV@aJbH"
}
],
"mentions": [],
"tags": [],
"emojis": [],
"quote": null,
"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://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/Sa9YEWNZu2Q",
"published": "2025-07-10T16:24:05Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/SKX5kyOVR28",
"published": "2025-07-10T16:24:05Z",
"@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"
}
]
}
}
mastodon
{
"id": "114829862282349604",
"created_at": "2025-07-10T16:24:05.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/SKX5kyOVR28",
"url": "http://pasture-one-actor/actor/SKX5kyOVR28",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"edited_at": null,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"content": "Recommended Video Attachment",
"filtered": [],
"reblog": null,
"account": {
"id": "114829860566519273",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"bot": false,
"discoverable": false,
"indexable": false,
"group": false,
"created_at": "2025-07-10T00:00:00.000Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"uri": "http://pasture-one-actor/actor",
"avatar": "http://mastodon/avatars/original/missing.png",
"avatar_static": "http://mastodon/avatars/original/missing.png",
"header": "http://mastodon/headers/original/missing.png",
"header_static": "http://mastodon/headers/original/missing.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 25,
"last_status_at": "2025-07-10",
"hide_collections": true,
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "114829862267498024",
"type": "gifv",
"url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/267/498/024/original/8542b40c56fb0f4a.mp4",
"preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/267/498/024/small/8542b40c56fb0f4a.png",
"remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
"preview_remote_url": null,
"text_url": null,
"meta": {
"original": {
"width": 256,
"height": 144,
"frame_rate": "25/1",
"duration": 3.0,
"bitrate": 144994
},
"small": {
"width": 256,
"height": 144,
"size": "256x144",
"aspect": 1.7777777777777777
}
},
"description": "A beautiful cow eating",
"blurhash": "UTEMdgveNaXU-trVWCOFKRNFnPWCKPNdn#xE"
}
],
"mentions": [],
"tags": [],
"emojis": [],
"quote": null,
"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://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/E6VnEOWHUdw",
"published": "2025-07-10T16:24:07Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/b3Pd9257SyI",
"published": "2025-07-10T16:24:07Z",
"@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"
}
]
}
}
mastodon
{
"id": "114829862359783212",
"created_at": "2025-07-10T16:24:07.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/b3Pd9257SyI",
"url": "http://pasture-one-actor/actor/b3Pd9257SyI",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"edited_at": null,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"content": "Recommended Audio Format",
"filtered": [],
"reblog": null,
"account": {
"id": "114829860566519273",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"bot": false,
"discoverable": false,
"indexable": false,
"group": false,
"created_at": "2025-07-10T00:00:00.000Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"uri": "http://pasture-one-actor/actor",
"avatar": "http://mastodon/avatars/original/missing.png",
"avatar_static": "http://mastodon/avatars/original/missing.png",
"header": "http://mastodon/headers/original/missing.png",
"header_static": "http://mastodon/headers/original/missing.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 26,
"last_status_at": "2025-07-10",
"hide_collections": true,
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "114829862343012057",
"type": "audio",
"url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/343/012/057/original/1bb8236c475ce5fb.mp3",
"preview_url": null,
"remote_url": "http://pasture-one-actor/assets/cow_moo.mp3",
"preview_remote_url": null,
"text_url": null,
"meta": {
"original": {
"duration": 2.142041,
"bitrate": 131018
}
},
"description": "A cow mooing",
"blurhash": null
}
],
"mentions": [],
"tags": [],
"emojis": [],
"quote": null,
"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://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/us2_xEWZQC0",
"published": "2025-07-10T16:24:08Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://mastodon/users/hippo"
],
"id": "http://pasture-one-actor/actor/jrb4yTA2SQQ",
"published": "2025-07-10T16:24:08Z",
"@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"
}
]
}
}
mastodon
{
"id": "114829862426830943",
"created_at": "2025-07-10T16:24:08.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/jrb4yTA2SQQ",
"url": "http://pasture-one-actor/actor/jrb4yTA2SQQ",
"replies_count": 0,
"reblogs_count": 0,
"favourites_count": 0,
"edited_at": null,
"favourited": false,
"reblogged": false,
"muted": false,
"bookmarked": false,
"content": "Multiple formats for video",
"filtered": [],
"reblog": null,
"account": {
"id": "114829860566519273",
"username": "actor",
"acct": "actor@pasture-one-actor",
"display_name": "Test Actor",
"locked": false,
"bot": false,
"discoverable": false,
"indexable": false,
"group": false,
"created_at": "2025-07-10T00:00:00.000Z",
"note": "",
"url": "http://pasture-one-actor/actor",
"uri": "http://pasture-one-actor/actor",
"avatar": "http://mastodon/avatars/original/missing.png",
"avatar_static": "http://mastodon/avatars/original/missing.png",
"header": "http://mastodon/headers/original/missing.png",
"header_static": "http://mastodon/headers/original/missing.png",
"followers_count": 0,
"following_count": 0,
"statuses_count": 27,
"last_status_at": "2025-07-10",
"hide_collections": true,
"emojis": [],
"fields": []
},
"media_attachments": [
{
"id": "114829862408551547",
"type": "gifv",
"url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/408/551/547/original/823c256fbdd82af6.mp4",
"preview_url": "http://localhost:2970/system/cache/media_attachments/files/114/829/862/408/551/547/small/823c256fbdd82af6.png",
"remote_url": "http://pasture-one-actor/assets/cow_eating.mp4",
"preview_remote_url": null,
"text_url": null,
"meta": {
"original": {
"width": 256,
"height": 144,
"frame_rate": "25/1",
"duration": 3.0,
"bitrate": 144994
},
"small": {
"width": 256,
"height": 144,
"size": "256x144",
"aspect": 1.7777777777777777
}
},
"description": "A beautiful cow eating",
"blurhash": "UTEMdgveNaXU-trVWCOFKRNFnPWCKPNdn#xE"
}
],
"mentions": [],
"tags": [],
"emojis": [],
"quote": null,
"card": null,
"poll": null
}