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:
authorhodlbod <jstaab@protonmail.com>2024-05-20 09:01:52 -0700
committerGitHub <noreply@github.com>2024-05-20 09:01:52 -0700
commit67e870d95a5eb48329f77dc7c8ffc64a2b139019 (patch)
tree071978976895e9a06e58725f2f65d0ba906e3750 /71.md
parentd85c3478137c3a17d7a1bdfce4c3cc9ddf7431e3 (diff)
parentcc6ac4f0b6d1779929dd7346536807699c21d6b2 (diff)
Merge pull request #923 from zmeyer44/patch-1
Create NIP 71 for Video Events
Diffstat (limited to '71.md')
-rw-r--r--71.md120
1 files changed, 120 insertions, 0 deletions
diff --git a/71.md b/71.md
new file mode 100644
index 0000000..3b8efca
--- /dev/null
+++ b/71.md
@@ -0,0 +1,120 @@
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 _parameterized replaceable_ and deletable 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 a parameterized replaceable 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 list of tags are as follows:
24* `d` (required) universally unique identifier (UUID). Generated by the client creating the video event.
25* `url` (required) the url to the video file
26* `m` a string indicating the data type of the file. The [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) format must be used, and they should be lowercase.
27* `title` (required) title of the video
28* `"published_at"`, for the timestamp in unix seconds (stringified) of the first time the video was published
29* `"aes-256-gcm"` (optional) key and nonce for AES-GCM encryption with tagSize always 128bits
30* `x` containing the SHA-256 hexencoded string of the file.
31* `size` (optional) size of file in bytes
32* `dim` (optional) size of file in pixels in the form `<width>x<height>`
33* `duration` (optional) video duration in seconds
34* `magnet` (optional) URI to magnet file
35* `i` (optional) torrent infohash
36* `text-track` (optional, repeated) link to WebVTT file for video, type of supplementary information (captions/subtitles/chapters/metadata), optional language code
37* `thumb` (optional) url of thumbnail with same aspect ratio
38* `image` (optional) url of preview image with same dimensions
39* `content-warning` (optional) warning about content of NSFW video
40* `alt` (optional) description for accessibility
41* `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
42* `t` (optional, repeated) hashtag to categorize video
43* `p` (optional, repeated) 32-bytes hex pubkey of a participant in the video, optional recommended relay URL
44* `r` (optional, repeated) references / links to web pages
45
46```json
47{
48 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
49 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
50 "created_at": <Unix timestamp in seconds>,
51 "kind": 34235 | 34236,
52 "content": "<summary / description of video>",
53 "tags": [
54 ["d", "<UUID>"],
55
56 ["title", "<title of video>"],
57 ["thumb", "<thumbnail image for video>"],
58 ["published_at", "<unix timestamp>"],
59 ["alt", <description>],
60
61 // Video Data
62 ["url",<string with URI of file>],
63 ["m", <MIME type>],
64 ["x",<Hash SHA-256>],
65 ["aes-256-gcm",<key>, <iv>],
66 ["size", <size of file in bytes>],
67 ["duration", <duration of video in seconds>],
68 ["dim", <size of file in pixels>],
69 ["magnet",<magnet URI> ],
70 ["i",<torrent infohash>],
71 ["text-track", "<encoded `kind 6000` event>", "<recommended relay urls>"],
72 ["content-warning", "<reason>"],
73 ["segment", <start>, <end>, "<title>", "<thumbnail URL>"],
74
75 // Participants
76 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
77 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
78
79 // Hashtags
80 ["t", "<tag>"],
81 ["t", "<tag>"],
82
83 // Reference links
84 ["r", "<url>"],
85 ["r", "<url>"]
86 ]
87}
88```
89
90## Video View
91
92A video event view is a response to a video event to track a user's view or progress viewing the video.
93
94### Format
95
96The format uses a parameterized replaceable event kind `34237`.
97
98The `.content` of these events is optional and could be a free-form note that acts like a bookmark for the user.
99
100The list of tags are as follows:
101* `a` (required) reference tag to kind `34235` or `34236` video event being viewed
102* `d` (required) same as `a` reference tag value
103* `viewed` (optional, repeated) timestamp of the user's start time in seconds, timestamp of the user's end time in seconds
104
105
106```json
107{
108 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
109 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
110 "created_at": <Unix timestamp in seconds>,
111 "kind": 34237,
112 "content": "<note>",
113 "tags": [
114 ["a", "<34235 | 34236>:<video event author pubkey>:<d-identifier of video event>", "<optional relay url>"],
115 ["e", "<event-id", "<relay-url>"]
116 ["d", "<34235 | 34236>:<video event author pubkey>:<d-identifier of video event>"],
117 ["viewed", <start>, <end>],
118 ]
119}
120```