upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/71.md
diff options
context:
space:
mode:
Diffstat (limited to '71.md')
-rw-r--r--71.md129
1 files changed, 129 insertions, 0 deletions
diff --git a/71.md b/71.md
new file mode 100644
index 0000000..5edd7c6
--- /dev/null
+++ b/71.md
@@ -0,0 +1,129 @@
1NIP-71
2======
3
4Video Events
5------------
6
7`draft` `optional`
8
9This specification defines video events representing a dedicated post of externally hosted content. These video events are _addressable_ and delete-requestable per [NIP-09](09.md).
10
11Unlike a `kind 1` event with a video attached, Video Events are meant to contain all additional metadata concerning the subject media and to be surfaced in video-specific clients rather than general micro-blogging clients. The thought is for events of this kind to be referenced in a Netflix, YouTube, or TikTok like nostr client where the video itself is at the center of the experience.
12
13## Video Events
14
15There are two types of video events represented by different kinds: horizontal and vertical video events. This is meant to allow clients to cater to each as the viewing experience for horizontal (landscape) videos is often different than that of vertical (portrait) videos (Stories, Reels, Shorts, etc).
16
17#### Format
18
19The format uses an _addressable event_ kind `34235` for horizontal videos and `34236` for vertical videos.
20
21The `.content` of these events is a summary or description on the video content.
22
23The primary source of video information is the `imeta` tags which is defined in [NIP-92](92.md)
24
25Each `imeta` tag can be used to specify a variant of the video by the `dim` & `m` properties.
26
27Example:
28```json
29[
30 ["imeta",
31 "dim 1920x1080",
32 "url https://myvideo.com/1080/12345.mp4",
33 "x 3093509d1e0bc604ff60cb9286f4cd7c781553bc8991937befaacfdc28ec5cdc",
34 "m video/mp4",
35 "image https://myvideo.com/1080/12345.jpg",
36 "image https://myotherserver.com/1080/12345.jpg",
37 "fallback https://myotherserver.com/1080/12345.mp4",
38 "fallback https://andanotherserver.com/1080/12345.mp4",
39 "service nip96",
40 ],
41 ["imeta",
42 "dim 1280x720",
43 "url https://myvideo.com/720/12345.mp4",
44 "x e1d4f808dae475ed32fb23ce52ef8ac82e3cc760702fca10d62d382d2da3697d",
45 "m video/mp4",
46 "image https://myvideo.com/720/12345.jpg",
47 "image https://myotherserver.com/720/12345.jpg",
48 "fallback https://myotherserver.com/720/12345.mp4",
49 "fallback https://andanotherserver.com/720/12345.mp4",
50 "service nip96",
51 ],
52 ["imeta",
53 "dim 1280x720",
54 "url https://myvideo.com/720/12345.m3u8",
55 "x 704e720af2697f5d6a198ad377789d462054b6e8d790f8a3903afbc1e044014f",
56 "m application/x-mpegURL",
57 "image https://myvideo.com/720/12345.jpg",
58 "image https://myotherserver.com/720/12345.jpg",
59 "fallback https://myotherserver.com/720/12345.m3u8",
60 "fallback https://andanotherserver.com/720/12345.m3u8",
61 "service nip96",
62 ],
63]
64```
65
66Where `url` is the primary server url and `fallback` are other servers hosting the same file, both `url` and `fallback` should be weighted equally and clients are recommended to use any of the provided video urls.
67
68The `image` tag contains a preview image (at the same resolution). Multiple `image` tags may be used to specify fallback copies in the same way `fallback` is used for `url`.
69
70Additionally `service nip96` may be included to allow clients to search the authors NIP-96 server list to find the file using the hash.
71
72### Other tags:
73* `title` (required) title of the video
74* `published_at`, for the timestamp in unix seconds (stringified) of the first time the video was published
75* `duration` (optional) video duration in seconds
76* `text-track` (optional, repeated) link to WebVTT file for video, type of supplementary information (captions/subtitles/chapters/metadata), optional language code
77* `content-warning` (optional) warning about content of NSFW video
78* `alt` (optional) description for accessibility
79* `segment` (optional, repeated) start timestamp in format `HH:MM:SS.sss`, end timestamp in format `HH:MM:SS.sss`, chapter/segment title, chapter thumbnail-url
80* `t` (optional, repeated) hashtag to categorize video
81* `p` (optional, repeated) 32-bytes hex pubkey of a participant in the video, optional recommended relay URL
82* `r` (optional, repeated) references / links to web pages
83
84```jsonc
85{
86 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
87 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
88 "created_at": <Unix timestamp in seconds>,
89 "kind": 34235 | 34236,
90 "content": "<summary / description of video>",
91 "tags": [
92 ["d", "<UUID>"],
93
94 ["title", "<title of video>"],
95 ["published_at", "<unix timestamp>"],
96 ["alt", <description>],
97
98 // Video Data
99 ["imeta",
100 "dim 1920x1080",
101 "url https://myvideo.com/1080/12345.mp4",
102 "x 3093509d1e0bc604ff60cb9286f4cd7c781553bc8991937befaacfdc28ec5cdc",
103 "m video/mp4",
104 "image https://myvideo.com/1080/12345.jpg",
105 "image https://myotherserver.com/1080/12345.jpg",
106 "fallback https://myotherserver.com/1080/12345.mp4",
107 "fallback https://andanotherserver.com/1080/12345.mp4",
108 "service nip96",
109 ],
110
111 ["duration", <duration of video in seconds>],
112 ["text-track", "<encoded `kind 6000` event>", "<recommended relay urls>"],
113 ["content-warning", "<reason>"],
114 ["segment", <start>, <end>, "<title>", "<thumbnail URL>"],
115
116 // Participants
117 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
118 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
119
120 // Hashtags
121 ["t", "<tag>"],
122 ["t", "<tag>"],
123
124 // Reference links
125 ["r", "<url>"],
126 ["r", "<url>"]
127 ]
128}
129``` \ No newline at end of file