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.
The recommended format is documented in FEP-1311: Media Attachments.
Examples¶
Example 1¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2",
{
"size": "https://joinpeertube.org/ns#size"
}
],
"type": "Create",
"actor": "http://pasture-one-actor/actor",
"to": [
"http://pyfedi.local/c/pie",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/activity/r6h1dLHKCig",
"published": "2025-09-08T17:27:41Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/object/dIKQxCYCGWo",
"published": "2025-09-08T17:27:41Z",
"@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://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 54,
"user_id": 2,
"community_id": 1,
"title": "Recommended Image Format",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-08T17:27:41.280235Z",
"ap_id": "http://pasture-one-actor/object/dIKQxCYCGWo",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Recommended Image Format",
"url": "http://pasture-one-actor/assets/cow.jpg",
"thumbnail_url": "http://pasture-one-actor/assets/cow.jpg",
"small_thumbnail_url": "http://pasture-one-actor/assets/cow.jpg",
"alt_text": "A beautiful cow"
}
Example 2¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2",
{
"size": "https://joinpeertube.org/ns#size"
}
],
"type": "Create",
"actor": "http://pasture-one-actor/actor",
"to": [
"http://pyfedi.local/c/pie",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/activity/-J6dZj2yEiw",
"published": "2025-09-08T17:27:41Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/object/8EMQ_-dqnEw",
"published": "2025-09-08T17:27:41Z",
"@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://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 55,
"user_id": 2,
"community_id": 1,
"title": "Recommended Video Attachment",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-08T17:27:42.072853Z",
"ap_id": "http://pasture-one-actor/object/8EMQ_-dqnEw",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Recommended Video Attachment"
}
Example 3¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2",
{
"size": "https://joinpeertube.org/ns#size"
}
],
"type": "Create",
"actor": "http://pasture-one-actor/actor",
"to": [
"http://pyfedi.local/c/pie",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/activity/nh6zc1OT7wA",
"published": "2025-09-08T17:27:42Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/object/A2rEJcWQm_g",
"published": "2025-09-08T17:27:42Z",
"@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://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 56,
"user_id": 2,
"community_id": 1,
"title": "A cow mooing",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-08T17:27:42.881475Z",
"ap_id": "http://pasture-one-actor/object/A2rEJcWQm_g",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Recommended Audio Format",
"url": "http://pasture-one-actor/assets/cow_moo.mp3"
}
Example 4¶
activity
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://www.w3.org/ns/credentials/v2",
{
"size": "https://joinpeertube.org/ns#size"
}
],
"type": "Create",
"actor": "http://pasture-one-actor/actor",
"to": [
"http://pyfedi.local/c/pie",
"https://www.w3.org/ns/activitystreams#Public"
],
"id": "http://pasture-one-actor/activity/jVhGZl4y1zA",
"published": "2025-09-08T17:27:43Z",
"object": {
"type": "Note",
"attributedTo": "http://pasture-one-actor/actor",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"http://pyfedi.local/c/pie"
],
"id": "http://pasture-one-actor/object/wosI4DZRkCA",
"published": "2025-09-08T17:27:43Z",
"@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://pyfedi.local/c/pie"
}
]
}
}
pyfedi
{
"id": 57,
"user_id": 2,
"community_id": 1,
"title": "Multiple formats for video",
"deleted": false,
"nsfw": false,
"sticky": false,
"published": "2025-09-08T17:27:43.698855Z",
"ap_id": "http://pasture-one-actor/object/wosI4DZRkCA",
"local": false,
"language_id": 2,
"removed": false,
"locked": false,
"body": "Multiple formats for video"
}