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:
authorVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:32:46 -0400
committerVitor Pamplona <vitor@vitorpamplona.com>2024-05-30 15:32:46 -0400
commitd5b77b6d7348061cd0f16adc35e4d02a3a0b7380 (patch)
treef00539ec0e0a8b6bf027ff6a9b93846adafa02b3 /71.md
parent48674e563865b1cb7bb3c5c7869d20055446f408 (diff)
parent5c796c19fd6330628a0b328bfcf5270cb2bc3aff (diff)
Merge remote-tracking branch 'upstream/master' into draft-event
# Conflicts: # README.md
Diffstat (limited to '71.md')
-rw-r--r--71.md118
1 files changed, 118 insertions, 0 deletions
diff --git a/71.md b/71.md
new file mode 100644
index 0000000..a811434
--- /dev/null
+++ b/71.md
@@ -0,0 +1,118 @@
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* `x` containing the SHA-256 hexencoded string of the file.
30* `size` (optional) size of file in bytes
31* `dim` (optional) size of file in pixels in the form `<width>x<height>`
32* `duration` (optional) video duration in seconds
33* `magnet` (optional) URI to magnet file
34* `i` (optional) torrent infohash
35* `text-track` (optional, repeated) link to WebVTT file for video, type of supplementary information (captions/subtitles/chapters/metadata), optional language code
36* `thumb` (optional) url of thumbnail with same aspect ratio
37* `image` (optional) url of preview image with same dimensions
38* `content-warning` (optional) warning about content of NSFW video
39* `alt` (optional) description for accessibility
40* `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
41* `t` (optional, repeated) hashtag to categorize video
42* `p` (optional, repeated) 32-bytes hex pubkey of a participant in the video, optional recommended relay URL
43* `r` (optional, repeated) references / links to web pages
44
45```json
46{
47 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
48 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
49 "created_at": <Unix timestamp in seconds>,
50 "kind": 34235 | 34236,
51 "content": "<summary / description of video>",
52 "tags": [
53 ["d", "<UUID>"],
54
55 ["title", "<title of video>"],
56 ["thumb", "<thumbnail image for video>"],
57 ["published_at", "<unix timestamp>"],
58 ["alt", <description>],
59
60 // Video Data
61 ["url",<string with URI of file>],
62 ["m", <MIME type>],
63 ["x",<Hash SHA-256>],
64 ["size", <size of file in bytes>],
65 ["duration", <duration of video in seconds>],
66 ["dim", <size of file in pixels>],
67 ["magnet",<magnet URI> ],
68 ["i",<torrent infohash>],
69 ["text-track", "<encoded `kind 6000` event>", "<recommended relay urls>"],
70 ["content-warning", "<reason>"],
71 ["segment", <start>, <end>, "<title>", "<thumbnail URL>"],
72
73 // Participants
74 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
75 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
76
77 // Hashtags
78 ["t", "<tag>"],
79 ["t", "<tag>"],
80
81 // Reference links
82 ["r", "<url>"],
83 ["r", "<url>"]
84 ]
85}
86```
87
88## Video View
89
90A video event view is a response to a video event to track a user's view or progress viewing the video.
91
92### Format
93
94The format uses a parameterized replaceable event kind `34237`.
95
96The `.content` of these events is optional and could be a free-form note that acts like a bookmark for the user.
97
98The list of tags are as follows:
99* `a` (required) reference tag to kind `34235` or `34236` video event being viewed
100* `d` (required) same as `a` reference tag value
101* `viewed` (optional, repeated) timestamp of the user's start time in seconds, timestamp of the user's end time in seconds
102
103
104```json
105{
106 "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
107 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
108 "created_at": <Unix timestamp in seconds>,
109 "kind": 34237,
110 "content": "<note>",
111 "tags": [
112 ["a", "<34235 | 34236>:<video event author pubkey>:<d-identifier of video event>", "<optional relay url>"],
113 ["e", "<event-id", "<relay-url>"]
114 ["d", "<34235 | 34236>:<video event author pubkey>:<d-identifier of video event>"],
115 ["viewed", <start>, <end>],
116 ]
117}
118```