@norskvideo/norsk-studio-built-ins 1.9.0 → 1.10.1

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 (110) hide show
  1. package/client/info.js +4 -4
  2. package/lib/storage.s3/info.d.ts +2 -0
  3. package/lib/storage.s3/info.js +11 -0
  4. package/lib/storage.s3/info.js.map +1 -0
  5. package/lib/storage.s3/storage.d.ts +13 -0
  6. package/lib/storage.s3/storage.js +173 -0
  7. package/lib/storage.s3/storage.js.map +1 -0
  8. package/package.json +8 -3
  9. package/lib/input.mediaconnect/flow-selection.d.ts +0 -9
  10. package/lib/input.mediaconnect/flow-selection.js +0 -40
  11. package/lib/input.mediaconnect/flow-selection.js.map +0 -1
  12. package/lib/input.mediaconnect/info.d.ts +0 -3
  13. package/lib/input.mediaconnect/info.js +0 -70
  14. package/lib/input.mediaconnect/info.js.map +0 -1
  15. package/lib/input.mediaconnect/node-view.d.ts +0 -6
  16. package/lib/input.mediaconnect/node-view.js +0 -38
  17. package/lib/input.mediaconnect/node-view.js.map +0 -1
  18. package/lib/input.mediaconnect/output-selection.d.ts +0 -9
  19. package/lib/input.mediaconnect/output-selection.js +0 -55
  20. package/lib/input.mediaconnect/output-selection.js.map +0 -1
  21. package/lib/input.mediaconnect/runtime.d.ts +0 -23
  22. package/lib/input.mediaconnect/runtime.js +0 -133
  23. package/lib/input.mediaconnect/runtime.js.map +0 -1
  24. package/lib/output.medialive/channel-selection.d.ts +0 -9
  25. package/lib/output.medialive/channel-selection.js +0 -40
  26. package/lib/output.medialive/channel-selection.js.map +0 -1
  27. package/lib/output.medialive/fullscreen.d.ts +0 -6
  28. package/lib/output.medialive/fullscreen.js +0 -31
  29. package/lib/output.medialive/fullscreen.js.map +0 -1
  30. package/lib/output.medialive/info.d.ts +0 -3
  31. package/lib/output.medialive/info.js +0 -111
  32. package/lib/output.medialive/info.js.map +0 -1
  33. package/lib/output.medialive/inline.d.ts +0 -6
  34. package/lib/output.medialive/inline.js +0 -30
  35. package/lib/output.medialive/inline.js.map +0 -1
  36. package/lib/output.medialive/input-selection.d.ts +0 -9
  37. package/lib/output.medialive/input-selection.js +0 -58
  38. package/lib/output.medialive/input-selection.js.map +0 -1
  39. package/lib/output.medialive/node-view.d.ts +0 -6
  40. package/lib/output.medialive/node-view.js +0 -36
  41. package/lib/output.medialive/node-view.js.map +0 -1
  42. package/lib/output.medialive/runtime.d.ts +0 -34
  43. package/lib/output.medialive/runtime.js +0 -142
  44. package/lib/output.medialive/runtime.js.map +0 -1
  45. package/lib/output.medialive/url-selection.d.ts +0 -9
  46. package/lib/output.medialive/url-selection.js +0 -45
  47. package/lib/output.medialive/url-selection.js.map +0 -1
  48. package/lib/processor.actionReplay/info.d.ts +0 -5
  49. package/lib/processor.actionReplay/info.js +0 -100
  50. package/lib/processor.actionReplay/info.js.map +0 -1
  51. package/lib/processor.actionReplay/runtime.d.ts +0 -59
  52. package/lib/processor.actionReplay/runtime.js +0 -224
  53. package/lib/processor.actionReplay/runtime.js.map +0 -1
  54. package/lib/processor.actionReplay/summary.d.ts +0 -7
  55. package/lib/processor.actionReplay/summary.js +0 -76
  56. package/lib/processor.actionReplay/summary.js.map +0 -1
  57. package/lib/processor.audioLevel/info.d.ts +0 -3
  58. package/lib/processor.audioLevel/info.js +0 -83
  59. package/lib/processor.audioLevel/info.js.map +0 -1
  60. package/lib/processor.audioLevel/inline-view.d.ts +0 -6
  61. package/lib/processor.audioLevel/inline-view.js +0 -23
  62. package/lib/processor.audioLevel/inline-view.js.map +0 -1
  63. package/lib/processor.audioLevel/runtime.d.ts +0 -49
  64. package/lib/processor.audioLevel/runtime.js +0 -82
  65. package/lib/processor.audioLevel/runtime.js.map +0 -1
  66. package/lib/processor.audioLevel/summary-view.d.ts +0 -7
  67. package/lib/processor.audioLevel/summary-view.js +0 -36
  68. package/lib/processor.audioLevel/summary-view.js.map +0 -1
  69. package/lib/processor.audioMixer/fullscreen-view.d.ts +0 -8
  70. package/lib/processor.audioMixer/fullscreen-view.js +0 -121
  71. package/lib/processor.audioMixer/fullscreen-view.js.map +0 -1
  72. package/lib/processor.audioMixer/info.d.ts +0 -4
  73. package/lib/processor.audioMixer/info.js +0 -148
  74. package/lib/processor.audioMixer/info.js.map +0 -1
  75. package/lib/processor.audioMixer/inline-view.d.ts +0 -7
  76. package/lib/processor.audioMixer/inline-view.js +0 -43
  77. package/lib/processor.audioMixer/inline-view.js.map +0 -1
  78. package/lib/processor.audioMixer/runtime.d.ts +0 -119
  79. package/lib/processor.audioMixer/runtime.js +0 -142
  80. package/lib/processor.audioMixer/runtime.js.map +0 -1
  81. package/lib/processor.audioMixer/summary-view.d.ts +0 -7
  82. package/lib/processor.audioMixer/summary-view.js +0 -11
  83. package/lib/processor.audioMixer/summary-view.js.map +0 -1
  84. package/lib/processor.aws-transcribe/info.d.ts +0 -3
  85. package/lib/processor.aws-transcribe/info.js +0 -81
  86. package/lib/processor.aws-transcribe/info.js.map +0 -1
  87. package/lib/processor.aws-transcribe/runtime.d.ts +0 -39
  88. package/lib/processor.aws-transcribe/runtime.js +0 -164
  89. package/lib/processor.aws-transcribe/runtime.js.map +0 -1
  90. package/lib/processor.aws-transcribe/transcribe-language-selection.d.ts +0 -9
  91. package/lib/processor.aws-transcribe/transcribe-language-selection.js +0 -40
  92. package/lib/processor.aws-transcribe/transcribe-language-selection.js.map +0 -1
  93. package/lib/processor.aws-transcribe/translate-language-selection.d.ts +0 -9
  94. package/lib/processor.aws-transcribe/translate-language-selection.js +0 -40
  95. package/lib/processor.aws-transcribe/translate-language-selection.js.map +0 -1
  96. package/lib/processor.fixedLadder/newFile.d.ts +0 -3
  97. package/lib/processor.fixedLadder/newFile.js +0 -145
  98. package/lib/processor.fixedLadder/newFile.js.map +0 -1
  99. package/lib/processor.monetise/info.d.ts +0 -3
  100. package/lib/processor.monetise/info.js +0 -90
  101. package/lib/processor.monetise/info.js.map +0 -1
  102. package/lib/processor.monetise/runtime.d.ts +0 -57
  103. package/lib/processor.monetise/runtime.js +0 -141
  104. package/lib/processor.monetise/runtime.js.map +0 -1
  105. package/lib/processor.monetise/summary.d.ts +0 -7
  106. package/lib/processor.monetise/summary.js +0 -39
  107. package/lib/processor.monetise/summary.js.map +0 -1
  108. package/lib/test/audio-mixer.d.ts +0 -0
  109. package/lib/test/audio-mixer.js +0 -2
  110. package/lib/test/audio-mixer.js.map +0 -1
@@ -1,142 +0,0 @@
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.MediaLiveOutput = void 0;
7
- const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
8
- const express_1 = __importDefault(require("express"));
9
- const client_medialive_1 = require("@aws-sdk/client-medialive");
10
- const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
11
- const client_mediapackage_1 = require("@aws-sdk/client-mediapackage");
12
- class MediaConnectSourceDefinition {
13
- async create(norsk, cfg, cb, { updates }) {
14
- const node = await MediaLiveOutput.create(norsk, cfg, updates);
15
- cb(node);
16
- }
17
- routes() {
18
- const router = express_1.default.Router();
19
- router.get("/channels", async (_req, res) => {
20
- let channels = [];
21
- try {
22
- const client = new client_medialive_1.MediaLiveClient({ region: process.env.AWS_REGION ?? "eu-west-2" });
23
- const response = await client.send(new client_medialive_1.ListChannelsCommand({ MaxResults: 100 }));
24
- channels = response.Channels ?? [];
25
- client.destroy();
26
- }
27
- catch (e) {
28
- handleAwsException(e, res);
29
- return;
30
- }
31
- res.writeHead(200);
32
- res.end(JSON.stringify(channels));
33
- });
34
- router.get('/inputs/:id', async (req, res) => {
35
- let input = undefined;
36
- try {
37
- const client = new client_medialive_1.MediaLiveClient({ region: process.env.AWS_REGION ?? "eu-west-2" });
38
- input = await client.send(new client_medialive_1.DescribeInputCommand({ InputId: req.params.id }));
39
- client.destroy();
40
- }
41
- catch (e) {
42
- handleAwsException(e, res);
43
- return;
44
- }
45
- if (!input) {
46
- res.writeHead(404);
47
- res.end("Input not found?");
48
- return;
49
- }
50
- res.writeHead(200);
51
- res.end(JSON.stringify(input));
52
- });
53
- return router;
54
- }
55
- }
56
- exports.default = MediaConnectSourceDefinition;
57
- function handleAwsException(e, res) {
58
- if (e instanceof client_medialive_1.MediaLiveServiceException) {
59
- res.writeHead(e?.$metadata?.httpStatusCode ?? 500);
60
- res.end(JSON.stringify(e));
61
- }
62
- else {
63
- res.writeHead(500);
64
- res.end(JSON.stringify(e));
65
- }
66
- }
67
- class MediaLiveOutput extends base_nodes_1.CustomSinkNode {
68
- norsk;
69
- cfg;
70
- initialised;
71
- updates;
72
- static async create(norsk, cfg, updates) {
73
- const node = new MediaLiveOutput(cfg, norsk, updates);
74
- await node.initialised;
75
- return node;
76
- }
77
- constructor(cfg, norsk, updates) {
78
- super(cfg.id);
79
- this.norsk = norsk;
80
- this.cfg = cfg;
81
- this.initialised = this.initialise();
82
- this.updates = updates;
83
- }
84
- async initialise() {
85
- let input = undefined;
86
- try {
87
- const client = new client_medialive_1.MediaLiveClient({ region: process.env.AWS_REGION ?? "eu-west-2" });
88
- input = await client.send(new client_medialive_1.DescribeInputCommand({ InputId: this.cfg.inputId }));
89
- client.destroy();
90
- }
91
- catch (e) {
92
- console.error("Failed to retrieve input information from AWS, cannot start media node");
93
- return;
94
- }
95
- const url = input?.Destinations?.[this.cfg.destinationIndex];
96
- if (!input || !url) {
97
- console.error("Failed to load channel and input details, cannot start node", this.id, this.cfg);
98
- return;
99
- }
100
- if (!url.Ip) {
101
- console.error("No IP address on input, cannot start", this.id, this.cfg);
102
- return;
103
- }
104
- if (!url.Port) {
105
- console.error("No listener port on flow output, cannot start", this.id, this.cfg);
106
- return;
107
- }
108
- const udp = await this.norsk.output.udpTs({
109
- id: `${this.id}-udpTs`,
110
- destinationIp: url.Ip,
111
- port: parseInt(url.Port, 10),
112
- interface: 'any',
113
- rtpEncapsulate: true,
114
- bufferDelayMs: 5000.0,
115
- avDelayMs: 50.0,
116
- });
117
- this.setup({ sink: udp });
118
- void this.loadOutputInformation();
119
- }
120
- async loadOutputInformation() {
121
- const client = new client_medialive_1.MediaLiveClient({ region: process.env.AWS_REGION ?? "eu-west-2" });
122
- const packageClient = new client_mediapackage_1.MediaPackageClient({ region: process.env.AWS_REGION ?? "eu-west-2" });
123
- const result = await client.send(new client_medialive_1.DescribeChannelCommand({ ChannelId: this.cfg.channelId }));
124
- const mediaPackageChannel = result?.Destinations?.[0]?.MediaPackageSettings?.[0]?.ChannelId;
125
- if (!mediaPackageChannel) {
126
- (0, logging_1.warninglog)("Failed to locate media package for medialive output, no preview is available");
127
- return;
128
- }
129
- const result2 = await packageClient.send(new client_mediapackage_1.ListOriginEndpointsCommand({ ChannelId: mediaPackageChannel }));
130
- const url = result2.OriginEndpoints?.[0]?.Url;
131
- if (!url) {
132
- (0, logging_1.warninglog)("No URL available for media package, no preview is available");
133
- return;
134
- }
135
- this.updates.raiseEvent({ type: 'url-located', url });
136
- }
137
- async close() {
138
- await super.close();
139
- }
140
- }
141
- exports.MediaLiveOutput = MediaLiveOutput;
142
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.medialive/runtime.ts"],"names":[],"mappings":";;;;;;AACA,kFAAmF;AAInF,sDAA4C;AAC5C,gEAAsM;AACtM,yEAAyE;AACzE,sEAA8F;AA6B9F,MAAqB,4BAA4B;IAC/C,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAoB,EAAE,EAA8B,EAAE,EAAE,OAAO,EAAiD;QACzI,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAC/D,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAA;QAC/B,MAAM,CAAC,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OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,gDAA0B,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAC7G,MAAM,GAAG,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAA;QAE7C,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,IAAA,oBAAU,EAAC,6DAA6D,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAA;IACvD,CAAC;IAEQ,KAAK,CAAC,KAAK;QAClB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF;AAvFD,0CAuFC"}
@@ -1,9 +0,0 @@
1
- import type { MediaLiveConfig } from "./runtime";
2
- type UrlSelectionProps = {
3
- defaultValue?: number;
4
- id: string;
5
- onChanged: (value: number) => void;
6
- latest: Partial<MediaLiveConfig>;
7
- };
8
- declare function UrlSelection(props: UrlSelectionProps): import("react/jsx-runtime").JSX.Element;
9
- export default UrlSelection;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- function UrlSelection(props) {
6
- const [loading, setLoading] = (0, react_1.useState)(true);
7
- const [input, setInput] = (0, react_1.useState)(undefined);
8
- (0, react_1.useEffect)(() => {
9
- const fn = async () => {
10
- setLoading(true);
11
- if (props.latest.inputId) {
12
- const result = await fetch('components/output.medialive/inputs/' + props.latest.inputId);
13
- if (result.ok && result.body) {
14
- const flow = await result.json();
15
- setInput(flow);
16
- setLoading(false);
17
- if (props.defaultValue !== undefined)
18
- props.onChanged(props.defaultValue);
19
- }
20
- else {
21
- const text = await result.text();
22
- throw new Error(text);
23
- }
24
- }
25
- };
26
- fn().catch(console.error);
27
- }, [props.latest.inputId]);
28
- if (loading) {
29
- return (0, jsx_runtime_1.jsx)("div", { children: "..." });
30
- }
31
- if (input == undefined) {
32
- return (0, jsx_runtime_1.jsx)("div", { children: "..." });
33
- }
34
- if (!input.Destinations) {
35
- return (0, jsx_runtime_1.jsx)("div", { children: "Input has no destinations" });
36
- }
37
- return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("select", { defaultValue: props.defaultValue, className: `node-editor-select-input`, id: props.id, onChange: myOnChange, onBlur: myOnChange, children: [(0, jsx_runtime_1.jsx)("option", { value: "", children: "---" }, "empty"), input.Destinations.map((o, i) => {
38
- return (0, jsx_runtime_1.jsx)("option", { value: i, children: o.Url }, i);
39
- })] }) });
40
- function myOnChange(e) {
41
- props.onChanged(parseInt(e.target.value, 10));
42
- }
43
- }
44
- exports.default = UrlSelection;
45
- //# sourceMappingURL=url-selection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url-selection.js","sourceRoot":"","sources":["../../src/output.medialive/url-selection.tsx"],"names":[],"mappings":";;;AAAA,iCAAyD;AAYzD,SAAS,YAAY,CAAC,KAAwB;IAC5C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAE7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAyC,SAAS,CAAC,CAAC;IAEtF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,EAAE,GAAG,KAAK,IAAI,EAAE;YACpB,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,qCAAqC,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACxF,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,EA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N,SAAS,UAAU,CAAC,CAAiC;QACnD,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAED,kBAAe,YAAY,CAAC"}
@@ -1,5 +0,0 @@
1
- import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
2
- import type { ActionReplayConfig, ActionReplayState, ActionReplayCommand, ActionReplayEvent } from "./runtime";
3
- export default function ({ defineComponent, assertUnreachable, Av, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<ActionReplayConfig, ActionReplayState, ActionReplayCommand, ActionReplayEvent>;
4
- export declare const hardwareNames: readonly ["quadra", "nvidia"];
5
- export type HardwareName = typeof hardwareNames[number];
@@ -1,100 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.hardwareNames = void 0;
30
- const react_1 = __importDefault(require("react"));
31
- const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
32
- function default_1({ defineComponent, assertUnreachable, Av, }) {
33
- const SummaryView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./summary'))));
34
- return defineComponent({
35
- identifier: 'processor.transform.actionReplay',
36
- category: 'processor',
37
- name: "Action Replay",
38
- subscription: {
39
- accepts: {
40
- type: 'single-stream',
41
- media: Av
42
- },
43
- produces: {
44
- type: 'single-stream',
45
- media: Av
46
- },
47
- },
48
- extraValidation: (ctx) => {
49
- if (ctx.subscriptions.length == 0) {
50
- return;
51
- }
52
- if (ctx.subscriptions.length > 1) {
53
- ctx.addError("Action replay can only subscribe to a single source");
54
- return;
55
- }
56
- if (!ctx.subscriptions[0].streams.select.includes("audio")) {
57
- ctx.addError("Action replay requires audio in the subscription");
58
- }
59
- if (!ctx.subscriptions[0].streams.select.includes("video")) {
60
- ctx.addError("Action replay requires video in the subscription");
61
- }
62
- },
63
- runtime: {
64
- summary: SummaryView,
65
- initialState: () => ({
66
- replaying: false,
67
- contentPlayerUrl: undefined
68
- }),
69
- handleEvent: (ev, state) => {
70
- const evType = ev.type;
71
- switch (evType) {
72
- case "content-player-created":
73
- return { ...state, contentPlayerUrl: ev.url };
74
- case "replay-started":
75
- return { ...state, replaying: true };
76
- case "replay-finished":
77
- return { ...state, replaying: false };
78
- default:
79
- return assertUnreachable(evType);
80
- }
81
- }
82
- },
83
- display: (desc) => {
84
- const { __global: _, ...rem } = desc.config;
85
- return rem;
86
- },
87
- configForm: {
88
- global: {
89
- hardware: (0, config_1.HardwareSelection)()
90
- },
91
- form: {}
92
- }
93
- });
94
- }
95
- exports.default = default_1;
96
- exports.hardwareNames = [
97
- 'quadra',
98
- 'nvidia'
99
- ];
100
- //# sourceMappingURL=info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.actionReplay/info.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AAE,CAAC,CAAC;gBACnB,SAAS,EAAE,KAAK;gBAChB,gBAAgB,EAAE,SAAS;aAC5B,CAAC;YACF,WAAW,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC;gBACvB,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,wBAAwB;wBAC3B,OAAO,EAAE,GAAG,KAAK,EAAE,gBAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAA;oBAC/C,KAAK,gBAAgB;wBACnB,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;oBACtC,KAAK,iBAAiB;wBACpB,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;oBACvC;wBACE,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;SACF;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAA,0BAAiB,GAAE;aAC9B;YACD,IAAI,EAAE,EACL;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAlED,4BAkEC;AAEY,QAAA,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;CACA,CAAA"}
@@ -1,59 +0,0 @@
1
- import { AudioEncodeNode, CmafAudioOutputNode, CmafMultiVariantOutputNode, CmafVideoOutputNode, FrameStorePlayerNode, FrameStoreRecorderNode, Norsk, SourceMediaNode, StreamKey, StreamMetadataOverrideNode, StreamSwitchSmoothNode, SubscriptionError } from '@norskvideo/norsk-sdk';
2
- import { OnCreated, RelatedMediaNodes, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
- import { SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
4
- import { HardwareAccelerationType } from '@norskvideo/norsk-studio/lib/shared/config';
5
- export type ActionReplayConfig = {
6
- id: string;
7
- displayName: string;
8
- __global: {
9
- hardware?: HardwareAccelerationType;
10
- };
11
- };
12
- export type ActionReplayState = {
13
- contentPlayerUrl?: string;
14
- replaying: boolean;
15
- };
16
- export type ActionReplayEvent = {
17
- type: 'content-player-created';
18
- url: string;
19
- } | {
20
- type: 'replay-started';
21
- } | {
22
- type: 'replay-finished';
23
- };
24
- export type ActionReplayCommand = {
25
- type: 'do-replay';
26
- from: number;
27
- duration: number;
28
- };
29
- export default class ActionReplayDefinition implements ServerComponentDefinition<ActionReplayConfig, ActionReplay, ActionReplayState, ActionReplayCommand, ActionReplayEvent> {
30
- create(norsk: Norsk, cfg: ActionReplayConfig, cb: OnCreated<ActionReplay>, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>): Promise<void>;
31
- handleCommand(node: ActionReplay, command: ActionReplayCommand): void;
32
- }
33
- export declare class ActionReplay {
34
- id: string;
35
- norsk: Norsk;
36
- cfg: ActionReplayConfig;
37
- initialised: Promise<void>;
38
- updates: RuntimeUpdates<ActionReplayState, ActionReplayEvent>;
39
- shared: StudioShared;
40
- relatedMediaNodes: RelatedMediaNodes;
41
- smooth?: StreamSwitchSmoothNode<'source' | 'replay'>;
42
- audioEncode?: AudioEncodeNode;
43
- videoEncode?: SourceMediaNode;
44
- audioCmaf?: CmafAudioOutputNode;
45
- videoCmaf?: CmafVideoOutputNode;
46
- mvCmaf?: CmafMultiVariantOutputNode;
47
- writer?: FrameStoreRecorderNode;
48
- reader?: FrameStorePlayerNode;
49
- currentSource?: StudioNodeSubscriptionSource;
50
- passthrough?: StreamMetadataOverrideNode;
51
- audioStreamKey?: StreamKey;
52
- videoStreamKey?: StreamKey;
53
- constructor(norsk: Norsk, cfg: ActionReplayConfig, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>);
54
- initialise(): Promise<void>;
55
- subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts | undefined): void;
56
- replay(from: number, duration: number): Promise<void>;
57
- sourceContextChange(_responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
58
- teardown(): void;
59
- }
@@ -1,224 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionReplay = void 0;
4
- const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
5
- const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
6
- const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
7
- const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
8
- const os_1 = require("os");
9
- const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
10
- class ActionReplayDefinition {
11
- async create(norsk, cfg, cb, runtime) {
12
- const node = new ActionReplay(norsk, cfg, runtime);
13
- await node.initialised;
14
- cb(node);
15
- }
16
- handleCommand(node, command) {
17
- const cmdType = command.type;
18
- switch (cmdType) {
19
- case 'do-replay':
20
- void node.replay(command.from, command.duration);
21
- break;
22
- default:
23
- (0, util_1.assertUnreachable)(cmdType);
24
- }
25
- }
26
- }
27
- exports.default = ActionReplayDefinition;
28
- class ActionReplay {
29
- id;
30
- norsk;
31
- cfg;
32
- initialised;
33
- updates;
34
- shared;
35
- relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
36
- smooth;
37
- audioEncode;
38
- videoEncode;
39
- audioCmaf;
40
- videoCmaf;
41
- mvCmaf;
42
- writer;
43
- reader;
44
- currentSource;
45
- passthrough;
46
- audioStreamKey;
47
- videoStreamKey;
48
- constructor(norsk, cfg, runtime) {
49
- this.id = cfg.id;
50
- this.norsk = norsk;
51
- this.cfg = cfg;
52
- this.updates = runtime.updates;
53
- this.shared = runtime.shared;
54
- this.initialised = this.initialise();
55
- }
56
- async initialise() {
57
- this.passthrough = await this.norsk.processor.transform.streamMetadataOverride({
58
- id: `${this.id}-output`,
59
- });
60
- this.relatedMediaNodes.addOutput(this.passthrough);
61
- }
62
- subscribe(sources, _opts) {
63
- this.currentSource = sources[0];
64
- this.currentSource.registerForContextChange(this);
65
- void this.sourceContextChange(() => { });
66
- }
67
- async replay(from, duration) {
68
- if (this.reader) {
69
- (0, logging_1.debuglog)("Multiple replay attempts started, ignoring", { from, duration });
70
- return;
71
- }
72
- if (!this.smooth || !this.currentSource || !this.currentSource.source.relatedMediaNodes.output) {
73
- (0, logging_1.errorlog)("Attempt to do replay before node is set up???", { from, duration });
74
- return;
75
- }
76
- if (!this.audioStreamKey || !this.videoStreamKey) {
77
- (0, logging_1.errorlog)("Attempt to do replay with no known stream keys", { from, duration });
78
- return;
79
- }
80
- this.updates.raiseEvent({
81
- type: 'replay-started'
82
- });
83
- const smooth = this.smooth;
84
- const currentSource = this.currentSource;
85
- this.reader = await this.norsk.input.frameStore({
86
- id: `${this.id}-reader`,
87
- name: `${this.id}-store`,
88
- streamSelection: [
89
- this.videoStreamKey,
90
- this.audioStreamKey
91
- ],
92
- cuts: [{
93
- durationMs: duration * 1000,
94
- startDateTime: new Date((new Date()).getTime() - (from * 1000))
95
- }],
96
- trimPartialSegments: true,
97
- sourceName: `${this.id}-cut`,
98
- onCreate: (node) => {
99
- smooth.subscribeToPins(currentSource.selectAvToPin("source").concat([
100
- { source: node, sourceSelector: (0, norsk_sdk_1.avToPin)("replay") }
101
- ]));
102
- },
103
- onClose: () => {
104
- this.reader = undefined;
105
- this.updates.raiseEvent({
106
- type: 'replay-finished'
107
- });
108
- smooth.subscribeToPins(currentSource.selectAvToPin("source"));
109
- }
110
- });
111
- }
112
- async sourceContextChange(_responseCallback) {
113
- if (!this.currentSource) {
114
- this.teardown();
115
- return false;
116
- }
117
- const latestStreams = this.currentSource?.latestStreams();
118
- if (latestStreams.length < 2) {
119
- this.teardown();
120
- return false;
121
- }
122
- const video = latestStreams.find((s) => s.metadata.message.case == 'video');
123
- const audio = latestStreams.find((s) => s.metadata.message.case == 'audio');
124
- if (!video || !audio) {
125
- this.teardown();
126
- return false;
127
- }
128
- const videoMetadata = video.metadata.message.value;
129
- const audioMetadata = audio.metadata.message.value;
130
- this.audioStreamKey = audio.metadata.streamKey;
131
- this.videoStreamKey = video.metadata.streamKey;
132
- (0, logging_1.infolog)("Action replay node has a valid context, spinning up some nodes", { videoMetadata, audioMetadata });
133
- this.smooth = await this.norsk.processor.control.streamSwitchSmooth({
134
- id: `${this.id}-switch`,
135
- outputSource: `${this.id}-source`,
136
- outputResolution: { width: videoMetadata.width, height: videoMetadata.height },
137
- frameRate: videoMetadata.frameRate ?? { frames: 25, seconds: 1 },
138
- sampleRate: audioMetadata.sampleRate,
139
- channelLayout: audioMetadata.channelLayout ?? 'stereo',
140
- hardwareAcceleration: (0, config_1.contractHardwareAcceleration)(this.cfg.__global.hardware, ["quadra", "nvidia"]),
141
- activeSource: 'source',
142
- transitionDurationMs: 500.0,
143
- onInboundContextChange: async (ctx) => {
144
- if (ctx.get('replay')?.length == 2) {
145
- this.smooth?.switchSource('replay');
146
- }
147
- else {
148
- this.smooth?.switchSource('source');
149
- }
150
- }
151
- });
152
- this.relatedMediaNodes.addInput(this.smooth);
153
- const dir = (0, os_1.tmpdir)();
154
- this.writer = await this.norsk.output.frameStore({
155
- id: `${this.id}-store`,
156
- name: `${this.id}-store`,
157
- path: dir,
158
- chunkFileDurationSeconds: 60,
159
- });
160
- this.videoEncode = await this.shared.previewEncode(this.currentSource.selectStreams((0, norsk_sdk_1.selectExactKey)(this.videoStreamKey))[0], this.cfg.__global.hardware);
161
- this.audioEncode = await this.norsk.processor.transform.audioEncode({
162
- id: `${this.id}-audio-encode`,
163
- channelLayout: 'stereo',
164
- bitrate: 64000,
165
- outputRenditionName: `${this.id}-preview`,
166
- codec: {
167
- kind: 'aac',
168
- sampleRate: audioMetadata.sampleRate,
169
- profile: 'lc'
170
- }
171
- });
172
- const localDestination = {
173
- id: `${this.id}-local`,
174
- type: 'local',
175
- retentionPeriodSeconds: 360
176
- };
177
- this.audioCmaf = await this.norsk.output.cmafAudio({
178
- id: `${this.id}-cmaf-audio`,
179
- segmentDurationSeconds: 2,
180
- partDurationSeconds: 0.5,
181
- destinations: [localDestination]
182
- });
183
- this.videoCmaf = await this.norsk.output.cmafVideo({
184
- id: `${this.id}-cmaf-video`,
185
- segmentDurationSeconds: 2,
186
- partDurationSeconds: 0.5,
187
- destinations: [localDestination]
188
- });
189
- this.mvCmaf = await this.norsk.output.cmafMultiVariant({
190
- id: `${this.id}-cmaf-mv`,
191
- playlistName: `${this.id}-mv`,
192
- destinations: [localDestination]
193
- });
194
- this.smooth.subscribeToPins(this.currentSource.selectAvToPin("source"), (ctx) => {
195
- if (ctx.streams.length == 2)
196
- return 'accept';
197
- return 'deny';
198
- });
199
- this.audioEncode.subscribe(this.currentSource.selectAudio());
200
- this.audioCmaf.subscribe([
201
- { source: this.audioEncode, sourceSelector: norsk_sdk_1.selectAudio }
202
- ]);
203
- this.videoCmaf.subscribe([
204
- { source: this.videoEncode, sourceSelector: norsk_sdk_1.selectVideo }
205
- ]);
206
- this.mvCmaf.subscribe([
207
- { source: this.audioCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
208
- { source: this.videoCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
209
- ]);
210
- this.updates.raiseEvent({
211
- type: 'content-player-created',
212
- url: this.mvCmaf.url
213
- });
214
- this.passthrough?.subscribe([
215
- { source: this.smooth, sourceSelector: norsk_sdk_1.selectAV }
216
- ]);
217
- this.writer.subscribe(this.currentSource.selectStreams());
218
- return false;
219
- }
220
- teardown() {
221
- }
222
- }
223
- exports.ActionReplay = ActionReplay;
224
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.actionReplay/runtime.ts"],"names":[],"mappings":";;;AAAA,qDAG+B;AAE/B,wFAA0M;AA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c,EAAE,0BAAc,EAAE;SAC3D,CAAC,CAAA;QAEF,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACtB,IAAI,EAAE,wBAAwB;YAC9B,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;SACrB,CAAC,CAAA;QAEF,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;YAC1B,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,oBAAQ,EAAE;SAClD,CAAC,CAAA;QAGF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;QAG1D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ;IAER,CAAC;CACF;AA/PD,oCA+PC"}
@@ -1,7 +0,0 @@
1
- import type { ActionReplayState, ActionReplayConfig, ActionReplayCommand } from "./runtime";
2
- declare function InlineView({ state, config, sendCommand }: {
3
- state: ActionReplayState;
4
- config: ActionReplayConfig;
5
- sendCommand: (cmd: ActionReplayCommand) => void;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export default InlineView;