@norskvideo/norsk-studio-built-ins 1.0.7 → 1.1.0
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.
- package/client/info.js +404 -77
- package/lib/processor.dynamicBug/info.js +2 -1
- package/lib/processor.dynamicBug/info.js.map +1 -1
- package/lib/processor.dynamicBug/runtime.js +13 -11
- package/lib/processor.dynamicBug/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/codec-editor.d.ts +7 -0
- package/lib/processor.fixedLadder/codec-editor.js +29 -0
- package/lib/processor.fixedLadder/codec-editor.js.map +1 -0
- package/lib/processor.fixedLadder/codec-view.d.ts +4 -0
- package/lib/processor.fixedLadder/codec-view.js +8 -0
- package/lib/processor.fixedLadder/codec-view.js.map +1 -0
- package/lib/processor.fixedLadder/info.js +294 -11
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/newFile.d.ts +3 -0
- package/lib/processor.fixedLadder/newFile.js +145 -0
- package/lib/processor.fixedLadder/newFile.js.map +1 -0
- package/lib/processor.fixedLadder/rung-view.d.ts +2 -0
- package/lib/processor.fixedLadder/rung-view.js +8 -0
- package/lib/processor.fixedLadder/rung-view.js.map +1 -0
- package/lib/processor.fixedLadder/runtime.d.ts +25 -3
- package/lib/processor.fixedLadder/runtime.js +23 -144
- package/lib/processor.fixedLadder/runtime.js.map +1 -1
- package/lib/test/fixed-ladder.d.ts +0 -1
- package/lib/test/fixed-ladder.js +0 -98
- package/lib/test/fixed-ladder.js.map +1 -1
- package/package.json +2 -2
- package/shared/style.css +10 -0
@@ -0,0 +1,145 @@
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
30
|
+
const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
|
31
|
+
const info_1 = require("./info");
|
32
|
+
function default_1({ defineComponent, Video }) {
|
33
|
+
const RungView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./rung-view'))));
|
34
|
+
const SoftwareCodecEditor = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./codec-editor'))));
|
35
|
+
return defineComponent({
|
36
|
+
identifier: 'processor.transform.fixedLadder',
|
37
|
+
category: 'processor',
|
38
|
+
name: "Encode Ladder",
|
39
|
+
subscription: {
|
40
|
+
accepts: {
|
41
|
+
type: 'single-stream',
|
42
|
+
media: Video
|
43
|
+
},
|
44
|
+
produces: {
|
45
|
+
possibleMedia: Video,
|
46
|
+
type: "fixed-list",
|
47
|
+
keys: (cfg) => {
|
48
|
+
return cfg.rungs.map((r) => {
|
49
|
+
return {
|
50
|
+
key: r.name,
|
51
|
+
display: r.name,
|
52
|
+
media: Video
|
53
|
+
};
|
54
|
+
});
|
55
|
+
},
|
56
|
+
selector: (selection, metadata) => {
|
57
|
+
return metadata.filter((s) => s.streamKey && selection.includes(s.streamKey?.renditionName))
|
58
|
+
.map((r) => r.streamKey)
|
59
|
+
.filter((r) => !!r);
|
60
|
+
},
|
61
|
+
}
|
62
|
+
},
|
63
|
+
extraValidation: function (ctx) {
|
64
|
+
ctx.requireVideo(1);
|
65
|
+
},
|
66
|
+
display: (desc) => {
|
67
|
+
const result = {};
|
68
|
+
desc.config.rungs.forEach((r, i) => {
|
69
|
+
result[i] = r.name;
|
70
|
+
});
|
71
|
+
return result;
|
72
|
+
},
|
73
|
+
configForm: {
|
74
|
+
global: {
|
75
|
+
hardware: (0, config_1.HardwareSelection)()
|
76
|
+
},
|
77
|
+
form: {
|
78
|
+
rungs: {
|
79
|
+
help: "",
|
80
|
+
hint: {
|
81
|
+
type: 'form-list',
|
82
|
+
envOverride: true,
|
83
|
+
form: {
|
84
|
+
name: {
|
85
|
+
help: "Unique name of the ladder rung (used in outputs)",
|
86
|
+
hint: {
|
87
|
+
type: "text",
|
88
|
+
defaultValue: 'default'
|
89
|
+
}
|
90
|
+
},
|
91
|
+
software: rungEditorForm('software'),
|
92
|
+
quadra: rungEditorForm('quadra'),
|
93
|
+
logan: rungEditorForm('logan'),
|
94
|
+
nvidia: rungEditorForm('nvidia'),
|
95
|
+
ma35d: rungEditorForm('ma35d'),
|
96
|
+
},
|
97
|
+
view: RungView,
|
98
|
+
defaultValue: info_1.rungNames.map((n) => {
|
99
|
+
return {
|
100
|
+
name: n,
|
101
|
+
software: (0, info_1.createSoftwareRung)(n),
|
102
|
+
quadra: (0, info_1.createQuadraRung)(n),
|
103
|
+
nvidia: (0, info_1.createNvidiaRung)(n),
|
104
|
+
ma35d: (0, info_1.createMa35dRung)(n)
|
105
|
+
};
|
106
|
+
})
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}
|
111
|
+
});
|
112
|
+
function rungEditorForm(mode) {
|
113
|
+
return {
|
114
|
+
help: `Settings to use when encoding using ${mode} mode`,
|
115
|
+
hint: {
|
116
|
+
type: 'form-item',
|
117
|
+
form: {
|
118
|
+
width: {
|
119
|
+
help: 'Width in pixels of this rung',
|
120
|
+
hint: {
|
121
|
+
type: 'numeric',
|
122
|
+
defaultValue: 640,
|
123
|
+
}
|
124
|
+
},
|
125
|
+
height: {
|
126
|
+
help: 'Width in pixels of this rung',
|
127
|
+
hint: {
|
128
|
+
type: 'numeric',
|
129
|
+
defaultValue: 640,
|
130
|
+
}
|
131
|
+
},
|
132
|
+
codec: {
|
133
|
+
help: "Codec settings for this rung",
|
134
|
+
hint: {
|
135
|
+
type: 'custom',
|
136
|
+
component: (CodecEditor)
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
};
|
142
|
+
}
|
143
|
+
}
|
144
|
+
exports.default = default_1;
|
145
|
+
//# sourceMappingURL=newFile.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"newFile.js","sourceRoot":"","sources":["../../src/processor.fixedLadder/newFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA0B;AAG1B,uEAA+E;AAC/E,iCAA4G;AAI5G,mBAAwB,EACtB,eAAe,EAAE,KAAK,EACT;IACb,MAAM,QAAQ,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,aAAa,GAAC,CAAC,CAAC;IAC/D,MAAM,mBAAmB,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,kDAAO,gBAAgB,GAAwB,CAAC,CAAC;IACpG,OAAO,eAAe,CAAoB;QACxC,UAAU,EAAE,iCAAiC;QAC7C,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,YAAY,EAAE;YAEZ,OAAO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wBACN,IAAI,EAAE,8BAA8B;wBACpC,IAAI,EAAE;4BACJ,IAAI,EAAE,SAAS;4BACf,YAAY,EAAE,GAAG;yBAClB;qBACF;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,8BAA8B;wBACpC,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,SAAS,EAAE,CAAC,WAAkB,CAAC;yBAChC;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAlHD,4BAkHC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
function default_1(rung) {
|
5
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "", children: rung.name }));
|
6
|
+
}
|
7
|
+
exports.default = default_1;
|
8
|
+
//# sourceMappingURL=rung-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rung-view.js","sourceRoot":"","sources":["../../src/processor.fixedLadder/rung-view.tsx"],"names":[],"mappings":";;;AAEA,mBAAwB,IAA0B;IAChD,OAAO,CAAC,gCAAK,SAAS,EAAC,EAAE,YAAE,IAAI,CAAC,IAAI,GAAQ,CAAC,CAAA;AAC/C,CAAC;AAFD,4BAEC"}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { Norsk } from '@norskvideo/norsk-sdk';
|
1
|
+
import { AmdMA35DH264, AmdMA35DHevc, LoganH264, LoganHevc, Norsk, NvidiaH264, NvidiaHevc, QuadraH264, QuadraHevc, VideoEncodeRung, X264Codec, X265Codec } from '@norskvideo/norsk-sdk';
|
2
2
|
import { OnCreated, ServerComponentDefinition } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
3
|
import { SimpleProcessorWrapper } from "@norskvideo/norsk-studio/lib/extension/base-nodes";
|
4
|
-
import { RungName } from './info';
|
5
4
|
import { HardwareAccelerationType } from '@norskvideo/norsk-studio/lib/shared/config';
|
6
5
|
export type FixedLadderConfig = {
|
7
6
|
__global: {
|
@@ -9,7 +8,30 @@ export type FixedLadderConfig = {
|
|
9
8
|
};
|
10
9
|
id: string;
|
11
10
|
displayName: string;
|
12
|
-
rungs:
|
11
|
+
rungs: LadderRungDefinition[];
|
12
|
+
};
|
13
|
+
export type SoftwareLadderRung = {
|
14
|
+
codec: X264Codec | X265Codec;
|
15
|
+
} & Omit<VideoEncodeRung, "codec" | "name">;
|
16
|
+
export type Ma35dLadderRung = {
|
17
|
+
codec: AmdMA35DH264 | AmdMA35DHevc;
|
18
|
+
} & Omit<VideoEncodeRung, "codec" | "name">;
|
19
|
+
export type LoganLadderRung = {
|
20
|
+
codec: LoganH264 | LoganHevc;
|
21
|
+
} & Omit<VideoEncodeRung, "codec" | "name">;
|
22
|
+
export type NvidiaLadderRung = {
|
23
|
+
codec: NvidiaH264 | NvidiaHevc;
|
24
|
+
} & Omit<VideoEncodeRung, "codec" | "name">;
|
25
|
+
export type QuadraLadderRung = {
|
26
|
+
codec: QuadraH264 | QuadraHevc;
|
27
|
+
} & Omit<VideoEncodeRung, "codec" | "name">;
|
28
|
+
export type LadderRungDefinition = {
|
29
|
+
name: string;
|
30
|
+
software?: SoftwareLadderRung;
|
31
|
+
ma35d?: Ma35dLadderRung;
|
32
|
+
logan?: LoganLadderRung;
|
33
|
+
nvidia?: NvidiaLadderRung;
|
34
|
+
quadra?: QuadraLadderRung;
|
13
35
|
};
|
14
36
|
export default class FixedLadderDefinition implements ServerComponentDefinition<FixedLadderConfig, SimpleProcessorWrapper> {
|
15
37
|
create(norsk: Norsk, cfg: FixedLadderConfig, cb: OnCreated<SimpleProcessorWrapper>): Promise<void>;
|
@@ -1,13 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
|
4
3
|
const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
4
|
+
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
5
5
|
class FixedLadderDefinition {
|
6
6
|
async create(norsk, cfg, cb) {
|
7
7
|
const wrapper = new base_nodes_1.SimpleProcessorWrapper(cfg.id, async () => {
|
8
8
|
return await norsk.processor.transform.videoEncode({
|
9
9
|
id: `${cfg.id}-ladder`,
|
10
|
-
rungs: cfg.rungs
|
10
|
+
rungs: cfg.rungs
|
11
|
+
.map((r) => createRung(r, cfg.__global.hardware))
|
12
|
+
.filter((x) => !!x)
|
11
13
|
});
|
12
14
|
});
|
13
15
|
await wrapper.initialised;
|
@@ -16,150 +18,27 @@ class FixedLadderDefinition {
|
|
16
18
|
}
|
17
19
|
exports.default = FixedLadderDefinition;
|
18
20
|
function createRung(rung, hardware) {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
case 'h264_1280x720':
|
25
|
-
return createRungImpl({ name: rung, threads: 4, bitrate: 2_500 });
|
26
|
-
case 'h264_640x360':
|
27
|
-
return createRungImpl({ name: rung, threads: 2, bitrate: 1_000 });
|
28
|
-
case 'h264_320x180':
|
29
|
-
return createRungImpl({ name: rung, threads: 1, bitrate: 800 });
|
30
|
-
default:
|
31
|
-
return (0, util_1.assertUnreachable)(rung);
|
32
|
-
}
|
33
|
-
case "ma35d":
|
34
|
-
switch (rung) {
|
35
|
-
case 'h264_1920x1080':
|
36
|
-
return createMa35DHevcRungImpl({ name: rung, bitrate: 10_000 });
|
37
|
-
case 'h264_1280x720':
|
38
|
-
return createMa35DH264RungImpl({ name: rung, bitrate: 5_000 });
|
39
|
-
case 'h264_640x360':
|
40
|
-
return createMa35DH264RungImpl({ name: rung, bitrate: 2_000 });
|
41
|
-
case 'h264_320x180':
|
42
|
-
return createMa35DH264RungImpl({ name: rung, bitrate: 1_000 });
|
43
|
-
default:
|
44
|
-
return (0, util_1.assertUnreachable)(rung);
|
45
|
-
}
|
46
|
-
case 'logan':
|
47
|
-
throw new Error("Logan not supported, just for show");
|
48
|
-
case 'nvidia':
|
49
|
-
switch (rung) {
|
50
|
-
case 'h264_1920x1080':
|
51
|
-
return createNvidiaRungImpl({ name: rung, bitrate: 5_000_000 });
|
52
|
-
case 'h264_1280x720':
|
53
|
-
return createNvidiaRungImpl({ name: rung, bitrate: 2_500_000 });
|
54
|
-
case 'h264_640x360':
|
55
|
-
return createNvidiaRungImpl({ name: rung, bitrate: 1_000_000 });
|
56
|
-
case 'h264_320x180':
|
57
|
-
return createNvidiaRungImpl({ name: rung, bitrate: 800_000 });
|
58
|
-
default:
|
59
|
-
return (0, util_1.assertUnreachable)(rung);
|
60
|
-
}
|
61
|
-
case 'quadra':
|
62
|
-
switch (rung) {
|
63
|
-
case 'h264_1920x1080':
|
64
|
-
return createQuadraRungImpl({ name: rung, bitrate: 5_000_000 });
|
65
|
-
case 'h264_1280x720':
|
66
|
-
return createQuadraRungImpl({ name: rung, bitrate: 2_500_000 });
|
67
|
-
case 'h264_640x360':
|
68
|
-
return createQuadraRungImpl({ name: rung, bitrate: 1_000_000 });
|
69
|
-
case 'h264_320x180':
|
70
|
-
return createQuadraRungImpl({ name: rung, bitrate: 800_000 });
|
71
|
-
default:
|
72
|
-
return (0, util_1.assertUnreachable)(rung);
|
73
|
-
}
|
74
|
-
default:
|
75
|
-
return (0, util_1.assertUnreachable)(hardware);
|
21
|
+
if (hardware) {
|
22
|
+
return createHardwareRung(rung, hardware);
|
23
|
+
}
|
24
|
+
else {
|
25
|
+
return createSoftwareRung(rung);
|
76
26
|
}
|
77
27
|
}
|
78
|
-
function
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
}
|
84
|
-
|
85
|
-
const codec = {
|
86
|
-
type: "x264",
|
87
|
-
bitrateMode: { value: bitrate, mode: "abr" },
|
88
|
-
keyFrameIntervalMax: 50,
|
89
|
-
keyFrameIntervalMin: 50,
|
90
|
-
sceneCut: 0,
|
91
|
-
preset: "fast",
|
92
|
-
tune: "zerolatency",
|
93
|
-
threads,
|
94
|
-
bframes: 0,
|
95
|
-
};
|
96
|
-
return {
|
97
|
-
name,
|
98
|
-
width: rungWidth(name),
|
99
|
-
height: rungHeight(name),
|
100
|
-
codec,
|
101
|
-
frameRate: { frames: 25, seconds: 1 },
|
102
|
-
};
|
103
|
-
}
|
104
|
-
function createMa35DHevcRungImpl({ name, bitrate }) {
|
105
|
-
const codec = {
|
106
|
-
type: "amdMA35D-hevc",
|
107
|
-
profile: "main",
|
108
|
-
rateControl: { mode: "cbr", bitrate: bitrate },
|
109
|
-
gopSize: 50,
|
110
|
-
};
|
111
|
-
return {
|
112
|
-
name,
|
113
|
-
width: rungWidth(name),
|
114
|
-
height: rungHeight(name),
|
115
|
-
codec,
|
116
|
-
frameRate: { frames: 25, seconds: 1 },
|
117
|
-
};
|
118
|
-
}
|
119
|
-
function createMa35DH264RungImpl({ name, bitrate }) {
|
120
|
-
const codec = {
|
121
|
-
type: "amdMA35D-h264",
|
122
|
-
profile: "main",
|
123
|
-
rateControl: { mode: "cbr", bitrate: bitrate },
|
124
|
-
gopSize: 50,
|
125
|
-
};
|
126
|
-
return {
|
127
|
-
name,
|
128
|
-
width: rungWidth(name),
|
129
|
-
height: rungHeight(name),
|
130
|
-
codec,
|
131
|
-
frameRate: { frames: 25, seconds: 1 },
|
132
|
-
};
|
133
|
-
}
|
134
|
-
function createQuadraRungImpl({ name, bitrate }) {
|
135
|
-
const codec = {
|
136
|
-
type: "quadra-h264",
|
137
|
-
intraPeriod: 50,
|
138
|
-
bitrate
|
139
|
-
};
|
140
|
-
return {
|
141
|
-
name,
|
142
|
-
width: rungWidth(name),
|
143
|
-
height: rungHeight(name),
|
144
|
-
codec,
|
145
|
-
frameRate: { frames: 25, seconds: 1 },
|
146
|
-
};
|
28
|
+
function createHardwareRung(rung, hardware) {
|
29
|
+
const actualRung = rung[hardware];
|
30
|
+
if (!actualRung) {
|
31
|
+
(0, logging_1.warninglog)("Hardware rung isn't defined, attempting software", { name: rung.name });
|
32
|
+
return createSoftwareRung(rung);
|
33
|
+
}
|
34
|
+
return { name: rung.name, ...actualRung };
|
147
35
|
}
|
148
|
-
function
|
149
|
-
const
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
}
|
156
|
-
};
|
157
|
-
return {
|
158
|
-
name,
|
159
|
-
width: rungWidth(name),
|
160
|
-
height: rungHeight(name),
|
161
|
-
codec,
|
162
|
-
frameRate: { frames: 25, seconds: 1 },
|
163
|
-
};
|
36
|
+
function createSoftwareRung(rung) {
|
37
|
+
const actualRung = rung['software'];
|
38
|
+
if (!actualRung) {
|
39
|
+
(0, logging_1.warninglog)("Software rung isn't defined, ignoring", { name: rung.name });
|
40
|
+
return undefined;
|
41
|
+
}
|
42
|
+
return { name: rung.name, ...actualRung };
|
164
43
|
}
|
165
44
|
//# sourceMappingURL=runtime.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.fixedLadder/runtime.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.fixedLadder/runtime.ts"],"names":[],"mappings":";;AAGA,kFAA2F;AAE3F,yEAAyE;AA0BzE,MAAqB,qBAAqB;IACxC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAsB,EAAE,EAAqC;QACtF,MAAM,OAAO,GAAG,IAAI,mCAAsB,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;YAC5D,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC;gBACjD,EAAE,EAAE,GAAG,GAAG,CAAC,EAAE,SAAS;gBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;qBACb,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;qBAChD,MAAM,CAAC,CAAC,CAA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|
"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
|
-
const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
|
30
|
-
const __1 = require("../");
|
31
|
-
const builder_1 = require("@norskvideo/norsk-studio/lib/test/_util/builder");
|
32
|
-
const document = __importStar(require("@norskvideo/norsk-studio/lib/runtime/document"));
|
33
|
-
const yaml_1 = __importDefault(require("yaml"));
|
34
|
-
const execution_1 = __importDefault(require("@norskvideo/norsk-studio/lib/runtime/execution"));
|
35
|
-
const sources_1 = require("@norskvideo/norsk-studio/lib/test/_util/sources");
|
36
|
-
const sinks_1 = require("@norskvideo/norsk-studio/lib/test/_util/sinks");
|
37
|
-
const info_1 = __importDefault(require("../processor.fixedLadder/info"));
|
38
|
-
const client_types_1 = require("@norskvideo/norsk-studio/lib/extension/client-types");
|
39
|
-
const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
|
40
|
-
async function defaultRuntime() {
|
41
|
-
const runtime = (0, builder_1.emptyRuntime)();
|
42
|
-
await (0, __1.registerAll)(runtime);
|
43
|
-
return runtime;
|
44
|
-
}
|
45
|
-
describe("Fixed Ladder", () => {
|
46
|
-
let norsk = undefined;
|
47
|
-
let result = undefined;
|
48
|
-
async function sharedSetup(rungs) {
|
49
|
-
const runtime = await defaultRuntime();
|
50
|
-
let yaml = new builder_1.YamlBuilder().reify();
|
51
|
-
let compiled = document.load(__filename, runtime, yaml_1.default.stringify(yaml), { resolveConfig: true });
|
52
|
-
yaml = new builder_1.YamlBuilder().addNode(new builder_1.YamlNodeBuilder('ladder', (0, info_1.default)(client_types_1.RegistrationConsts), {
|
53
|
-
rungs
|
54
|
-
}).reify())
|
55
|
-
.reify();
|
56
|
-
compiled = document.load(__filename, runtime, yaml_1.default.stringify(yaml), { resolveConfig: true });
|
57
|
-
norsk = await norsk_sdk_1.Norsk.connect({ onShutdown: () => { } });
|
58
|
-
result = await (0, execution_1.default)(norsk, compiled);
|
59
|
-
const ladder = result.nodes["ladder"];
|
60
|
-
const source = await (0, sources_1.videoAndAudio)(norsk, 'source');
|
61
|
-
ladder.subscribe([new runtime_types_1.StudioNodeSubscriptionSource(source, (0, sources_1.testSourceDescription)(), { type: "take-all-streams", select: client_types_1.Video })]);
|
62
|
-
}
|
63
|
-
afterEach(async () => {
|
64
|
-
await norsk?.close();
|
65
|
-
});
|
66
|
-
describe("Ladder with single rung", () => {
|
67
|
-
before(async () => {
|
68
|
-
await sharedSetup(['h264_640x360']);
|
69
|
-
});
|
70
|
-
it("Outputs a single rung with the right resolution", async () => {
|
71
|
-
if (!norsk)
|
72
|
-
throw "Oh no";
|
73
|
-
await Promise.all([
|
74
|
-
(0, sinks_1.assertNodeOutputsVideoFrames)(norsk, result, "ladder", {
|
75
|
-
resolution: { width: 640, height: 360 }
|
76
|
-
}),
|
77
|
-
]);
|
78
|
-
});
|
79
|
-
});
|
80
|
-
describe("Ladder with multiple rungs", () => {
|
81
|
-
before(async () => {
|
82
|
-
await sharedSetup(['h264_640x360', 'h264_320x180']);
|
83
|
-
});
|
84
|
-
it("Outputs multiple rungs with the right resolution", async () => {
|
85
|
-
if (!norsk)
|
86
|
-
throw "Oh no";
|
87
|
-
await Promise.all([
|
88
|
-
(0, sinks_1.assertNodeOutputsVideoFrames)(norsk, result, "ladder", {
|
89
|
-
match: { renditionName: 'h264_640x360' },
|
90
|
-
resolution: { width: 640, height: 360 }
|
91
|
-
}),
|
92
|
-
(0, sinks_1.assertNodeOutputsVideoFrames)(norsk, result, "ladder", {
|
93
|
-
match: { renditionName: 'h264_320x180' },
|
94
|
-
resolution: { width: 320, height: 180 }
|
95
|
-
}),
|
96
|
-
]);
|
97
|
-
});
|
98
|
-
});
|
99
|
-
});
|
100
2
|
//# sourceMappingURL=fixed-ladder.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fixed-ladder.js","sourceRoot":"","sources":["../../src/test/fixed-ladder.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"fixed-ladder.js","sourceRoot":"","sources":["../../src/test/fixed-ladder.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@norskvideo/norsk-studio-built-ins",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.1.0",
|
4
4
|
"description": "",
|
5
5
|
"scripts": {
|
6
6
|
"clean": "rm -rf lib",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"@aws-sdk/client-mediapackage": "^3.499.0",
|
25
25
|
"@aws-sdk/client-translate": "^3.535.0",
|
26
26
|
"@norskvideo/norsk-sdk": "^1.0.360",
|
27
|
-
"@norskvideo/norsk-studio": "^1.0
|
27
|
+
"@norskvideo/norsk-studio": "^1.2.0",
|
28
28
|
"@norskvideo/webrtc-client": "^0.1.2",
|
29
29
|
"body-parser": "^1.20.2",
|
30
30
|
"cors": "^2.8.5",
|
package/shared/style.css
CHANGED
@@ -1109,6 +1109,11 @@ input[type="range"]::-ms-fill-lower {
|
|
1109
1109
|
height: 100%;
|
1110
1110
|
}
|
1111
1111
|
|
1112
|
+
.min-h-fit {
|
1113
|
+
min-height: -moz-fit-content;
|
1114
|
+
min-height: fit-content;
|
1115
|
+
}
|
1116
|
+
|
1112
1117
|
.w-1\/2 {
|
1113
1118
|
width: 50%;
|
1114
1119
|
}
|
@@ -1572,6 +1577,11 @@ input[type="range"]::-ms-fill-lower {
|
|
1572
1577
|
--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity));
|
1573
1578
|
}
|
1574
1579
|
|
1580
|
+
.dark\:bg-black:is(.dark *) {
|
1581
|
+
--tw-bg-opacity: 1;
|
1582
|
+
background-color: rgb(0 0 0 / var(--tw-bg-opacity));
|
1583
|
+
}
|
1584
|
+
|
1575
1585
|
.dark\:bg-gray-700:is(.dark *) {
|
1576
1586
|
--tw-bg-opacity: 1;
|
1577
1587
|
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|