@norskvideo/norsk-studio-alpha 1.27.0-2025-07-09-0fcad3ea

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +10 -0
  2. package/client/info.js +43461 -0
  3. package/client/processor.audioLevel/styles.css +165 -0
  4. package/client/shared/style.css +1627 -0
  5. package/client/shared/tailwind.css +31 -0
  6. package/client/style.css +1074 -0
  7. package/lib/index.d.ts +3 -0
  8. package/lib/index.js +14 -0
  9. package/lib/index.js.map +1 -0
  10. package/lib/info.d.ts +3 -0
  11. package/lib/info.js +44 -0
  12. package/lib/info.js.map +1 -0
  13. package/lib/input.decklink/info.d.ts +3 -0
  14. package/lib/input.decklink/info.js +51 -0
  15. package/lib/input.decklink/info.js.map +1 -0
  16. package/lib/input.decklink/runtime.d.ts +12 -0
  17. package/lib/input.decklink/runtime.js +22 -0
  18. package/lib/input.decklink/runtime.js.map +1 -0
  19. package/lib/input.decklink/types.d.ts +23 -0
  20. package/lib/input.decklink/types.js +3 -0
  21. package/lib/input.decklink/types.js.map +1 -0
  22. package/lib/input.decklink/types.yaml +32 -0
  23. package/lib/input.mp4file/info.d.ts +3 -0
  24. package/lib/input.mp4file/info.js +34 -0
  25. package/lib/input.mp4file/info.js.map +1 -0
  26. package/lib/input.mp4file/runtime.d.ts +14 -0
  27. package/lib/input.mp4file/runtime.js +33 -0
  28. package/lib/input.mp4file/runtime.js.map +1 -0
  29. package/lib/input.mp4file/types.d.ts +23 -0
  30. package/lib/input.mp4file/types.js +3 -0
  31. package/lib/input.mp4file/types.js.map +1 -0
  32. package/lib/input.mp4file/types.yaml +30 -0
  33. package/lib/input.ndi/info.d.ts +3 -0
  34. package/lib/input.ndi/info.js +52 -0
  35. package/lib/input.ndi/info.js.map +1 -0
  36. package/lib/input.ndi/runtime.d.ts +24 -0
  37. package/lib/input.ndi/runtime.js +60 -0
  38. package/lib/input.ndi/runtime.js.map +1 -0
  39. package/lib/input.ndi/source-selection.d.ts +10 -0
  40. package/lib/input.ndi/source-selection.js +84 -0
  41. package/lib/input.ndi/source-selection.js.map +1 -0
  42. package/lib/input.ndi/types.d.ts +52 -0
  43. package/lib/input.ndi/types.js +3 -0
  44. package/lib/input.ndi/types.js.map +1 -0
  45. package/lib/input.ndi/types.yaml +37 -0
  46. package/lib/output.ndi/info.d.ts +8 -0
  47. package/lib/output.ndi/info.js +61 -0
  48. package/lib/output.ndi/info.js.map +1 -0
  49. package/lib/output.ndi/inline-view.d.ts +6 -0
  50. package/lib/output.ndi/inline-view.js +12 -0
  51. package/lib/output.ndi/inline-view.js.map +1 -0
  52. package/lib/output.ndi/runtime.d.ts +14 -0
  53. package/lib/output.ndi/runtime.js +35 -0
  54. package/lib/output.ndi/runtime.js.map +1 -0
  55. package/lib/output.ndi/types.d.ts +35 -0
  56. package/lib/output.ndi/types.js +3 -0
  57. package/lib/output.ndi/types.js.map +1 -0
  58. package/lib/output.ndi/types.yaml +72 -0
  59. package/lib/output.recorder/info.d.ts +10 -0
  60. package/lib/output.recorder/info.js +79 -0
  61. package/lib/output.recorder/info.js.map +1 -0
  62. package/lib/output.recorder/runtime.d.ts +66 -0
  63. package/lib/output.recorder/runtime.js +301 -0
  64. package/lib/output.recorder/runtime.js.map +1 -0
  65. package/lib/output.recorder/types.d.ts +225 -0
  66. package/lib/output.recorder/types.js +3 -0
  67. package/lib/output.recorder/types.js.map +1 -0
  68. package/lib/output.recorder/types.yaml +211 -0
  69. package/lib/processor.actionReplay/info.d.ts +25 -0
  70. package/lib/processor.actionReplay/info.js +77 -0
  71. package/lib/processor.actionReplay/info.js.map +1 -0
  72. package/lib/processor.actionReplay/runtime.d.ts +38 -0
  73. package/lib/processor.actionReplay/runtime.js +225 -0
  74. package/lib/processor.actionReplay/runtime.js.map +1 -0
  75. package/lib/processor.actionReplay/summary.d.ts +4 -0
  76. package/lib/processor.actionReplay/summary.js +76 -0
  77. package/lib/processor.actionReplay/summary.js.map +1 -0
  78. package/lib/processor.actionReplay/types.d.ts +38 -0
  79. package/lib/processor.actionReplay/types.js +3 -0
  80. package/lib/processor.actionReplay/types.js.map +1 -0
  81. package/lib/processor.actionReplay/types.yaml +74 -0
  82. package/lib/processor.audioLevel/info.d.ts +27 -0
  83. package/lib/processor.audioLevel/info.js +61 -0
  84. package/lib/processor.audioLevel/info.js.map +1 -0
  85. package/lib/processor.audioLevel/inline-view.d.ts +4 -0
  86. package/lib/processor.audioLevel/inline-view.js +26 -0
  87. package/lib/processor.audioLevel/inline-view.js.map +1 -0
  88. package/lib/processor.audioLevel/runtime.d.ts +26 -0
  89. package/lib/processor.audioLevel/runtime.js +86 -0
  90. package/lib/processor.audioLevel/runtime.js.map +1 -0
  91. package/lib/processor.audioLevel/summary-view.d.ts +7 -0
  92. package/lib/processor.audioLevel/summary-view.js +37 -0
  93. package/lib/processor.audioLevel/summary-view.js.map +1 -0
  94. package/lib/processor.audioLevel/types.d.ts +42 -0
  95. package/lib/processor.audioLevel/types.js +3 -0
  96. package/lib/processor.audioLevel/types.js.map +1 -0
  97. package/lib/processor.audioLevel/types.yaml +83 -0
  98. package/lib/processor.gemini-poc/info.d.ts +8 -0
  99. package/lib/processor.gemini-poc/info.js +59 -0
  100. package/lib/processor.gemini-poc/info.js.map +1 -0
  101. package/lib/processor.gemini-poc/runtime.d.ts +38 -0
  102. package/lib/processor.gemini-poc/runtime.js +132 -0
  103. package/lib/processor.gemini-poc/runtime.js.map +1 -0
  104. package/lib/processor.gemini-poc/types.d.ts +23 -0
  105. package/lib/processor.gemini-poc/types.js +3 -0
  106. package/lib/processor.gemini-poc/types.js.map +1 -0
  107. package/lib/processor.gemini-poc/types.yaml +43 -0
  108. package/lib/processor.mixMinus/info.d.ts +7 -0
  109. package/lib/processor.mixMinus/info.js +40 -0
  110. package/lib/processor.mixMinus/info.js.map +1 -0
  111. package/lib/processor.mixMinus/runtime.d.ts +23 -0
  112. package/lib/processor.mixMinus/runtime.js +85 -0
  113. package/lib/processor.mixMinus/runtime.js.map +1 -0
  114. package/lib/processor.mixMinus/types.d.ts +18 -0
  115. package/lib/processor.mixMinus/types.js +3 -0
  116. package/lib/processor.mixMinus/types.js.map +1 -0
  117. package/lib/processor.mixMinus/types.yaml +19 -0
  118. package/lib/processor.monetise/info.d.ts +3 -0
  119. package/lib/processor.monetise/info.js +72 -0
  120. package/lib/processor.monetise/info.js.map +1 -0
  121. package/lib/processor.monetise/runtime.d.ts +62 -0
  122. package/lib/processor.monetise/runtime.js +217 -0
  123. package/lib/processor.monetise/runtime.js.map +1 -0
  124. package/lib/processor.monetise/summary.d.ts +7 -0
  125. package/lib/processor.monetise/summary.js +40 -0
  126. package/lib/processor.monetise/summary.js.map +1 -0
  127. package/lib/processor.monetise/types.d.ts +16 -0
  128. package/lib/processor.monetise/types.js +3 -0
  129. package/lib/processor.monetise/types.js.map +1 -0
  130. package/lib/processor.monetise/types.yaml +9 -0
  131. package/lib/processor.whisper-transcribe/info.d.ts +9 -0
  132. package/lib/processor.whisper-transcribe/info.js +46 -0
  133. package/lib/processor.whisper-transcribe/info.js.map +1 -0
  134. package/lib/processor.whisper-transcribe/runtime.d.ts +22 -0
  135. package/lib/processor.whisper-transcribe/runtime.js +70 -0
  136. package/lib/processor.whisper-transcribe/runtime.js.map +1 -0
  137. package/lib/processor.whisper-transcribe/types.d.ts +21 -0
  138. package/lib/processor.whisper-transcribe/types.js +3 -0
  139. package/lib/processor.whisper-transcribe/types.js.map +1 -0
  140. package/lib/processor.whisper-transcribe/types.yaml +28 -0
  141. package/lib/shared/schemas.d.ts +8 -0
  142. package/lib/shared/schemas.js +44 -0
  143. package/lib/shared/schemas.js.map +1 -0
  144. package/lib/test/output.recorder.d.ts +1 -0
  145. package/lib/test/output.recorder.js +186 -0
  146. package/lib/test/output.recorder.js.map +1 -0
  147. package/lib/util.timestamps/info.d.ts +14 -0
  148. package/lib/util.timestamps/info.js +64 -0
  149. package/lib/util.timestamps/info.js.map +1 -0
  150. package/lib/util.timestamps/inline-view.d.ts +6 -0
  151. package/lib/util.timestamps/inline-view.js +95 -0
  152. package/lib/util.timestamps/inline-view.js.map +1 -0
  153. package/lib/util.timestamps/runtime.d.ts +13 -0
  154. package/lib/util.timestamps/runtime.js +51 -0
  155. package/lib/util.timestamps/runtime.js.map +1 -0
  156. package/lib/util.timestamps/types.d.ts +36 -0
  157. package/lib/util.timestamps/types.js +3 -0
  158. package/lib/util.timestamps/types.js.map +1 -0
  159. package/lib/util.timestamps/types.yaml +74 -0
  160. package/package.json +57 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const creatable_1 = __importDefault(require("react-select/creatable"));
9
+ function SourceSelection(props) {
10
+ const [loading, setLoading] = (0, react_1.useState)(true);
11
+ const [sourcesD, setSourcesD] = (0, react_1.useState)([]);
12
+ const [options, setOptions] = (0, react_1.useState)([]);
13
+ const [input, setInput] = (0, react_1.useState)(props.defaultValue || { name: "", url: "" });
14
+ const isMounted = (0, react_1.useRef)(true);
15
+ (0, react_1.useEffect)(() => {
16
+ if (props.defaultValue) {
17
+ props.onChanged(props.defaultValue);
18
+ }
19
+ }, [props.defaultValue]);
20
+ (0, react_1.useEffect)(() => {
21
+ const fetchSources = async () => {
22
+ try {
23
+ if (!props.urls?.staticUrl)
24
+ return;
25
+ const result = await fetch(`${props.urls.staticUrl}/sources`);
26
+ if (isMounted.current && result.ok && result.body) {
27
+ const sources = await result.json();
28
+ const studioSources = sources.map((source) => ({ ...source, created: false }));
29
+ if (props.defaultValue !== undefined) {
30
+ if (props.defaultValue !== undefined && sources.find(({ url }) => url == props.defaultValue?.url) === undefined) {
31
+ studioSources.push({ url: props.defaultValue.url, name: props.defaultValue.name, created: true });
32
+ }
33
+ }
34
+ const options = sources.map((o) => ({
35
+ value: o.url,
36
+ label: o.name,
37
+ }));
38
+ setSourcesD(studioSources);
39
+ setOptions(options);
40
+ setLoading(false);
41
+ }
42
+ else {
43
+ const text = await result.text();
44
+ throw new Error(text);
45
+ }
46
+ }
47
+ catch (err) {
48
+ console.error(err);
49
+ }
50
+ };
51
+ fetchSources().catch(console.error);
52
+ const interval = setInterval(() => { fetchSources().catch(console.error); }, 500);
53
+ return () => {
54
+ clearInterval(interval);
55
+ };
56
+ }, [props.defaultValue, props.urls?.staticUrl]);
57
+ const classNames = (0, react_1.useMemo)(() => ({
58
+ control: () => "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded focus:ring-blue-500 focus:border-blue-500 p-1 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
59
+ singleValue: () => "node-edit-select-input",
60
+ option: () => "node-edit-select-input",
61
+ menu: () => "bg-gray-50 dark:bg-gray-700 p-1"
62
+ }), []);
63
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ?
64
+ (0, jsx_runtime_1.jsx)("div", { children: "Loading..." })
65
+ :
66
+ (0, jsx_runtime_1.jsx)(creatable_1.default, { options: options, value: input ? { value: input.url, label: input.name } : null, isClearable: true, onChange: (selected) => {
67
+ if (selected) {
68
+ const source = sourcesD.find(({ url }) => url == selected.value);
69
+ if (source) {
70
+ setInput(source);
71
+ props.onChanged(source);
72
+ }
73
+ }
74
+ }, onCreateOption: (newInput) => {
75
+ const newSource = { name: newInput, url: newInput, created: true };
76
+ const newOption = { label: newInput, value: newInput, created: true };
77
+ setSourcesD((prev) => [...prev, newSource]);
78
+ setOptions((prev) => [...prev, newOption]);
79
+ setInput(newSource);
80
+ props.onChanged(newSource);
81
+ }, placeholder: "Select or type...", classNames: classNames, unstyled: true }) });
82
+ }
83
+ exports.default = SourceSelection;
84
+ //# sourceMappingURL=source-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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ACH,CAAC,EACD,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;wBACnC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wBACnE,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wBACtE,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;wBAC5C,UAAU,CAAC,CAAC,IAAI,EAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;wBAC1C,QAAQ,CAAC,SAAS,CAAC,CAAC;wBACpB,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;oBAC7B,CAAC,EACD,WAAW,EAAC,mBAAmB,EAC/B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,GACd,GAEH,CAAC;AACN,CAAC;AAED,kBAAe,eAAe,CAAC"}
@@ -0,0 +1,52 @@
1
+ export interface paths {
2
+ "/sources": {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ get: {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ requestBody?: never;
17
+ responses: {
18
+ 200: {
19
+ headers: {
20
+ [name: string]: unknown;
21
+ };
22
+ content: {
23
+ "application/json": components["schemas"]["ndiSource"][];
24
+ };
25
+ };
26
+ };
27
+ };
28
+ put?: never;
29
+ post?: never;
30
+ delete?: never;
31
+ options?: never;
32
+ head?: never;
33
+ patch?: never;
34
+ trace?: never;
35
+ };
36
+ }
37
+ export type webhooks = Record<string, never>;
38
+ export interface components {
39
+ schemas: {
40
+ ndiSource: {
41
+ name: string;
42
+ url: string;
43
+ };
44
+ };
45
+ responses: never;
46
+ parameters: never;
47
+ requestBodies: never;
48
+ headers: never;
49
+ pathItems: never;
50
+ }
51
+ export type $defs = Record<string, never>;
52
+ export type operations = Record<string, never>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/input.ndi/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: NDI Ingests
4
+ version: 1.0.0
5
+
6
+ paths:
7
+ # Static paths (available at runtime and design time)
8
+ /sources:
9
+ get:
10
+ summary: Return the currently available NDI sources
11
+ description: Returns all discovered NDI sources
12
+ x-route-type: static
13
+ responses:
14
+ 200:
15
+ description: Successful operation
16
+ content:
17
+ application/json:
18
+ schema:
19
+ type: array
20
+ description: A list of the sources available
21
+ items:
22
+ $ref: "#/components/schemas/ndiSource"
23
+ components:
24
+ schemas:
25
+ ndiSource:
26
+ type: object
27
+ properties:
28
+ name:
29
+ type: string
30
+ description: NDI Name
31
+ url:
32
+ type: string
33
+ description: NDI Url
34
+ required:
35
+ - name
36
+ - url
37
+
@@ -0,0 +1,8 @@
1
+ import type { NdiOutputSettings } from "./runtime";
2
+ import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
3
+ export default function ({ defineComponent, All, validation: { JitterBuffer }, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<NdiOutputSettings, {
4
+ jitterBuffer: import("./types").components["schemas"]["JitterBufferState"];
5
+ }, Record<string, never>, {
6
+ type: "jitter-buffer-updated";
7
+ buffer: import("./types").components["schemas"]["JitterBufferState"];
8
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = default_1;
7
+ const jitter_buffer_inline_1 = require("@norskvideo/norsk-studio-built-ins/lib/shared/jitter-buffer-inline");
8
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
9
+ const inline_view_1 = __importDefault(require("./inline-view"));
10
+ function default_1({ defineComponent, All, validation: { JitterBuffer }, }) {
11
+ return defineComponent({
12
+ identifier: 'output.ndi',
13
+ category: 'output',
14
+ name: "NDI Egest",
15
+ description: "This component outputs a single video and/or audio stream over NDI.",
16
+ subscription: {
17
+ accepts: {
18
+ type: 'dynamic-streams',
19
+ mode: 'any',
20
+ streams: () => All.map((media) => ({ media }))
21
+ },
22
+ },
23
+ runtime: {
24
+ initialState: () => ({
25
+ jitterBuffer: (0, jitter_buffer_inline_1.initialJitterBufferState)()
26
+ }),
27
+ handleEvent(ev, state) {
28
+ const evType = ev.type;
29
+ switch (evType) {
30
+ case 'jitter-buffer-updated':
31
+ state.jitterBuffer = ev.buffer;
32
+ break;
33
+ default:
34
+ (0, util_1.assertUnreachable)(evType);
35
+ }
36
+ return { ...state };
37
+ },
38
+ inline: inline_view_1.default,
39
+ metrics: []
40
+ },
41
+ display: (desc) => {
42
+ return {
43
+ name: desc.config.name,
44
+ groups: desc.config.groups?.toString() ?? 'none',
45
+ bufferDelayMs: desc.config.bufferDelayMs?.toString() ?? 'none'
46
+ };
47
+ },
48
+ configForm: {
49
+ form: {
50
+ name: { help: "The NDI name announced for this output", hint: { type: 'text' } },
51
+ groups: { help: "The NDI groups that this output is a member of", hint: { type: 'text' } },
52
+ bufferDelayMs: { help: "How many milliseconds in the jitter buffer", hint: { type: 'numeric', validation: JitterBuffer, defaultValue: 0.0 } },
53
+ notes: {
54
+ help: "Additional notes about this component",
55
+ hint: { type: 'text', optional: true }
56
+ },
57
+ }
58
+ }
59
+ });
60
+ }
61
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.ndi/info.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,EAAE,QAAQ,EAAE,IAAI,MAAM;aAC/D,CAAA;QACH,CAAC;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;gBAChF,MAAM,EAAE,EAAE,IAAI,EAAE,gDAAgD,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;gBAC1F,aAAa,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE;gBAC7I,KAAK,EAAE;oBACL,IAAI,EAAE,uCAAuC;oBAC7C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;iBACvC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { NdiState } from "./runtime";
3
+ declare function InlineView({ state }: {
4
+ state: NdiState;
5
+ }): React.JSX.Element;
6
+ export default InlineView;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const jitter_buffer_inline_1 = __importDefault(require("@norskvideo/norsk-studio-built-ins/lib/shared/jitter-buffer-inline"));
8
+ function InlineView({ state }) {
9
+ return ((0, jsx_runtime_1.jsx)("div", { className: "srt-output", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(jitter_buffer_inline_1.default, { ...state.jitterBuffer }) }) }));
10
+ }
11
+ exports.default = InlineView;
12
+ //# sourceMappingURL=inline-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/output.ndi/inline-view.tsx"],"names":[],"mappings":";;;;;;AAEA,8HAAoG;AAEpG,SAAS,UAAU,CAAC,EAAE,KAAK,EAAuB;IAChD,OAAO,CACL,gCAAK,SAAS,EAAC,YAAY,YACzB,0CACE,uBAAC,8BAAkB,OAAK,KAAK,CAAC,YAAY,GAAI,GAC1C,GACF,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Norsk, NdiOutputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
2
+ import { OnCreated, ServerComponentDefinition, ServerComponentSchemas, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
+ import { SimpleSinkWrapper } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
4
+ import type { components } from './types';
5
+ export type NdiOutputSettings = components['schemas']['Config'] & Pick<SdkSettings, 'name' | 'groups' | 'bufferDelayMs'>;
6
+ export type NdiState = components['schemas']['State'];
7
+ export type NdiCommand = components['schemas']['Commands'];
8
+ export type NdiEvent = components['schemas']['Events'];
9
+ export type NdiComponent = SimpleSinkWrapper<NdiState, NdiCommand, NdiEvent>;
10
+ export default class NdiOutputDefinition implements ServerComponentDefinition<NdiOutputSettings, NdiComponent, NdiState, NdiCommand, NdiEvent> {
11
+ create(norsk: Norsk, cfg: NdiOutputSettings, cb: OnCreated<NdiComponent>, runtime: StudioRuntime<NdiState, NdiCommand, NdiEvent>): Promise<void>;
12
+ handleMetricsUpdate(c: NdiComponent): Promise<void>;
13
+ schemas(): Promise<ServerComponentSchemas>;
14
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
7
+ const jitter_buffer_inline_1 = require("@norskvideo/norsk-studio-built-ins/lib/shared/jitter-buffer-inline");
8
+ const schemas_1 = require("../shared/schemas");
9
+ const path_1 = __importDefault(require("path"));
10
+ class NdiOutputDefinition {
11
+ async create(norsk, cfg, cb, runtime) {
12
+ const wrapper = new base_nodes_1.SimpleSinkWrapper(cfg.id, async () => {
13
+ return await norsk.output.ndi(cfg);
14
+ }, runtime.updates);
15
+ await wrapper.initialised;
16
+ cb(wrapper);
17
+ }
18
+ async handleMetricsUpdate(c) {
19
+ const latest = c._updates?.latestMetrics();
20
+ if (!latest)
21
+ return;
22
+ c._updates?.raiseEvent({
23
+ type: 'jitter-buffer-updated',
24
+ buffer: (0, jitter_buffer_inline_1.extractJitterBufferFromMetrics)(latest)
25
+ });
26
+ }
27
+ async schemas() {
28
+ return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), {
29
+ config: 'Config',
30
+ state: 'State'
31
+ });
32
+ }
33
+ }
34
+ exports.default = NdiOutputDefinition;
35
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.ndi/runtime.ts"],"names":[],"mappings":";;;;;AAEA,kFAAsF;AACtF,6GAAoH;AACpH,+CAAoD;AACpD,gDAAwB;AAaxB,MAAqB,mBAAmB;IACtC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAsB,EAAE,EAA2B,EAAE,OAAsD;QACpI,MAAM,OAAO,GAAG,IAAI,8BAAiB,CAAiC,GAAG,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;YACvF,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;QACnB,MAAM,OAAO,CAAC,WAAW,CAAC;QAC1B,EAAE,CAAC,OAAO,CAAC,CAAC;IACd,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,CAAe;QACvC,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC3C,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC;YACrB,IAAI,EAAE,uBAAuB;YAC7B,MAAM,EAAE,IAAA,qDAA8B,EAAC,MAAM,CAAC;SAC/C,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAA,yBAAe,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;YACzD,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,sCAwBC"}
@@ -0,0 +1,35 @@
1
+ export type paths = Record<string, never>;
2
+ export type webhooks = Record<string, never>;
3
+ export interface components {
4
+ schemas: {
5
+ Config: {
6
+ id: string;
7
+ displayName: string;
8
+ notes?: string;
9
+ name: string;
10
+ groups?: string[];
11
+ bufferDelayMs?: number;
12
+ };
13
+ State: {
14
+ jitterBuffer: components["schemas"]["JitterBufferState"];
15
+ };
16
+ JitterBufferState: {
17
+ target: number;
18
+ value: number;
19
+ percentage: number;
20
+ };
21
+ Commands: Record<string, never>;
22
+ Events: components["schemas"]["JitterBufferUpdatedEvent"];
23
+ JitterBufferUpdatedEvent: {
24
+ type: "jitter-buffer-updated";
25
+ buffer: components["schemas"]["JitterBufferState"];
26
+ };
27
+ };
28
+ responses: never;
29
+ parameters: never;
30
+ requestBodies: never;
31
+ headers: never;
32
+ pathItems: never;
33
+ }
34
+ export type $defs = Record<string, never>;
35
+ export type operations = Record<string, never>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/output.ndi/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,72 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: NDI Output
4
+ version: 1.0.0
5
+
6
+ paths: {}
7
+
8
+ components:
9
+ schemas:
10
+ Config:
11
+ type: object
12
+ required:
13
+ - id
14
+ - displayName
15
+ - name
16
+ properties:
17
+ id:
18
+ type: string
19
+ displayName:
20
+ type: string
21
+ notes:
22
+ type: string
23
+ name:
24
+ type: string
25
+ groups:
26
+ type: array
27
+ items:
28
+ type: string
29
+ bufferDelayMs:
30
+ type: number
31
+
32
+ State:
33
+ type: object
34
+ required:
35
+ - jitterBuffer
36
+ properties:
37
+ jitterBuffer:
38
+ $ref: '#/components/schemas/JitterBufferState'
39
+
40
+ JitterBufferState:
41
+ type: object
42
+ required:
43
+ - target
44
+ - value
45
+ - percentage
46
+ properties:
47
+ target:
48
+ type: number
49
+ value:
50
+ type: number
51
+ percentage:
52
+ type: number
53
+
54
+ Commands:
55
+ type: object
56
+ additionalProperties: false
57
+
58
+ Events:
59
+ oneOf:
60
+ - $ref: '#/components/schemas/JitterBufferUpdatedEvent'
61
+
62
+ JitterBufferUpdatedEvent:
63
+ type: object
64
+ required:
65
+ - type
66
+ - buffer
67
+ properties:
68
+ type:
69
+ type: string
70
+ enum: ['jitter-buffer-updated']
71
+ buffer:
72
+ $ref: '#/components/schemas/JitterBufferState'
@@ -0,0 +1,10 @@
1
+ import type { RecorderCommand, RecorderEvent, RecorderState } from "./runtime";
2
+ import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
3
+ export default function (R: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
4
+ id: string;
5
+ displayName: string;
6
+ store_path: string;
7
+ cuts_path: string;
8
+ expiry_hours: number;
9
+ pruneIntervalMs?: number | null;
10
+ }, RecorderState, RecorderCommand, RecorderEvent>;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
5
+ function default_1(R) {
6
+ const { defineComponent, } = R;
7
+ return defineComponent({
8
+ identifier: 'output.recorder',
9
+ category: 'output',
10
+ name: "Stream Recorder",
11
+ description: "Record a video and audio stream and provide an API for creating cuts",
12
+ subscription: {
13
+ accepts: {
14
+ type: "simple-stream",
15
+ audio: true,
16
+ video: true
17
+ }
18
+ },
19
+ display: (_desc) => { return {}; },
20
+ runtime: {
21
+ initialState: () => ({
22
+ timeline: [],
23
+ cuts: [],
24
+ }),
25
+ handleEvent: (ev, s) => {
26
+ const evt = ev.type;
27
+ switch (evt) {
28
+ case "timeline-updated":
29
+ s.timeline = ev.timeline;
30
+ break;
31
+ case 'cut-started':
32
+ s.cuts.push({ id: ev.id, percent: 0.0, createdMs: ev.createdMs });
33
+ break;
34
+ case 'cut-progress':
35
+ s.cuts[s.cuts.length - 1] = { id: ev.id, percent: ev.percentage, createdMs: s.cuts[s.cuts.length - 1].createdMs };
36
+ break;
37
+ case 'cut-finished':
38
+ s.cuts[s.cuts.length - 1] = { id: ev.id, percent: 100.0, createdMs: s.cuts[s.cuts.length - 1].createdMs };
39
+ break;
40
+ default:
41
+ (0, util_1.assertUnreachable)(evt);
42
+ }
43
+ while (s.cuts.length > 10) {
44
+ s.cuts.splice(0, 1);
45
+ }
46
+ return { ...s };
47
+ }
48
+ },
49
+ configForm: {
50
+ form: {
51
+ store_path: {
52
+ help: "The path to which recordings will be made",
53
+ hint: {
54
+ type: 'text',
55
+ envOverride: true,
56
+ optional: false,
57
+ }
58
+ },
59
+ cuts_path: {
60
+ help: "The path to which cuts will be made",
61
+ hint: {
62
+ type: 'text',
63
+ envOverride: true,
64
+ optional: false,
65
+ }
66
+ },
67
+ expiry_hours: {
68
+ help: "Expiry time in hours for the store",
69
+ hint: {
70
+ type: "numeric",
71
+ defaultValue: 24,
72
+ envOverride: true,
73
+ }
74
+ }
75
+ }
76
+ }
77
+ });
78
+ }
79
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":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k, StreamKeyOverrideNode } from '@norskvideo/norsk-sdk';
2
+ import { CreatedMediaNode, InstanceRouteArgs, OnCreated, RelatedMediaNodes, RuntimeUpdates, ServerComponentDefinition, StudioComponentInputStream, StudioRuntime, ServerComponentSchemas } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
+ import { components } from './types';
4
+ export type AvailableData = components['schemas']['AvailableData'];
5
+ export type CutStatus = components['schemas']['CutStatus'];
6
+ export type RecorderSettings = components['schemas']['RecorderSettings'];
7
+ export type RecorderState = {
8
+ timeline: AvailableData[];
9
+ cuts: {
10
+ id: number;
11
+ percent: number;
12
+ createdMs: number;
13
+ }[];
14
+ };
15
+ export type RecorderEvent = {
16
+ type: 'timeline-updated';
17
+ timeline: AvailableData[];
18
+ } | {
19
+ type: 'cut-started';
20
+ id: number;
21
+ createdMs: number;
22
+ } | {
23
+ type: 'cut-progress';
24
+ id: number;
25
+ percentage: number;
26
+ } | {
27
+ id: number;
28
+ type: 'cut-finished';
29
+ };
30
+ export type RecorderCommand = {
31
+ type: 'make-cut';
32
+ start: string;
33
+ duration_s: number;
34
+ };
35
+ export default class RecorderDefinition implements ServerComponentDefinition<RecorderSettings, Recorder, RecorderState, RecorderCommand, RecorderEvent> {
36
+ create(norsk: Norsk, cfg: RecorderSettings, cb: OnCreated<Recorder>, runtime: StudioRuntime<RecorderState, RecorderCommand, RecorderEvent>): Promise<void>;
37
+ schemas(): Promise<ServerComponentSchemas>;
38
+ handleCommand(recorder: Recorder, command: RecorderCommand): void;
39
+ instanceRoutes(): Promise<import("@norskvideo/norsk-studio/lib/extension/runtime-types").RouteInfo<InstanceRouteArgs<{
40
+ id: string;
41
+ displayName: string;
42
+ store_path: string;
43
+ cuts_path: string;
44
+ expiry_hours: number;
45
+ pruneIntervalMs?: number | null;
46
+ }, Recorder, RecorderState, RecorderCommand, RecorderEvent>>[]>;
47
+ }
48
+ export declare class Recorder implements CreatedMediaNode {
49
+ initialised: Promise<void>;
50
+ norsk: Norsk;
51
+ updates: RuntimeUpdates<RecorderState, RecorderCommand, RecorderEvent>;
52
+ recorder?: MediaStoreRecorderNode;
53
+ videoKey?: StreamKeyOverrideNode;
54
+ audioKey?: StreamKeyOverrideNode;
55
+ id: string;
56
+ cfg: RecorderSettings;
57
+ cutting: boolean;
58
+ cutIndex: number;
59
+ timer: NodeJS.Timeout;
60
+ constructor(norsk: Norsk, { updates }: StudioRuntime<RecorderState, RecorderCommand, RecorderEvent>, cfg: RecorderSettings);
61
+ pruneCutStore(): Promise<void>;
62
+ relatedMediaNodes: RelatedMediaNodes;
63
+ initialise(): Promise<void>;
64
+ makeCut(start: Date, durationS: number): Promise<void>;
65
+ subscribe(sources: StudioComponentInputStream[]): Promise<void>;
66
+ }