@norskvideo/norsk-sdk 1.0.349 → 1.0.350

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.
@@ -0,0 +1,4819 @@
1
+ /// <reference types="node" />
2
+
3
+ import { AudioCodec } from '@norskvideo/norsk-api/lib/media_pb';
4
+ import { CmafAudioMessage } from '@norskvideo/norsk-api/lib/media_pb';
5
+ import { CmafMultiVariantMessage } from '@norskvideo/norsk-api/lib/media_pb';
6
+ import { CmafVideoMessage } from '@norskvideo/norsk-api/lib/media_pb';
7
+ import { CmafWebVttMessage } from '@norskvideo/norsk-api/lib/media_pb';
8
+ import { CurrentLoad } from '@norskvideo/norsk-api/lib/shared/common_pb';
9
+ import { ExplicitChannel } from '@norskvideo/norsk-api/lib/media_pb';
10
+ import { FileTsInputMessage } from '@norskvideo/norsk-api/lib/media_pb';
11
+ import { FrameRate as FrameRate_2 } from '@norskvideo/norsk-api/lib/media_pb';
12
+ import { GopStructure } from '@norskvideo/norsk-api/lib/media_pb';
13
+ import * as grpc from '@grpc/grpc-js';
14
+ import { HlsOutputEvent } from '@norskvideo/norsk-api/lib/media_pb';
15
+ import { HlsTsAudioMessage } from '@norskvideo/norsk-api/lib/media_pb';
16
+ import { HlsTsCombinedPushMessage } from '@norskvideo/norsk-api/lib/media_pb';
17
+ import { HlsTsMultiVariantMessage } from '@norskvideo/norsk-api/lib/media_pb';
18
+ import { HlsTsVideoMessage } from '@norskvideo/norsk-api/lib/media_pb';
19
+ import { MediaClient } from '@norskvideo/norsk-api/lib/media_grpc_pb';
20
+ import { Nullable } from 'typescript-nullable';
21
+ import { PlainMessage } from '@bufbuild/protobuf';
22
+ import { Readable } from 'stream';
23
+ import { RtmpError_UnsupportedAudio } from '@norskvideo/norsk-api/lib/media_pb';
24
+ import { RtmpError_UnsupportedVideo } from '@norskvideo/norsk-api/lib/media_pb';
25
+ import { Scte35SpliceInfoSection as Scte35SpliceInfoSection_2 } from '@norskvideo/norsk-api/lib/media_pb';
26
+ import { StreamKey as StreamKey_2 } from '@norskvideo/norsk-api/lib/media_pb';
27
+ import { StreamStatisticsSampling } from '@norskvideo/norsk-api/lib/media_pb';
28
+ import { Subscription } from '@norskvideo/norsk-api/lib/media_pb';
29
+ import { TimestampProgramNudge } from '@norskvideo/norsk-api/lib/media_pb';
30
+ import { TsInputEvent } from '@norskvideo/norsk-api/lib/media_pb';
31
+ import { UdpTsInputMessage } from '@norskvideo/norsk-api/lib/media_pb';
32
+ import { VancPayloadFormat as VancPayloadFormat_2 } from '@norskvideo/norsk-api/lib/media_pb';
33
+ import { Version } from '@norskvideo/norsk-api/lib/shared/common_pb';
34
+ import { Wave } from '@norskvideo/norsk-api/lib/media_pb';
35
+ import { Writable } from 'stream';
36
+
37
+ /** @public */
38
+ export declare type AacProfile = "lc" | "main" | "high";
39
+
40
+ /**
41
+ * @public
42
+ * Settings for an AAC encode
43
+ * see: {@link NorskTransform.audioEncode}
44
+ */
45
+ export declare interface AacSettings {
46
+ kind: "aac";
47
+ /** The output sample rate of this AAC encode */
48
+ sampleRate: SampleRate;
49
+ /** The AAC profile of this AAC encode */
50
+ profile: AacProfile;
51
+ }
52
+
53
+ /** @public */
54
+ export declare interface AdMarker {
55
+ id: string;
56
+ startDate: Date;
57
+ durationSeconds: number;
58
+ scte35: Scte35SpliceInfoSection;
59
+ }
60
+
61
+ export declare class AncillaryNode extends AutoProcessorMediaNode<"ancillary"> {
62
+ sendScte35(key: StreamKey, info: Scte35SpliceInfoSection_2): void;
63
+ }
64
+
65
+ export declare interface AncillarySettings extends ProcessorNodeSettings<AncillaryNode> {
66
+ onScte35?: (stream: StreamKey, message: Scte35SpliceInfoSection_2) => void;
67
+ onSmpte2038?: (stream: StreamKey, message: Smpte2038Message) => void;
68
+ }
69
+
70
+ /**
71
+ * @public
72
+ * Returns the stream keys for ancillary streams in a media context
73
+ * @param streams - The media context from which to return the stream keys
74
+ * @returns The ancillary stream keys in the media context
75
+ */
76
+ export declare function ancillaryStreamKeys(streams: readonly StreamMetadata[]): StreamKey[];
77
+
78
+ /** @public */
79
+ export declare interface AncillaryStreamMetadata {
80
+ }
81
+
82
+ /**
83
+ * @public
84
+ * Filters a context to only the ancillary streams within it
85
+ * @param streams - The media context from which to return the streams
86
+ * @returns The ancillary streams in the media context
87
+ */
88
+ export declare function ancillaryStreams(streams: readonly StreamMetadata[]): StreamMetadata[];
89
+
90
+ /**
91
+ * @public
92
+ * see: {@link NorskTransform.audioBuildMultichannel}
93
+ */
94
+ export declare class AudioBuildMultichannelNode extends AutoProcessorMediaNode<"audio"> {
95
+ }
96
+
97
+ /**
98
+ * @public
99
+ * Settings for an Audio Build Multichannel Node
100
+ * see: {@link NorskTransform.audioBuildMultichannel}
101
+ * */
102
+ export declare interface AudioBuildMultichannelSettings extends ProcessorNodeSettings<AudioBuildMultichannelNode> {
103
+ /** The channel layout of the built outgoing stream */
104
+ channelLayout: ChannelLayout;
105
+ /**
106
+ * Stream keys specifying the source for each channel, where the order is
107
+ * significant. The streams must all have the same sample format and sample
108
+ * rate.
109
+ */
110
+ channelList: readonly StreamKey[];
111
+ /**
112
+ * Callback invoked when the inbound context changes
113
+ * a new channel list can be returned here that overrides the initial configuration
114
+ * and allows the channel order to be changed at runtime
115
+ */
116
+ onInputChanged?: (keys: StreamKey[]) => StreamKey[] | undefined;
117
+ /** The stream key to use for the outoging stream*/
118
+ outputStreamKey: StreamKey;
119
+ }
120
+
121
+ export { AudioCodec }
122
+
123
+ /**
124
+ * @public
125
+ * see: {@link NorskTransform.audioEncode}
126
+ */
127
+ export declare class AudioEncodeNode extends AutoProcessorMediaNode<"audio"> {
128
+ }
129
+
130
+ /**
131
+ * @public
132
+ * Settings for an audio encode
133
+ * see: {@link NorskTransform.audioEncode}
134
+ * */
135
+ export declare interface AudioEncodeSettings extends ProcessorNodeSettings<AudioEncodeNode> {
136
+ /**
137
+ * The channel layout of this encode
138
+ * Note: If the channel layout doesn't match then it will be automatically converted
139
+ * to gain greater control over this process, see {@link NorskTransform.audioMix} and {@link NorskTransform.audioMixMatrix}
140
+ * */
141
+ channelLayout: ChannelLayout;
142
+ /** The target bitrate of this encode */
143
+ bitrate: number;
144
+ /** The name given to the rendition portion of the stream key assigned to this node's output */
145
+ outputRenditionName: string;
146
+ /** What codec to (re) encode the audio to */
147
+ codec: OpusSettings | AacSettings;
148
+ }
149
+
150
+ /**
151
+ * @public
152
+ * see: {@link NorskTransform.audioGain}
153
+ */
154
+ export declare class AudioGainNode extends AutoProcessorMediaNode<"audio"> {
155
+ /**
156
+ * @public
157
+ * Updates the config of this AudioGain node for all subsequent frames
158
+ * this allows the user to change the gains in the outgoing stream
159
+ * dynamically as the stream progresses
160
+ * @param settings - The updated settings
161
+ */
162
+ updateConfig(settings: AudioGainSettingsUpdate): void;
163
+ }
164
+
165
+ /**
166
+ * @public
167
+ * Settings for an Audio Gain node
168
+ * see: {@link NorskTransform.audioGain}
169
+ * */
170
+ export declare interface AudioGainSettings extends ProcessorNodeSettings<AudioGainNode> {
171
+ /** A vector of gains for this source, one for each channel */
172
+ channelGains: readonly Gain[];
173
+ }
174
+
175
+ /**
176
+ * @public
177
+ * An update operation for an Audio Gain node
178
+ * see: {@link AudioGainNode.updateConfig}
179
+ * */
180
+ export declare interface AudioGainSettingsUpdate {
181
+ /** A vector of gains for this source, one for each channel */
182
+ channelGains?: readonly Gain[];
183
+ }
184
+
185
+ /** @public */
186
+ export declare interface AudioMeasureLevels {
187
+ stream: StreamKey;
188
+ pts: Interval;
189
+ channelLevels: ChannelLevels[];
190
+ }
191
+
192
+ /**
193
+ * @public
194
+ * see: {@link NorskControl.audioMeasureLevels}.
195
+ */
196
+ export declare class AudioMeasureLevelsNode extends AutoProcessorMediaNode<"audio"> {
197
+ }
198
+
199
+ /**
200
+ * @public
201
+ * Settings for an AudioMeasureLevelsNode
202
+ * see: {@link NorskControl.audioMeasureLevels}
203
+ */
204
+ export declare interface AudioMeasureLevelsSettings extends ProcessorNodeSettings<AudioMeasureLevelsNode> {
205
+ /**
206
+ * Called with the audio level data
207
+ * @param levels - The level data for the audio stream
208
+ * @eventProperty
209
+ */
210
+ onData: (levels: AudioMeasureLevels) => void;
211
+ intervalFrames?: number;
212
+ }
213
+
214
+ /**
215
+ * @public
216
+ * see: {@link NorskTransform.audioMixMatrix}
217
+ */
218
+ export declare class AudioMixMatrixNode extends AutoProcessorMediaNode<"audio"> {
219
+ /**
220
+ * @public
221
+ * Updates the config of this AudioMixMatrix node for all subsequent frames
222
+ * this allows the user to change the gains in the outgoing mix
223
+ * dynamically as the stream progresses
224
+ * @param settings - The updated settings
225
+ */
226
+ updateConfig(settings: AudioMixMatrixSettingsUpdate): void;
227
+ }
228
+
229
+ /**
230
+ * @public
231
+ * Settings for the Audio Mix Matrix Node
232
+ * see: {@link NorskTransform.audioMixMatrix}
233
+ * */
234
+ export declare interface AudioMixMatrixSettings extends ProcessorNodeSettings<AudioMixMatrixNode> {
235
+ /** The NxM matrix of gains from N input channels to M output channels */
236
+ channelGains: readonly Gain[][];
237
+ /** The desired output channel layout, such as "5.1" */
238
+ outputChannelLayout: ChannelLayout;
239
+ }
240
+
241
+ /**
242
+ * @public
243
+ * Config update for the {@link AudioMixMatrixNode}.
244
+ * Call {@link AudioMixMatrixNode.updateConfig} for updating the config.
245
+ */
246
+ export declare interface AudioMixMatrixSettingsUpdate {
247
+ /** The NxM updated matrix of gains from N input channels to M output channels */
248
+ channelGains: readonly Gain[][];
249
+ }
250
+
251
+ /**
252
+ * @public
253
+ * see: {@link NorskTransform.audioMix}
254
+ */
255
+ export declare class AudioMixNode<Pins extends string> extends ProcessorMediaNode<Pins> {
256
+ /**
257
+ * @public
258
+ * Updates the config of this AudioMix for all subsequent frames
259
+ * this allows the user to change the levels and sources in the outgoing mix
260
+ * dynamically as the stream progresses
261
+ * @param settings - The updated settings
262
+ */
263
+ updateConfig(settings: AudioMixSettingsUpdate<Pins>): void;
264
+ }
265
+
266
+ /**
267
+ * @public
268
+ * The settings for an AudioMix operation
269
+ * see: {@link NorskTransform.audioMix}
270
+ * */
271
+ export declare interface AudioMixSettings<Pins extends string> extends ProcessorNodeSettings<AudioMixNode<Pins>> {
272
+ /** The audio sources to mix */
273
+ sources: readonly AudioMixSource<Pins>[];
274
+ /** The source name to use for the output stream */
275
+ outputSource: string;
276
+ /** The channel layout that the mixer runs at
277
+ * all audio streams will be normalised to this value and therefore
278
+ * this will be the output channel layout of this node */
279
+ channelLayout: ChannelLayout;
280
+ /** The sample rate that the mixer runs at
281
+ * all audio streams will be normalised to this value and therefore
282
+ * this will be the output sample rate of this node */
283
+ sampleRate?: SampleRate;
284
+ }
285
+
286
+ /**
287
+ * @public
288
+ * An update operation for an AudioMix node
289
+ * see: {@link AudioMixNode.updateConfig}
290
+ * */
291
+ export declare interface AudioMixSettingsUpdate<Pins extends string> {
292
+ /** The audio sources to mix along with their potentially new gain values */
293
+ sources: readonly AudioMixSource<Pins>[];
294
+ }
295
+
296
+ /**
297
+ * @public
298
+ * The settings for a single source within an AudioMix operation
299
+ * see: {@link NorskTransform.audioMix}
300
+ * */
301
+ export declare interface AudioMixSource<Pins> {
302
+ /** The name of the InputPin for this source */
303
+ pin: Pins;
304
+ /** A vector of gains for this source, one for each channel */
305
+ channelGains?: readonly Gain[];
306
+ }
307
+
308
+ /**
309
+ * @public
310
+ * see: {@link NorskInput.audioSignal}
311
+ */
312
+ export declare class AudioSignalGeneratorNode extends SourceMediaNode {
313
+ }
314
+
315
+ /**
316
+ * @public
317
+ * Settings for an Audio Signal Generator
318
+ * see: {@link NorskInput.audioSignal}
319
+ * */
320
+ export declare interface AudioSignalGeneratorSettings extends SourceNodeSettings<AudioSignalGeneratorNode> {
321
+ /** The source name to set in the stream key of the outgoing stream */
322
+ sourceName: string;
323
+ /** The audio channel layout of the generated stream */
324
+ channelLayout: ChannelLayout;
325
+ /** The sample rate of the generated stream */
326
+ sampleRate: SampleRate;
327
+ /** The sample format to use. Default: "fltp" */
328
+ sampleFormat?: SampleFormat;
329
+ /**
330
+ * Waveform - create one with {@link mkSine}
331
+ * */
332
+ wave?: Wave;
333
+ }
334
+
335
+ /**
336
+ * @public
337
+ * see: {@link NorskTransform.audioSplitMultichannel}
338
+ */
339
+ export declare class AudioSplitMultichannelNode extends AutoProcessorMediaNode<"audio"> {
340
+ }
341
+
342
+ /**
343
+ * @public
344
+ * Settings for an Audio Split Multichannel node
345
+ * see: {@link NorskTransform.audioSplitMultichannel}
346
+ * */
347
+ export declare interface AudioSplitMultichannelSettings extends ProcessorNodeSettings<AudioSplitMultichannelNode> {
348
+ /**
349
+ * The output stream key of the first channel
350
+ * subsequent channels will have streamId incremented by N
351
+ */
352
+ outputStreamKey: StreamKey;
353
+ }
354
+
355
+ /**
356
+ * @public
357
+ * Returns the stream keys for audio streams in a media context
358
+ * @param streams - The media context from which to return the stream keys
359
+ * @returns The audio stream keys in the media context
360
+ */
361
+ export declare function audioStreamKeys(streams: readonly StreamMetadata[]): StreamKey[];
362
+
363
+ /** @public */
364
+ export declare interface AudioStreamMetadata {
365
+ codec: AudioCodec;
366
+ sampleRate: SampleRate;
367
+ channelLayout?: ChannelLayout;
368
+ }
369
+
370
+ /**
371
+ * @public
372
+ * Filters a context to only the audio streams within it
373
+ * @param streams - The media context from which to return the streams
374
+ * @returns The audio streams in the media context
375
+ */
376
+ export declare function audioStreams(streams: readonly StreamMetadata[]): StreamMetadata[];
377
+
378
+ /** @public */
379
+ export declare function audioToPin<Pins extends string>(pin: Pins): (streams: StreamMetadata[]) => PinToKey<Pins>;
380
+
381
+ /**
382
+ * @public
383
+ * see: {@link NorskTransform.audioTranscribeAws}
384
+ */
385
+ export declare class AudioTranscribeAwsNode extends AutoProcessorMediaNode<"audio"> {
386
+ }
387
+
388
+ /**
389
+ * @public
390
+ * Settings for an Audio Transcribe operation using AWS
391
+ * see: {@link NorskTransform.audioTranscribeAws}
392
+ * */
393
+ export declare interface AudioTranscribeAwsSettings extends ProcessorNodeSettings<AudioTranscribeAwsNode> {
394
+ /** Region for the transcribe endpoint */
395
+ awsRegion: string;
396
+ /** the stream id to allocate to the outgoing stream*/
397
+ outputStreamId: number;
398
+ /** the language that we want to transcribe (also put in the outgoing metadata) */
399
+ language: string;
400
+ /** The mode to be used for building sentences */
401
+ sentenceBuildMode: SentenceBuildMode;
402
+ /** The mode to be used for stabilising sentences */
403
+ sentenceStabilizationMode: StabilizationMode;
404
+ /** The AWS credentials to use for this operation
405
+ * If not supplied, the standard environment variables will be used if present
406
+ * */
407
+ awsCredentials?: AwsCredentials;
408
+ }
409
+
410
+ /**
411
+ * @public
412
+ * see: {@link NorskTransform.audioTranscribeAws}
413
+ */
414
+ export declare class AudioTranscribeAzureNode extends AutoProcessorMediaNode<"audio"> {
415
+ }
416
+
417
+ /**
418
+ * @public
419
+ * Settings for an audio transcribe/translate operation using Azure Speech Service
420
+ * see: {@link NorskTransform.audioTranscribeAzure}
421
+ * */
422
+ export declare interface AudioTranscribeAzureSettings extends ProcessorNodeSettings<AudioTranscribeAzureNode> {
423
+ outputStreamId: number;
424
+ sourceLanguage: string;
425
+ targetLanguages?: string[];
426
+ /** Key for the Azure Speech Service endpoint */
427
+ azureKey: string;
428
+ /** Region for the Azure Speech Service endpoint */
429
+ azureRegion: string;
430
+ maximumLineLength: undefined | number;
431
+ }
432
+
433
+ /**
434
+ * @public
435
+ * see: {@link NorskTransform.audioTranscribeAws}
436
+ */
437
+ export declare class AudioTranscribeWhisperNode extends AutoProcessorMediaNode<"audio"> {
438
+ }
439
+
440
+ /**
441
+ * @public
442
+ * Settings for an Audio Transcribe operation using Whisper sdk
443
+ * see: {@link NorskTransform.audioTranscribeWhisper}
444
+ * */
445
+ export declare interface AudioTranscribeWhisperSettings extends ProcessorNodeSettings<AudioTranscribeWhisperNode> {
446
+ outputStreamId: number;
447
+ stepMs?: number;
448
+ lengthMs?: number;
449
+ keepMs?: number;
450
+ maxTokens?: number;
451
+ speedUp?: boolean;
452
+ noFallback?: boolean;
453
+ numThreads?: number;
454
+ useGpu?: boolean;
455
+ language: string;
456
+ model: string;
457
+ }
458
+
459
+ export declare interface AutoProcessorMediaNode<Pins extends string> extends SourceMediaNode, AutoSinkMediaNode<Pins> {
460
+ }
461
+
462
+ export declare class AutoProcessorMediaNode<Pins extends string> {
463
+ constructor(client: MediaClient, _unregisterNode: (node: MediaNodeState) => void, getGrpcStream: () => (Readable | Writable), subscribeFn: (subscription: Subscription) => Promise<boolean>, subscribeErrorFn?: (error: SubscriptionError) => void, subscribedStreamsChangedFn?: (streams: StreamMetadata[]) => void);
464
+ }
465
+
466
+ /** @public */
467
+ export declare class AutoSinkMediaNode<Pins extends string> extends SinkMediaNode<Pins | "auto"> {
468
+ /** Subscribe to the given sources.
469
+ *
470
+ * This version of subscribe simply requires a list of stream keys to be
471
+ * returned from each selector, and the server will automatically
472
+ * assign each stream to the appropriate pin on the sink node.
473
+ * This is the appropriate method for most cases.
474
+ *
475
+ * @param done - will be called with no arguments if the subscription succeeds,
476
+ * or an error if it failed. This error indicates the specific reason it
477
+ * failed, so you can take appropriate actions in response. It will be called
478
+ * before the `subscribedStreamsChangedFn` or `subscribeErrorFn` callbacks
479
+ * provided in the config for the node.
480
+ *
481
+ * Errors are also logged to the debug log.
482
+ */
483
+ subscribe(sources: ReceiveFromAddressAuto[], validation?: (context: Context) => SubscriptionValidationResponse, done?: (error?: SubscriptionError) => void): void;
484
+ }
485
+
486
+ /** @public */
487
+ export declare function avToPin<Pins extends string>(pin: Pins): (streams: StreamMetadata[]) => PinToKey<Pins>;
488
+
489
+ /** @public */
490
+ export declare interface AwsCredentials {
491
+ accessKey: string;
492
+ secretKey: string;
493
+ sessionToken: string;
494
+ }
495
+
496
+ /**
497
+ * @public
498
+ * Configuration for pushing a segmented media stream directly to AWS S3
499
+ * */
500
+ export declare interface AwsS3PushDestinationSettings {
501
+ type: "s3";
502
+ /** The hostname of the s3 server being pushed to. */
503
+ host: string;
504
+ /** the port of the s3 server being pushed to. */
505
+ port: number;
506
+ /** the path under which segments and playlists will be pushed to */
507
+ pathPrefix: string;
508
+ /**
509
+ * Optionally supply a string that will be inserted into the path structure for segments published in this stream
510
+ *
511
+ * This is useful for stream restarts or republishing when duplicate segment IDs would be generated causing problems with
512
+ * cacheing directives
513
+ */
514
+ sessionId?: string;
515
+ /**
516
+ * A unique identifier for this destination
517
+ *
518
+ * This can be used for supplying updates to configuration to this destination specifically
519
+ * see: {@link UpdateCredentials}
520
+ */
521
+ id: DestinationId;
522
+ /**
523
+ * The AWS region being pushed to
524
+ */
525
+ awsRegion: string;
526
+ /**
527
+ * AWS credentials to be used for connecting to S3
528
+ * Standard environment variables will be read if these are not provided
529
+ */
530
+ awsCredentials?: AwsCredentials;
531
+ /**
532
+ * Informs the playlist generation how long segments will be retained for on the remote server
533
+ * in order to generate an accurate playlist
534
+ */
535
+ retentionPeriodSeconds: number;
536
+ }
537
+
538
+ /**
539
+ * @public
540
+ * There are three possible modes:
541
+ *
542
+ * - "abr": encode in average bitrate mode, specified in kilobits/sec (note, 1
543
+ * kilobit is 1000 bits). You can make use of the vbv settings to control
544
+ * the bounds on how much the actual bitrate can fluctuate within the bounds
545
+ * of the average
546
+ *
547
+ * - "cqp": encode in constant quantizer mode. In general, crf will give better
548
+ * results, although cqp can be faster to encode
549
+ *
550
+ * - "crf": encode in constant rate factor mode. This will give a constant 'quality'
551
+ * to the encode, but with a variable bitrate
552
+ */
553
+ export declare interface BitrateMode {
554
+ value: number;
555
+ mode: "abr" | "cqp" | "crf";
556
+ }
557
+
558
+ /** @public */
559
+ export declare type BrowserEvent = {
560
+ case: "onLoaded";
561
+ value: BrowserOnLoaded;
562
+ } | {
563
+ case: "onLoadStart";
564
+ value: BrowserOnLoadStart;
565
+ } | {
566
+ case: "onLoadEnd";
567
+ value: BrowserOnLoadEnd;
568
+ } | {
569
+ case: "onLoadError";
570
+ value: BrowserOnLoadError;
571
+ };
572
+
573
+ /**
574
+ * @public
575
+ * see: {@link NorskInput.browser}
576
+ */
577
+ export declare class BrowserInputNode extends SourceMediaNode {
578
+ /**
579
+ * @public
580
+ * Supply new config for an active web browser session
581
+ * */
582
+ updateConfig(settings: BrowserInputSettingsUpdate): void;
583
+ /**
584
+ * @public
585
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
586
+ * */
587
+ nudge(nudge: number): void;
588
+ }
589
+
590
+ /**
591
+ * @public
592
+ * Settings for a Browser Input
593
+ * see: {@link NorskInput.browser}
594
+ * */
595
+ export declare interface BrowserInputSettings extends SourceNodeSettings<BrowserInputNode>, StreamStatisticsMixin {
596
+ /** The url to load in the browser session */
597
+ url: string;
598
+ /** This is the resolution of the window opened to render the page
599
+ * This is therefore also output resolution of the generated video
600
+ */
601
+ resolution: {
602
+ width: number;
603
+ height: number;
604
+ };
605
+ /** The source name to populate the outgoing stream key with */
606
+ sourceName: string;
607
+ /** The frame rate at which to generate video from the web page
608
+ * Note: If the web page is static, this will just mean the initial frame
609
+ * is duplicated at the required frame rate
610
+ * */
611
+ frameRate: FrameRate;
612
+ /** An optional callback for reacting to events from the embedded browser
613
+ * At the very least this is useful for logging events (such as a 404)
614
+ * */
615
+ onBrowserEvent?: (event: BrowserEvent) => void;
616
+ }
617
+
618
+ /**
619
+ * @public
620
+ * A settings update for a running browser
621
+ * see: {@link BrowserInputNode.updateConfig}
622
+ * */
623
+ export declare interface BrowserInputSettingsUpdate {
624
+ /** Optionally, a new URL to load within the active session */
625
+ url?: string;
626
+ /** Optionally, a new resolution to use for outgoing video */
627
+ resolution?: {
628
+ width: number;
629
+ height: number;
630
+ };
631
+ }
632
+
633
+ /** @public */
634
+ export declare interface BrowserOnLoaded {
635
+ url: string;
636
+ }
637
+
638
+ /** @public */
639
+ export declare interface BrowserOnLoadEnd {
640
+ url: string;
641
+ statusCode: number;
642
+ }
643
+
644
+ /** @public */
645
+ export declare interface BrowserOnLoadError {
646
+ url: string;
647
+ errorText: string;
648
+ errorCode: number;
649
+ }
650
+
651
+ /** @public */
652
+ export declare interface BrowserOnLoadStart {
653
+ url: string;
654
+ }
655
+
656
+ /** @public Channel layout for an audio stream */
657
+ export declare type ChannelLayout = "mono" | "stereo" | "surround" | "4.0" | "5.0" | "5.1" | "7.1" | "5.1.4" | "7.1.4" | (ChannelName | ExplicitChannel)[];
658
+
659
+ /** @public */
660
+ export declare interface ChannelLevels {
661
+ rms?: Db;
662
+ peak?: Db;
663
+ }
664
+
665
+ /** @public */
666
+ export declare type ChannelName =
667
+ /** Left front */
668
+ "l"
669
+ /** Right front */
670
+ | "r"
671
+ /** Centre front */
672
+ | "c"
673
+ /** Low frequency enhancement */
674
+ | "lfe"
675
+ /** Left surround */
676
+ | "ls"
677
+ /** Right surround */
678
+ | "rs"
679
+ /** Left front centre */
680
+ | "lc"
681
+ /** Right front centre */
682
+ | "rc"
683
+ /** Rear surround left */
684
+ | "lsr"
685
+ /** Rear Surround Right */
686
+ | "rsr"
687
+ /** Rear centre */
688
+ | "cs"
689
+ /** Left surround direct */
690
+ | "lsd"
691
+ /** Right surround direct */
692
+ | "rsd"
693
+ /** Left side surround */
694
+ | "lss"
695
+ /** Right side surround */
696
+ | "rss"
697
+ /** Left wide front */
698
+ | "lw"
699
+ /** Right wide front */
700
+ | "rw"
701
+ /** Left front vertical height */
702
+ | "lv"
703
+ /** Right front vertical height */
704
+ | "rv"
705
+ /** Centre front vertical height */
706
+ | "cv"
707
+ /** Left surround vertical height rear */
708
+ | "lvr"
709
+ /** Right surround vertical height rear */
710
+ | "rvr"
711
+ /** Centre vertical height rear */
712
+ | "cvr"
713
+ /** Left vertical height side surround */
714
+ | "lvss"
715
+ /** Right vertical height side surround */
716
+ | "rvss"
717
+ /** Top centre surround */
718
+ | "ts"
719
+ /** Low frequency enhancement 2 */
720
+ | "lfe2"
721
+ /** Left front vertical bottom */
722
+ | "lb"
723
+ /** Right front vertical bottom */
724
+ | "rb"
725
+ /** Centre front vertical bottom */
726
+ | "cb"
727
+ /** Left vertical height surround */
728
+ | "lvs"
729
+ /** Right vertical height surround */
730
+ | "rvs"
731
+ /** Low frequency enhancement 3 */
732
+ | "lfe3"
733
+ /** Left edge of screen */
734
+ | "leos"
735
+ /** Right edge of screen */
736
+ | "reos"
737
+ /** Halfway between centre of screen and left edge of screen */
738
+ | "hwbcal"
739
+ /** Halfway between centre of screen and right edge of screen */
740
+ | "hwbcar"
741
+ /** Left back surround */
742
+ | "lbs"
743
+ /** Right back surround */
744
+ | "rbs"
745
+ /** Unknown */
746
+ | "unknown";
747
+
748
+ /** @public */
749
+ export declare function clientHostExternal(): string;
750
+
751
+ /** @public */
752
+ export declare function clientHostInternal(): string;
753
+
754
+ /** @public */
755
+ export declare function clientPortExternal(): string;
756
+
757
+ /** @public */
758
+ export declare function clientPortInternal(): string;
759
+
760
+ /**
761
+ * @public
762
+ * see: {@link NorskOutput.cmafAudio}
763
+ */
764
+ export declare class CmafAudioOutputNode extends CmafNodeWithPlaylist<CmafAudioMessage, "audio", CmafAudioOutputNode> {
765
+ /** @public */
766
+ onPlaylistAddition?: (destinationId: DestinationId, pl: HlsPlaylistAdditions) => HlsPlaylist;
767
+ /**
768
+ * @public
769
+ * Updates the credentials for a specific destination within this output by id
770
+ * see: {@link UpdateCredentials}
771
+ * see: {@link CmafDestinationSettings}
772
+ */
773
+ updateCredentials(settings: UpdateCredentials): void;
774
+ }
775
+
776
+ /**
777
+ * @public
778
+ * Possible destinations for a segmented media stream
779
+ * - {@link HlsPushDestinationSettings}: Push to a generic HTTP server
780
+ * - {@link AwsS3PushDestinationSettings}: Push to Amazon S3
781
+ * - {@link LocalPullDestinationSettings}: Serve directly from the Norsk Web Server
782
+ * */
783
+ export declare type CmafDestinationSettings = HlsPushDestinationSettings | AwsS3PushDestinationSettings | LocalPullDestinationSettings;
784
+
785
+ /**
786
+ * @public
787
+ * see: {@link NorskOutput.cmafMultiVariant}
788
+ */
789
+ export declare class CmafMultiVariantOutputNode extends CmafNodeBase<CmafMultiVariantMessage, "video" | "audio" | "subtitle", CmafMultiVariantOutputNode> {
790
+ /** @public The URL of the file based multi variant playlist */
791
+ url: string;
792
+ /**
793
+ * @public
794
+ * Updates the credentials for a specific destination within this output by id
795
+ * see: {@link UpdateCredentials}
796
+ * see: {@link CmafDestinationSettings}
797
+ */
798
+ updateCredentials(settings: UpdateCredentials): void;
799
+ }
800
+
801
+ /**
802
+ * @public
803
+ * Settings for a CMAF Multi Variant Playlist
804
+ * see {@link NorskOutput.cmafMultiVariant}
805
+ */
806
+ export declare interface CmafMultiVariantOutputSettings extends SinkNodeSettings<CmafMultiVariantOutputNode> {
807
+ /**
808
+ * The name of this multi variant playlist (.m3u8 will be added onto this field to generate a filename)
809
+ */
810
+ playlistName: string;
811
+ /**
812
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
813
+ */
814
+ destinations: CmafDestinationSettings[];
815
+ /**
816
+ * Directives to add to the m3u multi variant playlist
817
+ */
818
+ m3uAdditions?: string;
819
+ /**
820
+ * XML fragment to add to the (top-level) MPD element
821
+ */
822
+ mpdAdditions?: string;
823
+ /**
824
+ * A callback invoked every time a CMAF multi variant playlist is changed
825
+ */
826
+ onPlaylistChange?: (destinationId: DestinationId, playlist: CmafMultiVariantPlaylistData) => CmafMultiVariantPlaylistData;
827
+ }
828
+
829
+ /** @public */
830
+ export declare interface CmafMultiVariantPlaylistData {
831
+ hls: string;
832
+ dash: string;
833
+ }
834
+
835
+ declare class CmafNodeBase<ClientMessage, Pins extends string, T extends MediaNodeState> extends AutoProcessorMediaNode<Pins> {
836
+ playlists: HlsPlaylistDestination;
837
+ destinations: DestinationId[];
838
+ scheduledTags: ScheduledTag[];
839
+ constructor(client: MediaClient, unregisterNode: (node: MediaNodeState) => void, settings: ProcessorNodeSettings<T> & StreamStatisticsMixin, grpcInit: () => grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, subscribeFn: (subscription: Subscription) => Promise<boolean>, onPlaylistAddition: PlaylistOnChangeFn<ClientMessage>, destinations: DestinationId[], subscribedStreamsChangedFn?: (streams: StreamMetadata[]) => void);
840
+ scheduleTag(tag: MediaPlaylistPart, scheduleAt: Date, destinationId?: DestinationId): ScheduledTag;
841
+ removeScheduledTag(tagId: number): void;
842
+ }
843
+
844
+ declare class CmafNodeWithPlaylist<ClientMessage, Pins extends string, T extends MediaNodeState> extends CmafNodeBase<ClientMessage, Pins, T> {
845
+ constructor(client: MediaClient, unregisterNode: (node: MediaNodeState) => void, settings: ProcessorNodeSettings<T> & StreamStatisticsMixin, grpcInit: () => grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, subscribeFn: (subscription: Subscription) => Promise<boolean>, playlistPath: PlaylistPath, segmentDuration: number, onPlaylistAddition: PlaylistOnChangeFn<ClientMessage>, destinations: DestinationId[], localDestination?: LocalPullDestinationSettings, maximumPlaylistSegments?: number);
846
+ /**
847
+ * @public
848
+ * Returns the URL to the HLS playlist entry. Note this can only be evaluated once the stream is active as it
849
+ * varies with the stream subscribed to. Useful during development, but you probably want to
850
+ * use {@link NorskOutput.cmafMultiVariant} for production.
851
+ */
852
+ url(): Promise<string>;
853
+ }
854
+
855
+ /**
856
+ * @public
857
+ * Settings for a CMAF Audio and Video Outputs
858
+ * see {@link NorskOutput.cmafAudio}, {@link NorskOutput.cmafVideo}
859
+ */
860
+ export declare interface CmafOutputSettings extends SinkNodeSettings<CmafAudioOutputNode | CmafVideoOutputNode> {
861
+ /**
862
+ * The target segment duration in seconds. Norsk will make the largest segments it can
863
+ * without going over this target
864
+ */
865
+ segmentDurationSeconds: number;
866
+ /**
867
+ * The target part duration in seconds. Norsk will make the largest parts it can
868
+ * without going over this target
869
+ */
870
+ partDurationSeconds: number;
871
+ /**
872
+ * By default, the program date time or event start time will be based on the
873
+ * timestamp of the first video packet received by Norsk in a stream.
874
+ *
875
+ * Assuming minimal latency in Norsk itself, this behaviour is fine - but encodes and composition
876
+ * or synchronisation with external streams can then result in players requesting segments that don't exist yet
877
+ *
878
+ * delayOutputMs can be used to push the timestamp forwards so that players can calculate the edge of the stream accurately.
879
+ *
880
+ * This number should match the delayOutputMs of other streams which will be served within the same multi variant playlist
881
+ */
882
+ delayOutputMs?: number;
883
+ /**
884
+ * Settings for encrypting the content.
885
+ */
886
+ encryption?: EncryptionSettings;
887
+ /**
888
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
889
+ */
890
+ destinations: CmafDestinationSettings[];
891
+ /**
892
+ * Directives to add to the m3u media playlist
893
+ */
894
+ m3uAdditions?: string;
895
+ /**
896
+ * XML fragment to add to the mpd Representation element
897
+ */
898
+ mpdAdditions?: string;
899
+ /**
900
+ * Audio or video bitrate for the {@link NorskOutput.cmafMultiVariant} playlist
901
+ */
902
+ bitrate?: number;
903
+ /**
904
+ * The maximum number of segments to display in a single generated playlist
905
+ */
906
+ maximumPlaylistSegments?: number;
907
+ }
908
+
909
+ /**
910
+ * @public
911
+ * see: {@link NorskOutput.cmafVideo}
912
+ */
913
+ export declare class CmafVideoOutputNode extends CmafNodeWithPlaylist<CmafVideoMessage, "video", CmafVideoOutputNode> {
914
+ /** @public */
915
+ onPlaylistAddition?: (destinationId: DestinationId, pl: HlsPlaylistAdditions) => HlsPlaylist;
916
+ /**
917
+ * @public
918
+ * Updates the credentials for a specific destination within this output by id
919
+ * see: {@link UpdateCredentials}
920
+ * see: {@link CmafDestinationSettings}
921
+ */
922
+ updateCredentials(settings: UpdateCredentials): void;
923
+ }
924
+
925
+ /**
926
+ * @public
927
+ * see: {@link NorskOutput.cmafWebVtt}
928
+ */
929
+ export declare class CmafWebVttOutputNode extends CmafNodeWithPlaylist<CmafWebVttMessage, "subtitle", CmafWebVttOutputNode> {
930
+ /** @public */
931
+ onPlaylistAddition?: (destinationId: DestinationId, pl: HlsPlaylistAdditions) => HlsPlaylist;
932
+ /**
933
+ * @public
934
+ * Updates the credentials for a specific destination within this output by id
935
+ * see: {@link UpdateCredentials}
936
+ * see: {@link CmafDestinationSettings}
937
+ */
938
+ updateCredentials(settings: UpdateCredentials): void;
939
+ }
940
+
941
+ /**
942
+ * @public
943
+ * Settings for a CMAF WebVTT Output
944
+ * see {@link NorskOutput.cmafWebVtt}
945
+ */
946
+ export declare interface CmafWebVttOutputSettings extends SinkNodeSettings<CmafWebVttOutputNode> {
947
+ /**
948
+ * The target segment duration in seconds, Norsk will split subtitles over multiple segments
949
+ * in a compliant manner if necessary
950
+ */
951
+ segmentDurationSeconds: number;
952
+ /**
953
+ * By default, the program date time or event start time will be based on the
954
+ * timestamp of the first video packet received by Norsk in a stream.
955
+ *
956
+ * Assuming minimal latency in Norsk itself, this behaviour is fine - but encodes and composition
957
+ * or synchronisation with external streams can then result in players requesting segments that don't exist yet
958
+ *
959
+ * delayOutputMs can be used to push the timestamp forwards so that players can calculate the edge of the stream accurately.
960
+ *
961
+ * This number should match the delayOutputMs of other streams which will be served within the same multi variant playlist
962
+ */
963
+ delayOutputMs?: number;
964
+ /**
965
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
966
+ */
967
+ destinations: CmafDestinationSettings[];
968
+ /**
969
+ * A local directory in which to store the segments while they're available
970
+ */
971
+ hlsCacheDirectory: string;
972
+ /**
973
+ * The maximum number of segments to display in a single generated playlist
974
+ */
975
+ maximumPlaylistSegments?: number;
976
+ }
977
+
978
+ /** @public */
979
+ export declare type ComposeHardwareAcceleration =
980
+ /**
981
+ * Use the quadra overlay functionality to perform the compose
982
+ */
983
+ "quadra"
984
+ /**
985
+ * Use an nvidia CUDA kernel to perform the compose
986
+ */
987
+ | "nvidia";
988
+
989
+ /** @public */
990
+ export declare type ComposeMissingStreamBehaviour =
991
+ /**
992
+ * Produce frames on output by dropping the part(s) of the composition which
993
+ * cannot be fulfilled.
994
+ */
995
+ "drop_part"
996
+ /**
997
+ * Wait for all streams to be present before producing (further) output
998
+ */
999
+ | "wait_for_all";
1000
+
1001
+ /**
1002
+ * @public
1003
+ * A single layer of a video compose operation
1004
+ * see {@link NorskTransform.videoCompose}
1005
+ * */
1006
+ export declare interface ComposePart<Pins> {
1007
+ /** Input pin for this source */
1008
+ pin: Pins;
1009
+ /**
1010
+ * The area within the source picture to include. This may be the full picture
1011
+ * or cropped, and will be rescaled if necessary.
1012
+ * If a referenceResolution is specified, then this is within that coordinate system, otherwise
1013
+ * this is taken to be within the coordinate system of the input image
1014
+ */
1015
+ sourceRect: OffsetRect;
1016
+ /**
1017
+ * The area within the destination picture to place this part of the
1018
+ * composition.
1019
+ * If a referenceResolution is specified, then this is within that coordinate system, otherwise
1020
+ * this is taken to be within the coordinate system of the destination image
1021
+ */
1022
+ destRect: OffsetRect;
1023
+ /**
1024
+ * Z-index to determine ordering by which the sources are overlaid
1025
+ * (higher layers appear on top)
1026
+ */
1027
+ zIndex: number;
1028
+ /**
1029
+ * Opacity multiplier of this overlay (where 0.0 is fully transparent and 1.0
1030
+ * is fully opaque)
1031
+ */
1032
+ opacity: number;
1033
+ /** Optionally identify the part to enable transitions */
1034
+ id?: string;
1035
+ /**
1036
+ * Optionally specify a transition for this part. A transition is applied only
1037
+ * if the part is specified in both the existing and the current/new
1038
+ * configuration, identified by having the same id specified, and a transition
1039
+ * is specified for the new configuration.
1040
+ */
1041
+ transition?: PartTransition;
1042
+ /**
1043
+ * Optionally supply a reference resolution. This allows description of the
1044
+ * composition in a desired coordinate system, e.g. a resolution of 100x100
1045
+ * can be specified to allow the source and destination areas to be described
1046
+ * in percentage terms, or a notional resolution can be used that is
1047
+ * independant of the source resolutions that may be provided.
1048
+ *
1049
+ * If unset, this will be overriden by a global reference resolution if that is present
1050
+ *
1051
+ * This is useful to set if you don't know the input resolution of a part but want to be able to describe
1052
+ * an operation on that part.
1053
+ */
1054
+ referenceResolution?: Resolution;
1055
+ }
1056
+
1057
+ /** @public */
1058
+ export declare interface Context {
1059
+ streams: StreamMetadata[];
1060
+ }
1061
+
1062
+ /** @public */
1063
+ export declare type ContextType = "full" | "singleSource" | "singleProgram" | "singleStream" | "singleRendition";
1064
+
1065
+ /** @public */
1066
+ export declare interface Core {
1067
+ logicalCpuIds: LogicalCpuId[];
1068
+ }
1069
+
1070
+ /** @public */
1071
+ export declare interface CpuTopology {
1072
+ numaNodes: NumaNode[];
1073
+ }
1074
+
1075
+ /** @public A decibel (dB). A null value represents -inf. */
1076
+ export declare type Db = number | null;
1077
+
1078
+ /** @public */
1079
+ export declare function debugUrlPrefix(): string;
1080
+
1081
+ /** @public */
1082
+ export declare interface DeckLinkCard {
1083
+ index: number;
1084
+ displayName: string;
1085
+ inputConnections: DeckLinkVideoConnection[];
1086
+ outputConnections: DeckLinkVideoConnection[];
1087
+ ioSupport: DeckLinkVideoIOSupport[];
1088
+ }
1089
+
1090
+ /** @public */
1091
+ export declare interface DeckLinkDisplayMode {
1092
+ id: DeckLinkDisplayModeId;
1093
+ name: string;
1094
+ width: number;
1095
+ height: number;
1096
+ frameRate: FrameRate;
1097
+ }
1098
+
1099
+ /** @public */
1100
+ export declare type DeckLinkDisplayModeId = "auto" | "sd_ntsc" | "sd_nt23" | "sd_pal" | "sd_ntsp" | "sd_palp" | "hd1080_23ps" | "hd1080_24ps" | "hd1080_p25" | "hd1080_p29" | "hd1080_p30" | "hd1080_p47" | "hd1080_p48" | "hd1080_i50" | "hd1080_i59" | "hd1080_i60" | "hd1080_p95" | "hd1080_p96" | "hd1080_p10" | "hd1080_p11" | "hd1080_p12" | "hd1080_p50" | "hd1080_p59" | "hd1080_p60" | "hd720_p50" | "hd720_p59" | "hd720_p60" | "two_k_23" | "two_k_24" | "two_k_25" | "two_k_dci_23" | "two_k_dci_24" | "two_k_dci_25" | "two_k_dci_29" | "two_k_dci_30" | "two_k_dci_47" | "two_k_dci_48" | "two_k_dci_50" | "two_k_dci_59" | "two_k_dci_60" | "two_k_dci_95" | "two_k_dci_96" | "two_k_dci_10" | "two_k_dci_11" | "two_k_dci_12" | "four_k_23" | "four_k_24" | "four_k_25" | "four_k_29" | "four_k_30" | "four_k_47" | "four_k_48" | "four_k_50" | "four_k_59" | "four_k_60" | "four_k_95" | "four_k_96" | "four_k_10" | "four_k_11" | "four_k_12" | "four_k_dci_23" | "four_k_dci_24" | "four_k_dci_25" | "four_k_dci_29" | "four_k_dci_30" | "four_k_dci_47" | "four_k_dci_48" | "four_k_dci_50" | "four_k_dci_59" | "four_k_dci_60" | "four_k_dci_95" | "four_k_dci_96" | "four_k_dci_10" | "four_k_dci_11" | "four_k_dci_12" | "eight_k_23" | "eight_k_24" | "eight_k_25" | "eight_k_29" | "eight_k_30" | "eight_k_47" | "eight_k_48" | "eight_k_50" | "eight_k_59" | "eight_k_60" | "eight_k_dci_23" | "eight_k_dci_24" | "eight_k_dci_25" | "eight_k_dci_29" | "eight_k_dci_30" | "eight_k_dci_47" | "eight_k_dci_48" | "eight_k_dci_50" | "eight_k_dci_59" | "eight_k_dci_60" | "pc_vga6" | "pc_svg6" | "pc_wxg5" | "pc_wxg6" | "pc_sxg5" | "pc_sxg6" | "pc_uxg5" | "pc_uxg6" | "pc_wux5" | "pc_wux6" | "pc_1945" | "pc_1946" | "pc_wqh5" | "pc_wqh6" | "pc_wqx5" | "pc_wqx6" | "special_iunk";
1101
+
1102
+ /**
1103
+ * @public
1104
+ * SDI capture through a DeckLink card.
1105
+ * see: {@link NorskInput.deckLink}.
1106
+ */
1107
+ export declare class DeckLinkInputNode extends SourceMediaNode {
1108
+ /**
1109
+ * @public
1110
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
1111
+ * */
1112
+ nudge(nudge: number): void;
1113
+ }
1114
+
1115
+ /**
1116
+ * @public
1117
+ * Settings to control SDI capture through a DeckLink card
1118
+ * see: {@link NorskInput.deckLink}
1119
+ */
1120
+ export declare interface DeckLinkInputSettings extends InputSettings<DeckLinkInputNode>, StreamStatisticsMixin {
1121
+ /** Which card to use */
1122
+ cardIndex: number;
1123
+ /** The audio channel layout for the input */
1124
+ channelLayout: ChannelLayout;
1125
+ /** SDI or HDMI capture */
1126
+ videoConnection: DeckLinkVideoConnection;
1127
+ /** Typically left undefined, but can be used to force capture for a specific {@link DeckLinkDisplayModeId}. If
1128
+ * the source is not currently in this mode, then no capture will occur. */
1129
+ displayModeId?: DeckLinkDisplayModeId;
1130
+ pixelFormat?: DeckLinkPixelFormat;
1131
+ }
1132
+
1133
+ /** @public */
1134
+ export declare type DeckLinkPixelFormat = "uyvy" | "argb";
1135
+
1136
+ /** @public */
1137
+ export declare type DeckLinkVideoConnection = "sdi" | "hdmi" | "optical_sdi" | "component" | "composite" | "svideo";
1138
+
1139
+ /** @public */
1140
+ export declare type DeckLinkVideoIOSupport = "capture" | "playback";
1141
+
1142
+ /** @public */
1143
+ export declare type DeferredVideoComposeSettings<Pins extends string> = (streams: StreamMetadata[]) => VideoComposeSettings<Pins> | undefined;
1144
+
1145
+ /** @public */
1146
+ export declare type DestinationId = string;
1147
+
1148
+ /**
1149
+ * @public
1150
+ * Drop every N frames from an incoming video stream
1151
+ * */
1152
+ export declare interface DropEvery {
1153
+ kind: "every";
1154
+ every: number;
1155
+ }
1156
+
1157
+ /**
1158
+ * @public
1159
+ * Randomly drop frames on a stream
1160
+ * - 0.0 means don't drop any frames
1161
+ * - 1.0 means drop every single frame
1162
+ * */
1163
+ export declare interface DropRandom {
1164
+ kind: "random";
1165
+ percentage: number;
1166
+ }
1167
+
1168
+ /**
1169
+ * @public
1170
+ * Drop the first N frames from an incoming video stream
1171
+ * */
1172
+ export declare interface DropStart {
1173
+ kind: "start";
1174
+ start: number;
1175
+ }
1176
+
1177
+ /** @public */
1178
+ export declare interface EncryptionSettings {
1179
+ /**
1180
+ * The 16-byte key ID used to identify the key, hexadecimal or GUID encoded.
1181
+ */
1182
+ encryptionKeyId: string;
1183
+ /**
1184
+ * The 16-byte key used to encrypt the data, hexadecimal encoded.
1185
+ */
1186
+ encryptionKey: string;
1187
+ /**
1188
+ * The PSSH box(es) to include in the MP4, base64 encoded.
1189
+ * This is typically given by the DRM provider.
1190
+ */
1191
+ encryptionPssh: string;
1192
+ /**
1193
+ * The common encryption scheme used to encrypt data, as per ISO/IEC 23001-7:2016.
1194
+ *
1195
+ * - Default: CBCS encryption scheme (AES-CBC 10% pattern encryption).
1196
+ * Full-sample encryption for audio tracks, subsample encryption for video
1197
+ * tracks.
1198
+ *
1199
+ * - CENC encryption scheme (AES-CTR). Full-sample encryption for audio tracks,
1200
+ * subsample encryption for video tracks.
1201
+ */
1202
+ encryptionScheme?: "cbcs" | "cenc";
1203
+ }
1204
+
1205
+ /**
1206
+ * @public
1207
+ * see: {@link NorskInput.fileImage}
1208
+ */
1209
+ export declare class FileImageInputNode extends SourceMediaNode {
1210
+ }
1211
+
1212
+ /**
1213
+ * @public
1214
+ * Settings for an image file source
1215
+ * see: {@link NorskInput.fileImage}
1216
+ * */
1217
+ export declare interface FileImageInputSettings extends SourceNodeSettings<FileImageInputNode>, StreamStatisticsMixin {
1218
+ /** The source name to set in the stream key of the outgoing stream */
1219
+ sourceName: string;
1220
+ /** the filename to read the image from */
1221
+ fileName: string;
1222
+ /** The file format for the image. Will be inferred from the file name if not specified. */
1223
+ imageFormat?: ImageFormat;
1224
+ }
1225
+
1226
+ /**
1227
+ * @public
1228
+ * Information about an Mp4 File
1229
+ * */
1230
+ export declare interface FileMp4Info {
1231
+ /** The duration of the Mp4 file in millseconds (if known) */
1232
+ durationMs?: number;
1233
+ /** The total length of the mp4 file in bytes, if known */
1234
+ byteLength?: number;
1235
+ }
1236
+
1237
+ /**
1238
+ * @public
1239
+ * see: {@link NorskInput.fileMp4}
1240
+ */
1241
+ export declare class FileMp4InputNode extends SourceMediaNode {
1242
+ /**
1243
+ * @public
1244
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
1245
+ * */
1246
+ nudge(nudge: number): void;
1247
+ updateSettings(settings: FileMp4InputSettingsUpdate): void;
1248
+ }
1249
+
1250
+ /**
1251
+ * @public
1252
+ * Settings for an File Based Mp4 Input
1253
+ * see: {@link NorskInput.fileMp4}
1254
+ */
1255
+ export declare interface FileMp4InputSettings extends SourceNodeSettings<FileMp4InputNode>, StreamStatisticsMixin {
1256
+ /** The source name to set in the stream key of the outgoing stream */
1257
+ sourceName: string;
1258
+ /** Path to the MP4 file to read */
1259
+ fileName: string;
1260
+ /** Callback to be notified when the file ends */
1261
+ onEof?: () => void;
1262
+ /** Callback to be notified when the file is initially read */
1263
+ onInfo?: (info: FileMp4Info) => void;
1264
+ /** Whether to loop back to the start of the file after reaching the end (default false) */
1265
+ loop?: boolean;
1266
+ }
1267
+
1268
+ export declare interface FileMp4InputSettingsUpdate {
1269
+ /** Whether to loop back to the start of the file after reaching the end */
1270
+ loop?: boolean;
1271
+ }
1272
+
1273
+ /**
1274
+ * @public
1275
+ * see: {@link NorskOutput.fileMp4}
1276
+ */
1277
+ export declare class FileMp4OutputNode extends AutoSinkMediaNode<"audio" | "video"> {
1278
+ /**
1279
+ * @public
1280
+ * Writes a non-fragmented MP4 file containing the data received so far to the
1281
+ * supplied filename
1282
+ */
1283
+ writeFile(nonfragmentedFileName: string): void;
1284
+ }
1285
+
1286
+ /**
1287
+ * @public
1288
+ * Settings to control MP4 file output
1289
+ * see {@link NorskOutput.fileMp4}
1290
+ */
1291
+ export declare interface FileMp4OutputSettings extends SinkNodeSettings<FileMp4OutputNode>, StreamStatisticsMixin {
1292
+ /**
1293
+ * Required: stream fragmented MP4 to this file.
1294
+ */
1295
+ fragmentedFileName: string;
1296
+ /**
1297
+ * Write non-fragmented MP4 to this file on close, creates a `.tmp` file to
1298
+ * store the frame data.
1299
+ */
1300
+ nonfragmentedFileName?: string;
1301
+ /**
1302
+ * Settings for encrypting the audio track.
1303
+ */
1304
+ audioEncryption?: EncryptionSettings;
1305
+ /**
1306
+ * Settings for encrypting the video track.
1307
+ */
1308
+ videoEncryption?: EncryptionSettings;
1309
+ /**
1310
+ * Callback that will be invoked once data stops being received by the node (determined by an empty context)
1311
+ * at which point it will automatically shut down
1312
+ */
1313
+ onStreamEof?: () => void;
1314
+ }
1315
+
1316
+ /**
1317
+ * @public
1318
+ * see: {@link NorskInput.fileTs}
1319
+ */
1320
+ export declare class FileTsInputNode extends TsCommonInputNode<FileTsInputMessage, FileTsInputNode> {
1321
+ updateSettings(settings: FileTsInputSettingsUpdate): void;
1322
+ }
1323
+
1324
+ /** @public */
1325
+ export declare interface FileTsInputSettings extends LocalFileInputSettings, StreamStatisticsMixin {
1326
+ /** Whether to loop back to the start of the file after reaching the end */
1327
+ loop?: boolean;
1328
+ }
1329
+
1330
+ /** @public */
1331
+ export declare interface FileTsInputSettingsUpdate {
1332
+ /** Whether to loop back to the start of the file after reaching the end */
1333
+ loop?: boolean;
1334
+ }
1335
+
1336
+ /**
1337
+ * @public
1338
+ * see: {@link NorskOutput.fileTs}
1339
+ */
1340
+ export declare class FileTsOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
1341
+ }
1342
+
1343
+ /**
1344
+ * @public
1345
+ * The settings for an output Transport Stream written to file
1346
+ * see: {@link NorskOutput.fileTs}
1347
+ */
1348
+ export declare interface FileTsOutputSettings extends SinkNodeSettings<FileTsOutputNode>, StreamStatisticsMixin {
1349
+ /** The file to write - this will be truncated if it already exist */
1350
+ fileName: string;
1351
+ }
1352
+
1353
+ /**
1354
+ * @public
1355
+ * see: {@link NorskInput.fileWebVtt}
1356
+ */
1357
+ export declare class FileWebVttInputNode extends SourceMediaNode {
1358
+ }
1359
+
1360
+ /** @public */
1361
+ export declare interface FrameRate {
1362
+ frames: number;
1363
+ seconds: number;
1364
+ }
1365
+
1366
+ export declare type FrameStoreCut = {
1367
+ startDateTime: Date;
1368
+ durationMs: number;
1369
+ sessionNum?: number;
1370
+ };
1371
+
1372
+ /**
1373
+ * @public
1374
+ * see: {@link NorskInput.frameStorePlayer}
1375
+ */
1376
+ export declare class FrameStorePlayerNode extends SourceMediaNode {
1377
+ }
1378
+
1379
+ /**
1380
+ * @public
1381
+ * Settings for Frame Store playback
1382
+ * see: {@link NorskInput.frameStorePlayer}
1383
+ */
1384
+ export declare interface FrameStorePlayerSettings extends InputSettings<FrameStorePlayerNode>, StreamStatisticsMixin {
1385
+ /**
1386
+ * Required: Name of the frame store instance.
1387
+ */
1388
+ name: string;
1389
+ /**
1390
+ * Required: The streams you want to playback from the frame store
1391
+ */
1392
+ streamSelection: FrameStoreStreamSelection;
1393
+ /**
1394
+ * Required: The start times and durations of the playback
1395
+ */
1396
+ cuts: FrameStoreCut[];
1397
+ /**
1398
+ * Required: If a start time or end time falls mid-gop, should the gop be trimmed to be frame accurate?
1399
+ */
1400
+ trimPartialSegments: boolean;
1401
+ /** Callback to be notified when playback ends */
1402
+ onEof?: () => void;
1403
+ }
1404
+
1405
+ /**
1406
+ * @public
1407
+ * see: {@link NorskOutput.frameStoreRecording}
1408
+ */
1409
+ export declare class FrameStoreRecorderNode extends AutoSinkMediaNode<"audio" | "video"> {
1410
+ }
1411
+
1412
+ /**
1413
+ * @public
1414
+ * Settings to configure a frame store recorder
1415
+ * see {@link NorskOutput.frameStoreRecorder}
1416
+ */
1417
+ export declare interface FrameStoreRecorderSettings extends SinkNodeSettings<FrameStoreRecorderNode>, StreamStatisticsMixin {
1418
+ /**
1419
+ * Required: Name of this frame store instance.
1420
+ */
1421
+ name: string;
1422
+ /**
1423
+ * Required: Path for the frame store database.
1424
+ */
1425
+ path: string;
1426
+ /**
1427
+ * Required: Duration of the frame store chunk files
1428
+ */
1429
+ chunkFileDurationSeconds: number;
1430
+ }
1431
+
1432
+ export declare type FrameStoreStreamSelection = "all" | StreamKey[];
1433
+
1434
+ export declare function fromVancPayloadFormat(format: VancPayloadFormat_2): VancPayloadFormat;
1435
+
1436
+ /**
1437
+ * @public
1438
+ * A relative change in decibels, expressing a power ratio.
1439
+ *
1440
+ * A value of 0dB means no change, positive values mean an increase in power, and negative values mean a decrease in power.
1441
+ */
1442
+ export declare type Gain = Db;
1443
+
1444
+ /** @public */
1445
+ export declare function getAmountOfChannels(layout: ChannelLayout): number;
1446
+
1447
+ /**
1448
+ * @public
1449
+ *
1450
+ */
1451
+ /**
1452
+ * @public
1453
+ */
1454
+ export declare interface HardwareInfo {
1455
+ cpuTopology: CpuTopology;
1456
+ systemMemory: number;
1457
+ deckLinkCards: DeckLinkCard[];
1458
+ }
1459
+
1460
+ /** @public */
1461
+ export declare type HlsPlaylist = {
1462
+ hlsFilePartPlaylist: MediaPlaylistPart[];
1463
+ hlsByteRangePlaylist: MediaPlaylistPart[];
1464
+ hlsStandardPlaylist: MediaPlaylistPart[];
1465
+ programDateTime?: Date;
1466
+ };
1467
+
1468
+ /** @public */
1469
+ export declare type HlsPlaylistAdditions = HlsPlaylist;
1470
+
1471
+ declare type HlsPlaylistDestination = {
1472
+ [destination: DestinationId]: HlsPlaylist;
1473
+ };
1474
+
1475
+ /**
1476
+ * @public
1477
+ * Configuration for pushing a segmented media stream directly to a generic http server
1478
+ * */
1479
+ export declare interface HlsPushDestinationSettings {
1480
+ type: "generic";
1481
+ /** The hostname of the web server being pushed to.
1482
+ * This will be used to re-resolve the IP address on failures
1483
+ * */
1484
+ host: string;
1485
+ /** the port of the web server being pushed to. */
1486
+ port: number;
1487
+ /** the path under which segments and playlists will be pushed to */
1488
+ pathPrefix: string;
1489
+ /**
1490
+ * Optionally supply a string that will be inserted into the path structure for segments published in this stream
1491
+ *
1492
+ * This is useful for stream restarts or republishing when duplicate segment IDs would be generated causing problems with
1493
+ * cacheing directives
1494
+ */
1495
+ sessionId?: string;
1496
+ /**
1497
+ * A unique identifier for this destination
1498
+ *
1499
+ * This can be used for supplying updates to configuration to this destination specifically
1500
+ * see: {@link UpdateCredentials}
1501
+ */
1502
+ id: DestinationId;
1503
+ /**
1504
+ * Informs the playlist generation how long segments will be retained for on the remote server
1505
+ * in order to generate an accurate playlist
1506
+ */
1507
+ retentionPeriodSeconds: number;
1508
+ }
1509
+
1510
+ /** @public */
1511
+ export declare interface HlsTag {
1512
+ tag: string;
1513
+ }
1514
+
1515
+ /**
1516
+ * @public
1517
+ * see: {@link NorskOutput.hlsTsAudio}
1518
+ */
1519
+ export declare class HlsTsAudioOutputNode extends CmafNodeWithPlaylist<HlsTsAudioMessage, "audio", HlsTsAudioOutputNode> {
1520
+ /** @public */
1521
+ onPlaylistAddition?: (destinationId: DestinationId, pl: TsPlaylistAdditions) => TsPlaylist;
1522
+ get playlist(): HlsTsPlaylistDestination;
1523
+ /**
1524
+ * @public
1525
+ * Updates the credentials for a specific destination within this output by id
1526
+ * see: {@link UpdateCredentials}
1527
+ * see: {@link CmafDestinationSettings}
1528
+ */
1529
+ updateCredentials(settings: UpdateCredentials): void;
1530
+ }
1531
+
1532
+ /**
1533
+ * @public
1534
+ * Settings for a HLS TS Audio Output
1535
+ * see {@link NorskOutput.hlsTsAudio}
1536
+ */
1537
+ export declare interface HlsTsAudioOutputSettings extends SinkNodeSettings<HlsTsAudioOutputNode> {
1538
+ /**
1539
+ * The target segment duration in seconds. Norsk will make the largest segments it can
1540
+ * without going over this target using the durations of the individual audio frames
1541
+ */
1542
+ segmentDurationSeconds: number;
1543
+ /**
1544
+ * By default, the program date time or event start time will be based on the
1545
+ * timestamp of the first video packet received by Norsk in a stream.
1546
+ *
1547
+ * Assuming minimal latency in Norsk itself, this behaviour is fine - but encodes and composition
1548
+ * or synchronisation with external streams can then result in players requesting segments that don't exist yet
1549
+ *
1550
+ * delayOutputMs can be used to push the timestamp forwards so that players can calculate the edge of the stream accurately.
1551
+ *
1552
+ * This number should match the delayOutputMs of other streams which will be served within the same multi variant playlist
1553
+ */
1554
+ delayOutputMs?: number;
1555
+ /**
1556
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
1557
+ */
1558
+ destinations: CmafDestinationSettings[];
1559
+ /**
1560
+ * Directives to add to the m3u media playlist
1561
+ */
1562
+ m3uAdditions?: string;
1563
+ /**
1564
+ * XML fragment to add to the mpd Representation element
1565
+ */
1566
+ mpdAdditions?: string;
1567
+ /**
1568
+ * Audio bitrate for the {@link NorskOutput.hlsTsMultiVariant} playlist
1569
+ */
1570
+ bitrate?: number;
1571
+ /**
1572
+ * The maximum number of segments to display in a single generated playlist
1573
+ */
1574
+ maximumPlaylistSegments?: number;
1575
+ }
1576
+
1577
+ /**
1578
+ * @public
1579
+ * see: {@link NorskOutput.hlsTsCombinedPush}
1580
+ */
1581
+ export declare class HlsTsCombinedPushOutputNode extends CmafNodeWithPlaylist<HlsTsCombinedPushMessage, "audio" | "video", HlsTsCombinedPushOutputNode> {
1582
+ }
1583
+
1584
+ /**
1585
+ * @public
1586
+ * Settings for a HLS Transport Stream Combined Push Output
1587
+ * see {@link NorskOutput.hlsTsCombinedPush}
1588
+ */
1589
+ export declare interface HlsTsCombinedPushOutputSettings extends SinkNodeSettings<HlsTsCombinedPushOutputNode> {
1590
+ /**
1591
+ * The target segment duration in seconds. Norsk will use the framerate of the video stream in order
1592
+ * to produce compliant segments that are less than or equal to this in duration, with audio packaged alongside
1593
+ * using timestamps to line them up
1594
+ */
1595
+ segmentDurationSeconds: number;
1596
+ /**
1597
+ * By default, the program date time or event start time will be based on the
1598
+ * timestamp of the first video packet received by Norsk in a stream.
1599
+ *
1600
+ * Assuming minimal latency in Norsk itself, this behaviour is fine - but encodes and composition
1601
+ * or synchronisation with external streams can then result in players requesting segments that don't exist yet
1602
+ *
1603
+ * delayOutputMs can be used to push the timestamp forwards so that players can calculate the edge of the stream accurately.
1604
+ *
1605
+ * This number should match the delayOutputMs of other streams which will be served within the same multi variant playlist
1606
+ */
1607
+ delayOutputMs?: number;
1608
+ /**
1609
+ * The destination {@link CmafDestinationSettings} for this stream to be published to
1610
+ */
1611
+ destination: CmafDestinationSettings;
1612
+ /**
1613
+ * The name of this media playlist (.m3u8 will be added onto this field to generate a filename)
1614
+ */
1615
+ playlistName: string;
1616
+ /**
1617
+ * Directives to add to the m3u media playlists
1618
+ */
1619
+ m3uAdditions?: string;
1620
+ }
1621
+
1622
+ /**
1623
+ * @public
1624
+ * see: {@link NorskOutput.hlsTsMultiVariant}
1625
+ */
1626
+ export declare class HlsTsMultiVariantOutputNode extends CmafNodeBase<HlsTsMultiVariantMessage, "video" | "audio" | "subtitle", HlsTsMultiVariantOutputNode> {
1627
+ /** @public The URL of the file based multi variant playlist */
1628
+ url: string;
1629
+ /**
1630
+ * @public
1631
+ * Updates the credentials for a specific destination within this output by id
1632
+ * see: {@link UpdateCredentials}
1633
+ * see: {@link CmafDestinationSettings}
1634
+ */
1635
+ updateCredentials(settings: UpdateCredentials): void;
1636
+ }
1637
+
1638
+ /**
1639
+ * @public
1640
+ * Settings for a Hls Ts Multivariant Playlist
1641
+ * see {@link NorskOutput.hlsTsMultiVariant}
1642
+ */
1643
+ export declare interface HlsTsMultiVariantOutputSettings extends SinkNodeSettings<HlsTsMultiVariantOutputNode> {
1644
+ /**
1645
+ * The name of this multi variant playlist (.m3u8 will be added onto this field to generate a filename)
1646
+ */
1647
+ playlistName: string;
1648
+ /**
1649
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
1650
+ */
1651
+ destinations: CmafDestinationSettings[];
1652
+ /**
1653
+ * Directives to add to the m3u multi variant playlist
1654
+ */
1655
+ m3uAdditions?: string;
1656
+ /**
1657
+ * A callback invoked every time a TS multi variant playlist is changed
1658
+ */
1659
+ onPlaylistChange?: (destinationId: DestinationId, playlist: string) => string;
1660
+ }
1661
+
1662
+ declare type HlsTsPlaylistDestination = {
1663
+ [destination: DestinationId]: MediaPlaylistPart[];
1664
+ };
1665
+
1666
+ /**
1667
+ * @public
1668
+ * see: {@link NorskOutput.hlsTsVideo}
1669
+ */
1670
+ export declare class HlsTsVideoOutputNode extends CmafNodeWithPlaylist<HlsTsVideoMessage, "video", HlsTsVideoOutputNode> {
1671
+ /** @public */
1672
+ onPlaylistAddition?: (destinationId: DestinationId, pl: TsPlaylistAdditions) => TsPlaylist;
1673
+ get playlist(): HlsTsPlaylistDestination;
1674
+ /**
1675
+ * @public
1676
+ * Updates the credentials for a specific destination within this output by id
1677
+ * see: {@link UpdateCredentials}
1678
+ * see: {@link CmafDestinationSettings}
1679
+ */
1680
+ updateCredentials(settings: UpdateCredentials): void;
1681
+ }
1682
+
1683
+ /**
1684
+ * @public
1685
+ * Settings for a HLS TS Video Output
1686
+ * see {@link NorskOutput.hlsTsVideo}
1687
+ */
1688
+ export declare interface HlsTsVideoOutputSettings extends SinkNodeSettings<HlsTsVideoOutputNode> {
1689
+ /**
1690
+ * The target segment duration in seconds. Norsk will use the framerate of the stream in order
1691
+ * to produce compliant segments that are less than or equal to this in duration
1692
+ */
1693
+ segmentDurationSeconds: number;
1694
+ /**
1695
+ * By default, the program date time or event start time will be based on the
1696
+ * timestamp of the first video packet received by Norsk in a stream.
1697
+ *
1698
+ * Assuming minimal latency in Norsk itself, this behaviour is fine - but encodes and composition
1699
+ * or synchronisation with external streams can then result in players requesting segments that don't exist yet
1700
+ *
1701
+ * delayOutputMs can be used to push the timestamp forwards so that players can calculate the edge of the stream accurately.
1702
+ *
1703
+ * This number should match the delayOutputMs of other streams which will be served within the same multi variant playlist
1704
+ */
1705
+ delayOutputMs?: number;
1706
+ /**
1707
+ * A list of destinations {@link CmafDestinationSettings} for this stream to be published to
1708
+ */
1709
+ destinations: CmafDestinationSettings[];
1710
+ /**
1711
+ * Directives to add to the m3u media playlist
1712
+ */
1713
+ m3uAdditions?: string;
1714
+ /**
1715
+ * XML fragment to add to the mpd Representation element
1716
+ */
1717
+ mpdAdditions?: string;
1718
+ /**
1719
+ * Video bitrate for the {@link NorskOutput.hlsTsMultiVariant} playlist
1720
+ */
1721
+ bitrate?: number;
1722
+ /**
1723
+ * The maximum number of segments to display in a single generated playlist
1724
+ */
1725
+ maximumPlaylistSegments?: number;
1726
+ }
1727
+
1728
+ /** @public */
1729
+ export declare type IceServerSettings = {
1730
+ urls: string[];
1731
+ username?: string;
1732
+ credential?: string;
1733
+ };
1734
+
1735
+ /** @public */
1736
+ export declare type ImageFormat = "png" | "jpeg" | "gif" | "webp" | "pnm" | "tiff" | "tga" | "dds" | "bmp" | "ico" | "hdr" | "openexr" | "farbfeld" | "avif";
1737
+
1738
+ /**
1739
+ * @public
1740
+ * Base settings for most input nodes
1741
+ * */
1742
+ export declare interface InputSettings<T extends MediaNodeState> extends SourceNodeSettings<T> {
1743
+ /** The source name to set on the stream key on the outgoing stream from this node */
1744
+ sourceName: string;
1745
+ }
1746
+
1747
+ /** @public */
1748
+ export declare type InsertComponent = {
1749
+ components: Scte35InsertCommandComponent[];
1750
+ };
1751
+
1752
+ /** @public */
1753
+ export declare type InsertProgram = {
1754
+ spliceTime?: Scte35SpliceTime;
1755
+ };
1756
+
1757
+ /** @public A time interval measured as ticks / (ticks per second) */
1758
+ export declare interface Interval {
1759
+ n: number;
1760
+ d: number;
1761
+ }
1762
+
1763
+ /** @public */
1764
+ export declare interface IntervalTimestamp {
1765
+ n: number;
1766
+ d: number;
1767
+ }
1768
+
1769
+ /** @public */
1770
+ export declare function isAdMarker(seg: MediaPlaylistPart): seg is AdMarker;
1771
+
1772
+ /** @public */
1773
+ export declare function isHlsTag(seg: MediaPlaylistPart): seg is HlsTag;
1774
+
1775
+ /** @public */
1776
+ export declare function isMediaSegment(seg: MediaPlaylistPart): seg is MediaSegment;
1777
+
1778
+ /** @public */
1779
+ export declare function isProgramDateTime(seg: MediaPlaylistPart): seg is ProgramDateTime;
1780
+
1781
+ /** @public */
1782
+ export declare function isScheduledTag(seg: MediaPlaylistPart): seg is ScheduledTag;
1783
+
1784
+ /**
1785
+ * @public
1786
+ * see: {@link NorskTransform.jitterBuffer}
1787
+ */
1788
+ export declare class JitterBufferNode extends AutoProcessorMediaNode<"audio" | "video" | "subtitle"> {
1789
+ }
1790
+
1791
+ /**
1792
+ * @public
1793
+ * Settings for a Jitter Buffer
1794
+ * see: {@link NorskTransform.jitterBuffer}
1795
+ * */
1796
+ export declare interface JitterBufferSettings extends ProcessorNodeSettings<JitterBufferNode> {
1797
+ /** Buffer delay in milliseconds */
1798
+ delayMs: number;
1799
+ }
1800
+
1801
+ /**
1802
+ * @public
1803
+ * The standard settings for any node reading from a file
1804
+ * */
1805
+ export declare interface LocalFileInputSettings extends InputSettings<SourceMediaNode> {
1806
+ /** The file to be read from */
1807
+ fileName: string;
1808
+ /** An optional callback that will be invoked when file end is reached */
1809
+ onEof?: () => void;
1810
+ }
1811
+
1812
+ /**
1813
+ * @public
1814
+ * Configuration for the serving of segments and playlists directly from the Norsk Web Server
1815
+ * Note: While this is both useful for local testing and for sitting behind a reverse caching proxy / CDN
1816
+ * it is not expected that Norsk serve as the edge server in most scenarios
1817
+ * */
1818
+ export declare interface LocalPullDestinationSettings {
1819
+ type: "local";
1820
+ /**
1821
+ * A unique identifier for this destination
1822
+ */
1823
+ id: DestinationId;
1824
+ /**
1825
+ * Optionally supply a string that will be inserted into the path structure for segments published in this stream
1826
+ *
1827
+ * This is useful for stream restarts or republishing when duplicate segment IDs would be generated causing problems with
1828
+ * cacheing directives
1829
+ */
1830
+ sessionId?: string;
1831
+ /**
1832
+ * Informs the playlist generation how long segments will be retained for
1833
+ * and informs the local web server how long to retain those segments
1834
+ */
1835
+ retentionPeriodSeconds: number;
1836
+ }
1837
+
1838
+ /** @public */
1839
+ export declare type Log = {
1840
+ level: "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "info" | "debug";
1841
+ timestamp: Date;
1842
+ message: string;
1843
+ metadata: string;
1844
+ };
1845
+
1846
+ /**
1847
+ * @public
1848
+ * Settings for a H264 Encode using Netint Logan hardware
1849
+ * A detailed description of these params can be found
1850
+ * on the Netint Logan Encoder Documentation
1851
+ *
1852
+ * These fields have deliberately been written to maintain the same semantics as the
1853
+ * Logan documentation where possible.
1854
+ *
1855
+ * If left undefined, all will default to Logan's own defaults
1856
+ * */
1857
+ export declare interface LoganH264 {
1858
+ type: "logan-h264";
1859
+ /** This (for convenience) takes the xcoder string that Logan's
1860
+ * Ffmpeg integration accepts, this is to aid developers in getting up and running
1861
+ * quickly and will override any values set manually in the rest of this interface.
1862
+ *
1863
+ * It is expected that developers will choose to use the typed fields for most things instead
1864
+ * when moving to production, as they offer a degree of validation and type safety
1865
+ * */
1866
+ extraOpts?: string;
1867
+ enableAud?: boolean;
1868
+ gpuIndex?: number;
1869
+ bitrate?: number;
1870
+ flushGop?: boolean;
1871
+ enableVfr?: boolean;
1872
+ crf?: number;
1873
+ cbr?: boolean;
1874
+ gopPresetIndex?: number;
1875
+ intraPeriod?: number;
1876
+ rcEnable?: boolean;
1877
+ intraQp?: number;
1878
+ rcInitDelay?: number;
1879
+ profile?: LoganH264Profile;
1880
+ level?: LoganH264Level;
1881
+ }
1882
+
1883
+ /** @public */
1884
+ export declare type LoganH264Level = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
1885
+
1886
+ /** @public */
1887
+ export declare type LoganH264Profile = "baseline" | "main" | "extended" | "high" | "high10";
1888
+
1889
+ /**
1890
+ * @public
1891
+ * Settings for a HEVC Encode using Netint Logan hardware
1892
+ * A detailed description of these params can be found
1893
+ * on the Netint Logan Encoder Documentation
1894
+ *
1895
+ * These fields have deliberately been written to maintain the same semantics as the
1896
+ * Logan documentation where possible.
1897
+ *
1898
+ * If left undefined, all will default to Logan's own defaults
1899
+ * */
1900
+ export declare interface LoganHevc {
1901
+ type: "logan-hevc";
1902
+ /** This (for convenience) takes the xcoder string that Logan's
1903
+ * Ffmpeg integration accepts, this is to aid developers in getting up and running
1904
+ * quickly and will override any values set manually in the rest of this interface.
1905
+ *
1906
+ * It is expected that developers will choose to use the typed fields for most things instead
1907
+ * when moving to production, as they offer a degree of validation and type safety
1908
+ * */
1909
+ extraOpts?: string;
1910
+ enableAud?: boolean;
1911
+ gpuIndex?: number;
1912
+ bitrate?: number;
1913
+ flushGop?: boolean;
1914
+ enableVfr?: boolean;
1915
+ crf?: number;
1916
+ cbr?: boolean;
1917
+ gopPresetIndex?: number;
1918
+ intraPeriod?: number;
1919
+ rcEnable?: boolean;
1920
+ intraQp?: number;
1921
+ rcInitDelay?: number;
1922
+ profile?: LoganHevcProfile;
1923
+ level?: LoganHevcLevel;
1924
+ tier?: LoganHevcTier;
1925
+ lossless?: boolean;
1926
+ hrdEnable?: boolean;
1927
+ dolbyVisionProfile?: number;
1928
+ }
1929
+
1930
+ /** @public */
1931
+ export declare type LoganHevcLevel = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
1932
+
1933
+ /** @public */
1934
+ export declare type LoganHevcProfile = "main" | "main10";
1935
+
1936
+ /** @public */
1937
+ export declare type LoganHevcTier = "main" | "high";
1938
+
1939
+ /** @public */
1940
+ export declare type LogicalCpuId = number;
1941
+
1942
+ /** @public */
1943
+ export declare type MediaNodeId = string;
1944
+
1945
+ /** @public */
1946
+ export declare class MediaNodeState {
1947
+ id: MediaNodeId | undefined;
1948
+ closeAwait?: () => void;
1949
+ closed: boolean;
1950
+ constructor(client: MediaClient);
1951
+ close(): Promise<void>;
1952
+ }
1953
+
1954
+ /** @public */
1955
+ export declare type MediaPlaylistPart = MediaSegment | AdMarker | HlsTag | ProgramDateTime | ScheduledTag;
1956
+
1957
+ /** @public */
1958
+ export declare interface MediaSegment {
1959
+ uri: string;
1960
+ duration: number;
1961
+ title: string;
1962
+ number?: number;
1963
+ }
1964
+
1965
+ /**
1966
+ * @public
1967
+ * Generate encryption parameters from from an encryption KeyID and Key,
1968
+ * in the form KEYID:KEY, both 16byte hexadecimal
1969
+ */
1970
+ export declare function mkEncryption(encryption: string | undefined, pssh?: string | undefined): EncryptionSettings | undefined;
1971
+
1972
+ /** @public */
1973
+ export declare function mkSine(freq: number): Wave;
1974
+
1975
+ /**
1976
+ * @public
1977
+ * see: {@link NorskOutput.moqEgest}
1978
+ */
1979
+ export declare class MoqEgestNode extends AutoSinkMediaNode<"audio" | "video"> {
1980
+ }
1981
+
1982
+ /**
1983
+ * @public
1984
+ * Settings to configure a Moq Egest
1985
+ * see {@link NorskOutput.moqEgest}
1986
+ */
1987
+ export declare interface MoqEgestSettings extends SinkNodeSettings<MoqEgestNode>, StreamStatisticsMixin {
1988
+ }
1989
+
1990
+ /** @public */
1991
+ export declare interface MultiStreamStatistics {
1992
+ allStreams: SingleStreamStatistics[];
1993
+ sampleSizeSeconds: number;
1994
+ /**
1995
+ * Either `"default"`, if there is only one direction, or `"input"`/`"output"`
1996
+ * (for duplex nodes, where there are two directions)
1997
+ */
1998
+ label: string;
1999
+ total: StreamStatistics;
2000
+ audio: StreamStatistics;
2001
+ video: StreamStatistics;
2002
+ }
2003
+
2004
+ /** @public */
2005
+ export declare function newSilentMatrix(rows: number, cols: number): Gain[][];
2006
+
2007
+ /**
2008
+ * @public
2009
+ * Settings common to all media nodes
2010
+ */
2011
+ export declare interface NodeSettings<T extends MediaNodeState> {
2012
+ /**
2013
+ * Media Node identifier. If one is not specified, a random identifier will be generated.
2014
+ */
2015
+ id?: string;
2016
+ /**
2017
+ * Called with any errors from the Node.
2018
+ *
2019
+ * This includes both errors which will cause the node to exit, and those that do not
2020
+ * but may e.g. indicate a connection has failed.
2021
+ */
2022
+ onError?: (error: Error) => void;
2023
+ /**
2024
+ * Called when the Node closes.
2025
+ *
2026
+ * This may be by request, because the node naturally exits or an error has occurred. See `onError`
2027
+ * to be notified of errors which may lead to the node closing.
2028
+ */
2029
+ onClose?: (() => Promise<void>) | (() => void);
2030
+ /**
2031
+ * Callback to synchronously perform an action when node creation is complete
2032
+ * (e.g. subscribe a downstream node before the first context/frame might arrive)
2033
+ */
2034
+ onCreate?: (node: T) => void;
2035
+ }
2036
+
2037
+ /**
2038
+ * @public
2039
+ * The entrypoint for all Norsk Media applications
2040
+ *
2041
+ * @example
2042
+ * ```ts
2043
+ * const norsk = new Norsk();
2044
+ * ```
2045
+ */
2046
+ export declare class Norsk {
2047
+ /**
2048
+ * Implements the {@link NorskInput} interface
2049
+ */
2050
+ input: NorskInput;
2051
+ /**
2052
+ * Implements the {@link NorskOutput} interface
2053
+ */
2054
+ output: NorskOutput;
2055
+ /**
2056
+ * Implements the {@link NorskDuplex} interface
2057
+ */
2058
+ duplex: NorskDuplex;
2059
+ /**
2060
+ * Implements the {@link NorskProcessor} interface
2061
+ */
2062
+ processor: NorskProcessor;
2063
+ /**
2064
+ * Implements the {@link NorskDebug} interface
2065
+ */
2066
+ debug: NorskDebug;
2067
+ /**
2068
+ * Implements the {@link NorskSystem} interface
2069
+ */
2070
+ system: NorskSystem;
2071
+ /**
2072
+ * Norsk Runtime version information
2073
+ */
2074
+ version: Version;
2075
+ close(): Promise<void>;
2076
+ /** @public */
2077
+ static connect(settings?: NorskSettings): Promise<Norsk>;
2078
+ }
2079
+
2080
+ /**
2081
+ * @public
2082
+ * Methods that allow you to control and monitor media streams
2083
+ */
2084
+ export declare interface NorskControl {
2085
+ /**
2086
+ * Switch between multiple input sources via a hard cut. May be used to switch between
2087
+ * sources of possibly different configurations or without decoding.
2088
+ * @param settings - Options for the switcher
2089
+ */
2090
+ streamSwitchHard<Pins extends string>(settings: StreamSwitchHardSettings<Pins>): Promise<StreamSwitchHardNode<Pins>>;
2091
+ /**
2092
+ * Switch between multiple input sources without interruption, via a transition.
2093
+ * @param settings - Options for the switcher
2094
+ */
2095
+ streamSwitchSmooth<Pins extends string>(settings: StreamSwitchSmoothSettings<Pins>): Promise<StreamSwitchSmoothNode<Pins>>;
2096
+ /**
2097
+ * Record statistical information about media streams, including bitrate,
2098
+ * frame rate, and number of keyframes, measured over some configurable
2099
+ * sampling windows.
2100
+ *
2101
+ * Corresponding settings are found on many input and output nodes.
2102
+ * @param settings - Callback and sampling intervals
2103
+ */
2104
+ streamStatistics(settings: StreamStatisticsSettings): Promise<StreamStatisticsNode>;
2105
+ /**
2106
+ * Monitor the volume of an audio stream
2107
+ * @param settings - Callback and options for the level data
2108
+ */
2109
+ audioMeasureLevels(settings: AudioMeasureLevelsSettings): Promise<AudioMeasureLevelsNode>;
2110
+ }
2111
+
2112
+ /**
2113
+ * @public
2114
+ * Methods that allow you to inspect a system (typically during development)
2115
+ */
2116
+ export declare interface NorskDebug {
2117
+ /** Creates a node to intercept all the timestamps of any subscribed stream
2118
+ * @param settings - Configuration for the report node
2119
+ */
2120
+ streamTimestampReport(settings: StreamTimestampReportSettings): Promise<StreamTimestampReportNode>;
2121
+ }
2122
+
2123
+ /**
2124
+ * @public
2125
+ * Methods that allow you to both ingest and egest media from your application
2126
+ * at the same time
2127
+ */
2128
+ export declare interface NorskDuplex {
2129
+ /**
2130
+ * Playback audio/video via webrtc to a browser, and accept audio/video input from a browser.
2131
+ * The browser client must conform to a custom protocol as implemented in the hosted test page.
2132
+ * (Available from {@link WebRTCBrowserNode.playerUrl}
2133
+ * For general WebRTC ingest prefer the WHIP input node, and for egest to a downstream media server
2134
+ * use the WHIP output node.
2135
+ * @param settings - Options for the webrtc node
2136
+ */
2137
+ webRtcBrowser(settings: WebRTCBrowserSettings): Promise<WebRTCBrowserNode>;
2138
+ }
2139
+
2140
+ /** @public */
2141
+ export declare function norskHost(): string;
2142
+
2143
+ /**
2144
+ * @public
2145
+ * Methods that allow you to ingest media into your application
2146
+ */
2147
+ export declare interface NorskInput {
2148
+ /** Create an RTMP Server to receive RTMP streams into your application
2149
+ * @param settings - Configuration for the RTMP server
2150
+ */
2151
+ rtmpServer(settings: RtmpServerInputSettings): Promise<RtmpServerInputNode>;
2152
+ /**
2153
+ * Read from a Transport Stream file with realtime playback.
2154
+ * @param settings - Configuration for the file input
2155
+ */
2156
+ fileTs(settings: FileTsInputSettings): Promise<FileTsInputNode>;
2157
+ /**
2158
+ * Stream from a SRT source
2159
+ * @param settings - Configuration for the SRT input
2160
+ */
2161
+ srt(settings: SrtInputSettings): Promise<SrtInputNode>;
2162
+ /**
2163
+ * Receive media via WebRTC via the WHIP standard.
2164
+ *
2165
+ * Here Norsk acts as the Media Server receiving from a remote WHIP client, to act as the
2166
+ * WHIP client sending to a remote media server see {@link NorskOutput.whip}. For a duplex
2167
+ * connection to a browser peer see {@link NorskDuplex.webRtcBrowser}.
2168
+ *
2169
+ * @param settings - Configuration for the WHIP input
2170
+ */
2171
+ whip(settings: WhipInputSettings): Promise<WhipInputNode>;
2172
+ /**
2173
+ * Read from a Transport Stream on the network
2174
+ * This can be multicast/unicast or broadcast
2175
+ * @param settings - Configuration for the UDP input
2176
+ */
2177
+ udpTs(settings: UdpTsInputSettings): Promise<UdpTsInputNode>;
2178
+ fileWebVtt(settings: LocalFileInputSettings): Promise<FileWebVttInputNode>;
2179
+ /**
2180
+ * Read an image from a file. Various image formats are supported, see the
2181
+ * documentation for {@link FileImageInputSettings} for more details.
2182
+ * @param settings - Configuration for the file input
2183
+ *
2184
+ * The image will then be provided into Norsk as a video at 25fps for use
2185
+ * in other operations
2186
+ */
2187
+ fileImage(settings: FileImageInputSettings): Promise<FileImageInputNode>;
2188
+ /**
2189
+ * Read a MP4 (fragmented or not) from a file with realtime playback.
2190
+ * This will not play frames that are written to the file after the node
2191
+ * starts.
2192
+ * @param settings - Configuration for the file input
2193
+ */
2194
+ fileMp4(settings: FileMp4InputSettings): Promise<FileMp4InputNode>;
2195
+ /**
2196
+ * Stream from a remote RTP source
2197
+ *
2198
+ * Note that MPEG-TS sources encapsulated in RTP should use the {@link NorskInput.udpTs} input with appropriate config.
2199
+ * @param settings - Configuration for the RTP input
2200
+ */
2201
+ rtp(settings: RtpInputSettings): Promise<RtpInputNode>;
2202
+ /**
2203
+ * Generate a test video card with a configurable pattern.
2204
+ * @param settings - Configuration for the video test card
2205
+ */
2206
+ videoTestCard(settings: VideoTestcardGeneratorSettings): Promise<VideoTestcardGeneratorNode>;
2207
+ /**
2208
+ * Generate a test audio signal with a configurable waveform.
2209
+ * @param settings - Configuration for the audio signal
2210
+ */
2211
+ audioSignal(settings: AudioSignalGeneratorSettings): Promise<AudioSignalGeneratorNode>;
2212
+ /**
2213
+ * Generates a video source by rendering an HTML page
2214
+ * @param settings - Settings for the web page
2215
+ */
2216
+ browser(settings: BrowserInputSettings): Promise<BrowserInputNode>;
2217
+ /**
2218
+ * SDI/HDMI Input using a BlackMagic DeckLink card.
2219
+ * The available cards on the machine can be enumerated using the {@link NorskSystem.hardwareInfo} API.
2220
+ *
2221
+ * Multiple cards and both SDI and HDMI inputs are supported, with all DeckLink-supported
2222
+ * input resolutions and framerates are supported. The capture format is currently 8-bit only,
2223
+ * but 10-bit captures will be supported soon. All supported audio channels can be captured.
2224
+ * At present, additional data such as closed-captions and HDR metadata is not captured.
2225
+ * @param settings - Settings for the SDI capture
2226
+ */
2227
+ deckLink(settings: DeckLinkInputSettings): Promise<DeckLinkInputNode>;
2228
+ /**
2229
+ * Playback from an existing Frame Store recording
2230
+ */
2231
+ frameStorePlayer(settings: FrameStorePlayerSettings): Promise<FrameStorePlayerNode>;
2232
+ }
2233
+
2234
+ /**
2235
+ * @public
2236
+ * Methods that allow you to egest media from your application
2237
+ */
2238
+ export declare interface NorskOutput {
2239
+ /**
2240
+ * Produces video segments with the supplied settings for use in
2241
+ * HLS or DASH manifests.
2242
+ *
2243
+ * These can optionally be served the Norsk web server or be pushed
2244
+ * to other locations - see {@link CmafDestinationSettings}
2245
+ *
2246
+ * @param settings - Configuration for the CMAF Video Stream
2247
+ */
2248
+ cmafVideo(settings: CmafOutputSettings): Promise<CmafVideoOutputNode>;
2249
+ /**
2250
+ * Produces audio segments with the supplied settings for use in
2251
+ * HLS or DASH manifests.
2252
+ *
2253
+ * These can optionally be served via the Norsk web server or be pushed
2254
+ * to other locations - see {@link CmafDestinationSettings}
2255
+ *
2256
+ * @param settings - Configuration for the CMAF Audio Stream
2257
+ */
2258
+ cmafAudio(settings: CmafOutputSettings): Promise<CmafAudioOutputNode>;
2259
+ /**
2260
+ * Produces WebVTT segments with the supplied settings for use in
2261
+ * HLS or DASH manifests. These are served via the Norsk web server
2262
+ *
2263
+ * @param settings - Configuration for the CMAF WebVTT Stream
2264
+ */
2265
+ cmafWebVtt(settings: CmafWebVttOutputSettings): Promise<CmafWebVttOutputNode>;
2266
+ /**
2267
+ * Produces a multi variant (used to be known as master) hls and/or dash manifest for a collection of media streams
2268
+ *
2269
+ * This can optionally be served via the Norsk web server or be pushed
2270
+ * to other locations - see {@link CmafDestinationSettings}
2271
+ *
2272
+ * @param settings - Configuration for the CMAF Multi Variant Manifest
2273
+ */
2274
+ cmafMultiVariant(settings: CmafMultiVariantOutputSettings): Promise<CmafMultiVariantOutputNode>;
2275
+ /**
2276
+ * Produces Transport Stream video segments with the supplied settings for use in
2277
+ * HLS manifests and builds a playlist served locally from the Norsk Web Server
2278
+ * or from other locations - see {@link CmafDestinationSettings}
2279
+ *
2280
+ * @param settings - Configuration for the HLS TS Stream
2281
+ */
2282
+ hlsTsVideo(settings: HlsTsVideoOutputSettings): Promise<HlsTsVideoOutputNode>;
2283
+ /**
2284
+ * Produces Transport Stream audio segments with the supplied settings for use in
2285
+ * HLS manifests and builds a playlist served locally from the Norsk Web Server
2286
+ * or from other locations - see {@link CmafDestinationSettings}
2287
+ *
2288
+ * @param settings - Configuration for the HLS TS Stream
2289
+ */
2290
+ hlsTsAudio(settings: HlsTsAudioOutputSettings): Promise<HlsTsAudioOutputNode>;
2291
+ /**
2292
+ * Produces Transport Stream segments containing both video and audio with the supplied settings for use in
2293
+ * HLS manifests and pushes them to the configured location (see {@link CmafDestinationSettings})
2294
+ *
2295
+ * @param settings - Configuration for the HLS TS Stream
2296
+ */
2297
+ hlsTsCombinedPush(settings: HlsTsCombinedPushOutputSettings): Promise<HlsTsCombinedPushOutputNode>;
2298
+ /**
2299
+ * Produces a multi variant HLS TS manifest for a collection of media streams
2300
+ *
2301
+ * This can optionally be served via the Norsk web server or be pushed
2302
+ * to other locations - see {@link CmafDestinationSettings}
2303
+ *
2304
+ * @param settings - Configuration for the Hls Ts Multivariant Playlist
2305
+ */
2306
+ hlsTsMultiVariant(settings: HlsTsMultiVariantOutputSettings): Promise<HlsTsMultiVariantOutputNode>;
2307
+ /**
2308
+ * Produces a Transport Stream optionally containing both video and audio
2309
+ * and sends it out over UDP
2310
+ *
2311
+ * @param settings - Configuration for the TS Stream
2312
+ */
2313
+ udpTs(settings: UdpTsOutputSettings): Promise<UdpTsOutputNode>;
2314
+ /**
2315
+ * Produces a Transport Stream, and allows Norsk to either connect to an existing
2316
+ * SRT server or act as an SRT server itself
2317
+ *
2318
+ * @param settings - Configuration for the SRT Stream
2319
+ */
2320
+ srt(settings: SrtOutputSettings): Promise<SrtOutputNode>;
2321
+ /**
2322
+ * Connects and sends media to a remote server via WebRTC using the WHIP standard.
2323
+ *
2324
+ * Here Norsk acts as the WHIP client sending to a remote Media Server; to
2325
+ * have Norsk act as the Media Server ingesting from some other WHIP client, see
2326
+ * {@link NorskInput.whip}
2327
+ *
2328
+ * @param settings - Configuration for the WebRTC Stream
2329
+ */
2330
+ whip(settings: WhipOutputSettings): Promise<WhipOutputNode>;
2331
+ /**
2332
+ * Hosts media for clients connecting via WebRTC using the WHEP standard.
2333
+ *
2334
+ * To send media to a remote Media Server via WebRTC see {@link NorskOutput.whip}.
2335
+ * See also {@link NorskInput.whip}, {@link NorskDuplex.webRtcBrowser}.
2336
+ *
2337
+ * @param settings - Configuration for the WebRTC Stream
2338
+ */
2339
+ whep(settings: WhepOutputSettings): Promise<WhepOutputNode>;
2340
+ /**
2341
+ * Connects and sends media to a remote RTMP server
2342
+ *
2343
+ * @param settings - Configuration for the WebRTC Stream
2344
+ */
2345
+ rtmp(settings: RtmpOutputSettings): Promise<RtmpOutputNode>;
2346
+ /**
2347
+ * Stream to a Transport Stream file.
2348
+ *
2349
+ * @param settings - Configuration for the Transport Stream output
2350
+ */
2351
+ fileTs(settings: FileTsOutputSettings): Promise<FileTsOutputNode>;
2352
+ /**
2353
+ * Output MP4 files to disk, both fragmented and non-fragmented.
2354
+ *
2355
+ * The fragmented output is required.
2356
+ *
2357
+ * The optional non-fragmented filename will be written when calling
2358
+ * {@link FileMp4OutputNode.close} and will be fully written by the time
2359
+ * {@link NodeSettings.onClose} is called. This sets up a temp file to
2360
+ * store the frame data by appending the extension `.tmp`.
2361
+ *
2362
+ * A non-fragmented MP4 file can be written on request with
2363
+ * {@link FileMp4OutputNode.writeFile}, which uses the frame data store if
2364
+ * {@link FileMp4OutputSettings.nonfragmentedFileName} was given or reads
2365
+ * back the fragmented mp4 if there is no non-fragmented file.
2366
+ *
2367
+ * @param settings - Configuration for the MP4 output.
2368
+ */
2369
+ fileMp4(settings: FileMp4OutputSettings): Promise<FileMp4OutputNode>;
2370
+ /**
2371
+ * Create a frame store recording
2372
+ *
2373
+ * @param settings - Configuration for the frame store recorder
2374
+ */
2375
+ frameStoreRecording(settings: FrameStoreRecorderSettings): Promise<FrameStoreRecorderNode>;
2376
+ /**
2377
+ * Create a Moq Egest
2378
+ *
2379
+ * @param settings - Configuration for the egest
2380
+ */
2381
+ moqEgest(settings: MoqEgestSettings): Promise<MoqEgestNode>;
2382
+ }
2383
+
2384
+ /** @public */
2385
+ export declare function norskPort(): string;
2386
+
2387
+ /** @public */
2388
+ export declare class NorskProcessor {
2389
+ /**
2390
+ * Implements the {@link NorskControl} interface
2391
+ */
2392
+ control: NorskControl;
2393
+ /**
2394
+ * Implements the {@link NorskTransform} interface
2395
+ */
2396
+ transform: NorskTransform;
2397
+ close(): Promise<void>;
2398
+ constructor(client: MediaClient);
2399
+ }
2400
+
2401
+ /**
2402
+ * @public
2403
+ * Top level Norsk configuration
2404
+ */
2405
+ export declare interface NorskSettings {
2406
+ /**
2407
+ * Callback URL to listen on for gRPC session with Norsk Media
2408
+ * Defaults to $NORSK_HOST:$NORSK_PORT if the environment variables are set
2409
+ * where NORSK_HOST defaults to "127.0.0.1" and NORSK_PORT to "6790"
2410
+ * (so "127.0.0.1:6790" if neither variable is set)
2411
+ */
2412
+ url?: string;
2413
+ onAttemptingToConnect?: () => void;
2414
+ onConnecting?: () => void;
2415
+ onReady?: () => void;
2416
+ onFailedToConnect?: () => void;
2417
+ /** Code to execute if the Norsk node is shutdown - by default it logs and nothing else */
2418
+ onShutdown?: () => void;
2419
+ onCurrentLoad?: (load: CurrentLoad) => void;
2420
+ onHello?: (version: Version) => void;
2421
+ onLogEvent?: (log: Log) => void;
2422
+ /**
2423
+ * Manually handle license events, such as missing/invalid licenses and
2424
+ * sandbox timeout. (Logs messages to console by default.)
2425
+ */
2426
+ onLicenseEvent?: (message: string) => void;
2427
+ }
2428
+
2429
+ /**
2430
+ * @public
2431
+ * Methods that allow you query the features of the system that Norsk is running in
2432
+ */
2433
+ export declare interface NorskSystem {
2434
+ hardwareInfo(): Promise<HardwareInfo>;
2435
+ }
2436
+
2437
+ /**
2438
+ * @public
2439
+ * Methods that allow you to manipulate your media streams
2440
+ */
2441
+ export declare interface NorskTransform {
2442
+ /**
2443
+ * Encode a video stream to one or more renditions
2444
+ * using either software or appropriate hardware if available
2445
+ * @param settings - Encode ladder settings
2446
+ */
2447
+ videoEncode(settings: VideoEncodeSettings): Promise<VideoEncodeNode>;
2448
+ /**
2449
+ * Transform a single video stream (rescale, frame rate, etc)
2450
+ * @param settings - Transform settings
2451
+ */
2452
+ videoTransform(settings: VideoTransformSettings): Promise<VideoTransformNode>;
2453
+ /**
2454
+ * Interferes with a stream by dropping frames
2455
+ * Why would you want this? Stick one of these after a decoder and before
2456
+ * anything else in order to simulate what the world is going to look like if you
2457
+ * have network problems (packet drops for example) in your ingest
2458
+ *
2459
+ * *Just don't forget to remove it again when you've finished testing!*
2460
+ * @param settings - Chaos monkey settings
2461
+ */
2462
+ streamChaosMonkey(settings: StreamChaosMonkeySettings): Promise<StreamChaosMonkeyNode>;
2463
+ /**
2464
+ * Compose multiple video streams together into a single output
2465
+ * @param settings - Composition settings
2466
+ */
2467
+ videoCompose<Pins extends string>(settings: VideoComposeSettings<Pins> | DeferredVideoComposeSettings<Pins>): Promise<VideoComposeNode<Pins>>;
2468
+ /**
2469
+ * Create a Media Node performing transcription into subtitles using the
2470
+ * Amazon Transcribe AWS service.
2471
+ * @param settings - Settings and credentials for AWS transcribe
2472
+ */
2473
+ audioTranscribeAws(settings: AudioTranscribeAwsSettings): Promise<AudioTranscribeAwsNode>;
2474
+ /**
2475
+ * Create a Media Node performing transcription into subtitles using the
2476
+ * Azure Speech service.
2477
+ * @param settings - Settings and credentials for Azure transcribe
2478
+ */
2479
+ audioTranscribeAzure(settings: AudioTranscribeAzureSettings): Promise<AudioTranscribeAzureNode>;
2480
+ /**
2481
+ * Create a Media Node performing transcription into subtitles using the
2482
+ * Whisper speech recognition model.
2483
+ * @param settings - Settings and credentials for Whisper transcribe
2484
+ */
2485
+ audioTranscribeWhisper(settings: AudioTranscribeWhisperSettings): Promise<AudioTranscribeWhisperNode>;
2486
+ /**
2487
+ * Mix multiple audio streams together into a single output,
2488
+ * with optional gain control on each input.
2489
+ * @param settings - Settings for the mixer, including the gain vectors
2490
+ */
2491
+ audioMix<Pins extends string>(settings: AudioMixSettings<Pins>): Promise<AudioMixNode<Pins>>;
2492
+ /**
2493
+ * Given an audio stream of N channels, mix it down to M channels through a matrix of NxM gains.
2494
+ * @param settings - Settings for the mixer, including the gain matrix
2495
+ */
2496
+ audioMixMatrix(settings: AudioMixMatrixSettings): Promise<AudioMixMatrixNode>;
2497
+ /**
2498
+ * Apply gain to an audio stream
2499
+ * @param settings - Settings for the gain node
2500
+ */
2501
+ audioGain(settings: AudioGainSettings): Promise<AudioGainNode>;
2502
+ /**
2503
+ * Aggregate many single-channel audio streams into a stream with the
2504
+ * specified channel layout. The streams must all have the same sample format
2505
+ * and sample rate. The order of the streams provided for the channels is
2506
+ * important.
2507
+ * @param settings - Settings for the builder, including the channel layout
2508
+ * and stream keys specifying the sources for each channel.
2509
+ */
2510
+ audioBuildMultichannel(settings: AudioBuildMultichannelSettings): Promise<AudioBuildMultichannelNode>;
2511
+ /**
2512
+ * Split a multichannel audio stream into its individual channels. The first
2513
+ * channel receives the specified stream key, and each subsequent channel
2514
+ * increments the stream id on the stream key.
2515
+ * @param settings - Settings for the splitter
2516
+ */
2517
+ audioSplitMultichannel(settings: AudioSplitMultichannelSettings): Promise<AudioSplitMultichannelNode>;
2518
+ /**
2519
+ * Encode an audio stream.
2520
+ * @param settings - Settings for the encoder, including channel layout and
2521
+ * bitrate.
2522
+ */
2523
+ audioEncode(settings: AudioEncodeSettings): Promise<AudioEncodeNode>;
2524
+ /**
2525
+ * A node to nudge the timestamps on a stream, which affects how it syncs
2526
+ * with other streams. Useful for correcting for drift between different
2527
+ * sources.
2528
+ *
2529
+ * Subsequent nudges, via the `nudge` method, are applied gradually.
2530
+ *
2531
+ * This functionality is also provided by a `nudge` method on many sources.
2532
+ * @param settings - Initial nudge plus general node settings.
2533
+ */
2534
+ streamTimestampNudge(settings: StreamTimestampNudgeSettings): Promise<StreamTimestampNudgeNode>;
2535
+ /**
2536
+ * Provide a new stream key for a single stream. Cannot be subscribed to
2537
+ * multiple streams at once.
2538
+ *
2539
+ * The stream key is used for identifying streams within multiplexed sources
2540
+ * and also is translated into URIs for HLS playlists and other resources.
2541
+ *
2542
+ * This can be useful if changing sources and wanting to maintain a consistent
2543
+ * streamkey going into an output
2544
+ * @param settings - New stream key plus general node settings.
2545
+ */
2546
+ streamKeyOverride(settings: StreamKeyOverrideSettings): Promise<StreamKeyOverrideNode>;
2547
+ /**
2548
+ * Override bitrate and language metadata on streams.
2549
+ *
2550
+ * Audio and video bitrate metadata is required for playlists for the
2551
+ * {@link NorskOutput.cmafMultiVariant} node.
2552
+ * It is automatically configured for some sources (like RTMP) and in
2553
+ * cases where re-encoding is done, but is unset for other sources (like SRT).
2554
+ * @param settings - Bitrate and language metadata plus general node settings.
2555
+ */
2556
+ streamMetadataOverride(settings: StreamMetadataOverrideSettings): Promise<StreamMetadataOverrideNode>;
2557
+ /**
2558
+ * Buffer a stream for the specified number of milliseconds. This can be used
2559
+ * to reduce or eliminate jitter.
2560
+ * @param settings - Buffer delay time.
2561
+ */
2562
+ jitterBuffer(settings: JitterBufferSettings): Promise<JitterBufferNode>;
2563
+ /**
2564
+ * Sync multiple streams together by timestamps, queuing frames from streams
2565
+ * that are behind the others. This is already included in most nodes,
2566
+ * especially outputs.
2567
+ */
2568
+ streamSync(settings: StreamSyncSettings): Promise<StreamSyncNode>;
2569
+ /**
2570
+ * This processor does multiple things
2571
+ * - joins together multiple streams from multiple sources
2572
+ * - rebases their timestamps so that they all start at the same point
2573
+ * - sets the program id to a common value
2574
+ *
2575
+ * It is useful for syncing multiple incoming streams that on paper are already synchronised but because
2576
+ * of the time taken to set up connections and subscriptions across various protocols, are off by a few
2577
+ * hundred milliseconds
2578
+ */
2579
+ streamAlign(settings: StreamAlignSettings): Promise<StreamAlignNode>;
2580
+ ancillary(settings: AncillarySettings): Promise<AncillaryNode>;
2581
+ }
2582
+
2583
+ /** @public */
2584
+ export declare interface NumaNode {
2585
+ processors: Processor[];
2586
+ }
2587
+
2588
+ /**
2589
+ * @public
2590
+ * Settings for a H264 Encode using Nvidia hardware
2591
+ * A detailed description of these params can be found
2592
+ * on the Nvidia Encoder Documentation
2593
+ *
2594
+ * If left undefined, all will default to Nvidia's own defaults
2595
+ * If a preset is configured, then all will default to the values provided
2596
+ * by that preset
2597
+ * */
2598
+ export declare interface NvidiaH264 {
2599
+ type: "nv-h264";
2600
+ /** The preset to use for this encode */
2601
+ preset?: NvidiaPreset;
2602
+ /** The IDR period */
2603
+ idrPeriod?: number;
2604
+ /**The gopInterval to use for this encode
2605
+ * Note: This is different from the idrPeriod but usually you want
2606
+ * them set to the same value regardless
2607
+ * */
2608
+ gopInterval?: number;
2609
+ /** This is the gop structure to be used, and again it's best to look this up
2610
+ * in the Nvidia documentation
2611
+ * */
2612
+ frameIntervalP?: number;
2613
+ /** This is somewhat related to the gop structure and again, care should be taken when overriding this from
2614
+ * the preset */
2615
+ maxNumRefFrames?: number;
2616
+ /** The target level of this H264 encode
2617
+ * Note: The behaviour of Nvidia is to error out if this is incompatible with the other settings
2618
+ * this differs from other codecs which just silently change the outgoing level/profile for example */
2619
+ level?: NvidiaH264Level;
2620
+ /** The target profile of this H264 encode
2621
+ * Note: The behaviour of Nvidia is to error out if this is incompatible with the other settings
2622
+ * this differs from other codecs which just silently change the outgoing level/profile for example */
2623
+ profile?: NvidiaH264Profile;
2624
+ /** Output Access Unit Delimiters */
2625
+ outputAud?: boolean;
2626
+ /** Rate Control Settings */
2627
+ rateControl?: NvidiaRateControl;
2628
+ }
2629
+
2630
+ /**
2631
+ * @public
2632
+ * See the Nvidia Encoder Docs for a description of this value
2633
+ * */
2634
+ export declare type NvidiaH264Level = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
2635
+
2636
+ /**
2637
+ * @public
2638
+ * See the Nvidia Encoder Docs for a description of this value
2639
+ * */
2640
+ export declare type NvidiaH264Profile = "baseline" | "main" | "high" | "high444";
2641
+
2642
+ /**
2643
+ * @public
2644
+ * Settings for a HEVC Encode using Nvidia hardware
2645
+ * A detailed description of these params can be found
2646
+ * on the Nvidia Encoder Documentation
2647
+ *
2648
+ * If left undefined, all will default to Nvidia's own defaults
2649
+ * If a preset is configured, then all will default to the values provided
2650
+ * by that preset
2651
+ * */
2652
+ export declare interface NvidiaHevc {
2653
+ type: "nv-hevc";
2654
+ /** The preset to use for this encode */
2655
+ preset?: NvidiaPreset;
2656
+ /** The IDR period */
2657
+ idrPeriod?: number;
2658
+ /**The gopInterval to use for this encode
2659
+ * Note: This is different from the idrPeriod but usually you want
2660
+ * them set to the same value regardless
2661
+ * */
2662
+ gopInterval?: number;
2663
+ /** This is the gop structure to be used, and again it's best to look this up
2664
+ * in the Nvidia documentation
2665
+ * */
2666
+ frameIntervalP?: number;
2667
+ /** The target level of this HEVC encode
2668
+ * Note: The behaviour of Nvidia is to error out if this is incompatible with the other settings
2669
+ * this differs from other codecs which just silently change the outgoing level/profile for example */
2670
+ level?: NvidiaHevcLevel;
2671
+ /** The target profile of this HEVC encode
2672
+ * Note: The behaviour of Nvidia is to error out if this is incompatible with the other settings
2673
+ * this differs from other codecs which just silently change the outgoing level/profile for example */
2674
+ profile?: NvidiaHevcProfile;
2675
+ /** Output Access Unit Delimiters */
2676
+ outputAud?: boolean;
2677
+ /** The target tier of this HEVC encode
2678
+ * Note: The behaviour of Nvidia is to error out if this is incompatible with the other settings
2679
+ * this differs from other codecs which just silently change the outgoing level/profile for example */
2680
+ tier?: NvidiaHevcTier;
2681
+ /** Rate Control Settings */
2682
+ rateControl?: NvidiaRateControl;
2683
+ }
2684
+
2685
+ /**
2686
+ * @public
2687
+ * See the Nvidia Encoder Docs for a description of this value
2688
+ * */
2689
+ export declare type NvidiaHevcLevel = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
2690
+
2691
+ /**
2692
+ * @public
2693
+ * See the Nvidia Encoder Docs for a description of this value
2694
+ * */
2695
+ export declare type NvidiaHevcProfile = "main" | "main10";
2696
+
2697
+ /**
2698
+ * @public
2699
+ * See the Nvidia Encoder Docs for a description of this value
2700
+ * */
2701
+ export declare type NvidiaHevcTier = "main" | "high";
2702
+
2703
+ /**
2704
+ * @public
2705
+ * See the Nvidia Encoder Docs for a description of this value
2706
+ * */
2707
+ export declare type NvidiaPreset = "p1" | "p2" | "p3" | "p4" | "p5" | "p6" | "p7";
2708
+
2709
+ /**
2710
+ * @public
2711
+ * The rate control options for an nvidia encode
2712
+ * For further info, consult the Nvidia Encoder docs
2713
+ * */
2714
+ export declare interface NvidiaRateControl {
2715
+ /** the mode to use for this rate control operation */
2716
+ mode: NvidiaRateControlMode;
2717
+ /** The average bitrate of this encode */
2718
+ averageBitrate: number;
2719
+ /** The max bitrate of this encode */
2720
+ maxBitrate?: number;
2721
+ /** The vbv buffer size used for this encode */
2722
+ vbvBufferSize?: number;
2723
+ /** The vbv initial delay used for this encode */
2724
+ vbvInitialDelay?: number;
2725
+ /** Enable lookahead or not:
2726
+ * Note: enabling lookahead will introduce scene cuts unless this is specifically disabled
2727
+ * elswhere in the codec settings
2728
+ * */
2729
+ enableLookahead?: boolean;
2730
+ strictGopTarget?: boolean;
2731
+ lookaheadDepth?: number;
2732
+ }
2733
+
2734
+ /**
2735
+ * @public
2736
+ * See the Nvidia Encoder Docs for a description of this value
2737
+ * */
2738
+ export declare type NvidiaRateControlMode = "con_stqp" | "vbr" | "cbr";
2739
+
2740
+ /**
2741
+ * @public
2742
+ * A rectangle used for describing a subset of an image
2743
+ * */
2744
+ export declare interface OffsetRect {
2745
+ /** The leftmost coordinate of the rect, where 0,0 is top left */
2746
+ x: number;
2747
+ /** The topmost coordinate of the rect, where 0,0 is top left */
2748
+ y: number;
2749
+ /** the width of this rectangle */
2750
+ width: number;
2751
+ /** the height of this rectangle */
2752
+ height: number;
2753
+ }
2754
+
2755
+ /**
2756
+ * @public
2757
+ * Return type to enable control of an RTMP stream once media arrives on it
2758
+ */
2759
+ export declare type OnStreamResult =
2760
+ /** Accept the stream */
2761
+ {
2762
+ accept: true;
2763
+ videoStreamKey: StreamKey_2 | StreamKeySettings;
2764
+ audioStreamKey: StreamKey_2 | StreamKeySettings;
2765
+ }
2766
+ /** Reject the stream */
2767
+ | {
2768
+ accept: false;
2769
+ reason: string;
2770
+ };
2771
+
2772
+ /**
2773
+ * @public
2774
+ * Settings for an Opus encode
2775
+ * see: {@link NorskTransform.audioEncode}
2776
+ * */
2777
+ export declare interface OpusSettings {
2778
+ kind: "opus";
2779
+ }
2780
+
2781
+ /** @public
2782
+ * A transition for a video composition part.
2783
+ *
2784
+ * A transition interpolates the source_rect, dest_rect, and opacity properties
2785
+ * over the specified duration according to the specified easing function.
2786
+ *
2787
+ * As a special case, if a transition is specified and the input pin of the part
2788
+ * changes, an opacity fade from one to the other will occur.
2789
+ */
2790
+ export declare interface PartTransition {
2791
+ /** Duration for the transition */
2792
+ durationMs: number;
2793
+ /**
2794
+ * Easing function to apply to the transition. If not specified will be
2795
+ * linear.
2796
+ */
2797
+ easing?: SimpleEasing;
2798
+ }
2799
+
2800
+ declare type Pattern = "black" | "smpte75" | "smpte100";
2801
+
2802
+ /** @public */
2803
+ export declare type PinToKey<Pins extends string> = Nullable<Partial<Record<Pins, StreamKey[]>>>;
2804
+
2805
+ /** @public */
2806
+ export declare type PixelFormat = "bgra" | "rgba" | "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuva422p" | "yuva444p";
2807
+
2808
+ /** @public */
2809
+ export declare type PlaylistOnChangeFn<ClientMessage> = {
2810
+ cmafMediaPlaylist?: (grpcStream: grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, destinationId: DestinationId, additions: HlsPlaylistAdditions, playlistWithAdditions: HlsPlaylist) => void;
2811
+ tsMediaPlaylist?: (grpcStream: grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, destinationId: DestinationId, additions: TsPlaylistAdditions, playlistWithAdditions: MediaPlaylistPart[]) => void;
2812
+ cmafMultiVariantPlaylist?: (grpcStream: grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, destinationId: DestinationId, playlist: CmafMultiVariantPlaylistData) => void;
2813
+ hlsTsMultiVariantPlaylist?: (grpcStream: grpc.ClientDuplexStream<ClientMessage, HlsOutputEvent>, destinationId: DestinationId, playlist: string) => void;
2814
+ };
2815
+
2816
+ /** @public */
2817
+ declare enum PlaylistPath {
2818
+ Cmaf = 0,
2819
+ Ts = 1
2820
+ }
2821
+
2822
+ /**
2823
+ * @public
2824
+ * Returns the stream keys for playlist streams in a media context
2825
+ * @param streams - The media context from which to return the stream keys
2826
+ * @returns The playlist stream keys in the media context
2827
+ */
2828
+ export declare function playlistStreamKeys(streams: readonly StreamMetadata[]): StreamKey[];
2829
+
2830
+ /** @public */
2831
+ export declare interface PlaylistStreamMetadata {
2832
+ }
2833
+
2834
+ /**
2835
+ * @public
2836
+ * Filters a context to only the playlist streams within it
2837
+ * @param streams - The media context from which to return the streams
2838
+ * @returns The playlist streams in the media context
2839
+ */
2840
+ export declare function playlistStreams(streams: readonly StreamMetadata[]): StreamMetadata[];
2841
+
2842
+ /** @public */
2843
+ export declare interface Processor {
2844
+ cores: Core[];
2845
+ }
2846
+
2847
+ export declare interface ProcessorMediaNode<Pins extends string> extends SourceMediaNode, AutoSinkMediaNode<Pins> {
2848
+ }
2849
+
2850
+ export declare class ProcessorMediaNode<Pins extends string> {
2851
+ constructor(client: MediaClient, unregisterNode: (node: MediaNodeState) => void, getGrpcStream: () => (Readable | Writable), subscribeFn: (subscription: Subscription) => Promise<boolean>, subscribeErrorFn?: (error: SubscriptionError) => void, subscribedStreamsChangedFn?: (streams: StreamMetadata[]) => void);
2852
+ }
2853
+
2854
+ /** @public */
2855
+ export declare interface ProcessorNodeSettings<T extends MediaNodeState> extends SinkNodeSettings<T>, SourceNodeSettings<T> {
2856
+ }
2857
+
2858
+ /** @public */
2859
+ export declare interface ProgramDateTime {
2860
+ programDateTime: Date;
2861
+ }
2862
+
2863
+ /** @public */
2864
+ export declare function publicUrlPrefix(): string;
2865
+
2866
+ /**
2867
+ * @public
2868
+ * Settings for a H264 Encode using Netint Quadra hardware
2869
+ * A detailed description of these params can be found
2870
+ * on the Netint Quadra Encoder Documentation
2871
+ *
2872
+ * These fields have deliberately been written to maintain the same semantics as the
2873
+ * Quadra documentation where possible.
2874
+ *
2875
+ * If left undefined, all will default to Quadra's own defaults
2876
+ * */
2877
+ export declare interface QuadraH264 {
2878
+ type: "quadra-h264";
2879
+ /** This (for convenience) takes the xcoder string that Quadra's
2880
+ * Ffmpeg integration accepts, this is to aid developers in getting up and running
2881
+ * quickly and will override any values set manually in the rest of this interface.
2882
+ *
2883
+ * It is expected that developers will choose to use the typed fields for most things instead
2884
+ * when moving to production, as they offer a degree of validation and type safety
2885
+ * */
2886
+ extraOpts?: string;
2887
+ enableAud?: boolean;
2888
+ gpuIndex?: number;
2889
+ bitrate?: number;
2890
+ enableVfr?: boolean;
2891
+ crf?: number;
2892
+ gopPresetIndex?: number;
2893
+ intraPeriod?: number;
2894
+ rcEnable?: boolean;
2895
+ intraQp?: number;
2896
+ rcInitDelay?: number;
2897
+ profile?: QuadraH264Profile;
2898
+ level?: QuadraH264Level;
2899
+ fillerEnable?: boolean;
2900
+ minQp?: number;
2901
+ maxQp?: number;
2902
+ maxDeltaQp?: number;
2903
+ cuLevelRCEnable?: boolean;
2904
+ lookAheadDepth?: number;
2905
+ vbvBufferSize?: number;
2906
+ vbvMaxRate?: number;
2907
+ }
2908
+
2909
+ /** @public */
2910
+ export declare type QuadraH264Level = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
2911
+
2912
+ /** @public */
2913
+ export declare type QuadraH264Profile = "baseline" | "main" | "extended" | "high" | "high10";
2914
+
2915
+ /**
2916
+ * @public
2917
+ * Settings for a HEVC Encode using Netint Quadra hardware
2918
+ * A detailed description of these params can be found
2919
+ * on the Netint Quadra Encoder Documentation
2920
+ *
2921
+ * These fields have deliberately been written to maintain the same semantics as the
2922
+ * Quadra documentation where possible.
2923
+ *
2924
+ * If left undefined, all will default to Quadra's own defaults
2925
+ * */
2926
+ export declare interface QuadraHevc {
2927
+ type: "quadra-hevc";
2928
+ /** This (for convenience) takes the xcoder string that Quadra's
2929
+ * Ffmpeg integration accepts, this is to aid developers in getting up and running
2930
+ * quickly and will override any values set manually in the rest of this interface.
2931
+ *
2932
+ * It is expected that developers will choose to use the typed fields for most things instead
2933
+ * when moving to production, as they offer a degree of validation and type safety
2934
+ * */
2935
+ extraOpts?: string;
2936
+ enableAud?: boolean;
2937
+ gpuIndex?: number;
2938
+ bitrate?: number;
2939
+ enableVfr?: boolean;
2940
+ crf?: number;
2941
+ gopPresetIndex?: number;
2942
+ intraPeriod?: number;
2943
+ rcEnable?: boolean;
2944
+ intraQp?: number;
2945
+ rcInitDelay?: number;
2946
+ profile?: QuadraHevcProfile;
2947
+ level?: QuadraHevcLevel;
2948
+ tier?: QuadraHevcTier;
2949
+ lossless?: boolean;
2950
+ hrdEnable?: boolean;
2951
+ dolbyVisionProfile?: number;
2952
+ fillerEnable?: boolean;
2953
+ minQp?: number;
2954
+ maxQp?: number;
2955
+ maxDeltaQp?: number;
2956
+ cuLevelRCEnable?: boolean;
2957
+ lookAheadDepth?: number;
2958
+ vbvBufferSize?: number;
2959
+ vbvMaxRate?: number;
2960
+ }
2961
+
2962
+ /** @public */
2963
+ export declare type QuadraHevcLevel = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
2964
+
2965
+ /** @public */
2966
+ export declare type QuadraHevcProfile = "main" | "main10";
2967
+
2968
+ /** @public */
2969
+ export declare type QuadraHevcTier = "main" | "high";
2970
+
2971
+ /** @public */
2972
+ export declare type ReceiveFromAddress<Pins extends string> = {
2973
+ source: SourceMediaNode;
2974
+ sourceSelector: (streams: StreamMetadata[]) => PinToKey<Pins>;
2975
+ };
2976
+
2977
+ /** @public */
2978
+ export declare type ReceiveFromAddressAuto = {
2979
+ source: SourceMediaNode;
2980
+ sourceSelector: (streams: StreamMetadata[]) => StreamKey[];
2981
+ };
2982
+
2983
+ /**
2984
+ * @public
2985
+ * Base settings for any input node requiring access to a host:port pair
2986
+ * */
2987
+ export declare interface RemoteInputSettings<T extends MediaNodeState> extends InputSettings<T> {
2988
+ /** The IP of the remote server*/
2989
+ ip: string;
2990
+ /** The port the remote server is listening on*/
2991
+ port: number;
2992
+ }
2993
+
2994
+ /**
2995
+ * @public
2996
+ * Validation function to require at least one audio and at least one video stream. Often the default validation
2997
+ * will happen to ensure this, as audio and video are subscribed from separate media nodes, but when one media node
2998
+ * will produce both audio and video, default validation cannot know that both are required.
2999
+ */
3000
+ export declare function requireAV(ctx: Context): boolean;
3001
+
3002
+ /**
3003
+ * @public
3004
+ * Validation function to require exactly N audio and exactly M video streams. Often the default validation
3005
+ * will happen to ensure this, as audio and video are subscribed from separate media nodes, but when one media node
3006
+ * will produce both audio and video, default validation cannot know that both are required.
3007
+ */
3008
+ export declare function requireExactAV({ audio, video }: {
3009
+ audio: number;
3010
+ video: number;
3011
+ }): (ctx: Context) => boolean;
3012
+
3013
+ /**
3014
+ * @public
3015
+ * The resolution of a video within Norsk
3016
+ * */
3017
+ export declare interface Resolution {
3018
+ width: number;
3019
+ height: number;
3020
+ }
3021
+
3022
+ /** @public */
3023
+ export declare enum RtmpConnectionFailureReason {
3024
+ RtmpConnectionFailedRetry = "RtmpConnectionFailedRetry"
3025
+ }
3026
+
3027
+ /**
3028
+ * @public
3029
+ * see: {@link NorskOutput.rtmp}
3030
+ */
3031
+ export declare class RtmpOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
3032
+ }
3033
+
3034
+ /**
3035
+ * @public
3036
+ * The settings for an RTMP output
3037
+ * see: {@link NorskOutput.rtmp}
3038
+ * */
3039
+ export declare interface RtmpOutputSettings extends SinkNodeSettings<RtmpOutputNode>, StreamStatisticsMixin {
3040
+ /**
3041
+ * The URL of the remote RTMP server to connect to, including the full stream path and credentials
3042
+ */
3043
+ url: string;
3044
+ /** Jitter buffer delay in milliseconds */
3045
+ bufferDelayMs?: number;
3046
+ /** Called when the RTMP output succesfully connects to a server and starts publishing data */
3047
+ onPublishStart?: () => void;
3048
+ /** Called when the connection to the RTMP server fails */
3049
+ onConnectionFailure?: (failureReason: RtmpConnectionFailureReason) => void;
3050
+ /**
3051
+ * Number of seconds to wait until a retry is attempted to the RTMP server.
3052
+ * Defaults to five seconds
3053
+ */
3054
+ retryConnectionTimeout?: number;
3055
+ sslOptions?: {
3056
+ verifyPeerCert?: boolean;
3057
+ };
3058
+ }
3059
+
3060
+ /**
3061
+ * @public
3062
+ * see: {@link NorskInput.rtmpServer}
3063
+ */
3064
+ export declare class RtmpServerInputNode extends SourceMediaNode {
3065
+ /**
3066
+ * @public
3067
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
3068
+ * */
3069
+ nudge(sourceName: string, programNumber: number, nudge: number): void;
3070
+ }
3071
+
3072
+ /**
3073
+ * @public
3074
+ * Settings to control how RTMP streams can be included as sources in your media workflow
3075
+ * see: {@link NorskInput.rtmpServer}
3076
+ */
3077
+ export declare interface RtmpServerInputSettings extends SourceNodeSettings<RtmpServerInputNode>, StreamStatisticsMixin {
3078
+ /** The port the RTMP server should listen on */
3079
+ port?: number;
3080
+ ssl?: boolean;
3081
+ sslOptions?: {
3082
+ certFile?: string;
3083
+ keyFile?: string;
3084
+ };
3085
+ /**
3086
+ * On connect callback, use to accept/reject connections given app/url in use
3087
+ * @eventProperty
3088
+ */
3089
+ onConnection?: (
3090
+ /** The connection ID, unique to this RtmpServer node */
3091
+ connectionId: string,
3092
+ /** The RTMP "app" field from the connection string */
3093
+ app: string,
3094
+ /** The full URL of the RTMP connection string */
3095
+ url: string) => {
3096
+ accept: true;
3097
+ } | {
3098
+ accept: false;
3099
+ reason?: string;
3100
+ };
3101
+ /**
3102
+ * On stream callback, set up the stream keys for a given stream or reject the stream
3103
+ * @eventProperty
3104
+ */
3105
+ onStream?: (
3106
+ /** The connection ID, unique to this RtmpServer node */
3107
+ connectionId: string,
3108
+ /** The RTMP "app" field from the connection string */
3109
+ app: string,
3110
+ /** The full URL of the RTMP connection string */
3111
+ url: string,
3112
+ /** The Norsk streamId of this media stream */
3113
+ streamId: number,
3114
+ /** TODO - publishingName */
3115
+ publishingName: string) => OnStreamResult;
3116
+ /**
3117
+ * Called when the connection status has changed (e.g. when the RTMP connection drops)
3118
+ * @eventProperty
3119
+ */
3120
+ onConnectionStatusChange?: (
3121
+ /** The connection ID, unique to this RtmpServer node */
3122
+ connectionId: string,
3123
+ /** The new connection state */
3124
+ status: RtmpServerInputStatus,
3125
+ /** The audio and video stream keys that were present in the stream at the time of the status change */
3126
+ streamKeys: {
3127
+ audioStreamKey: StreamKey_2;
3128
+ videoStreamKey: StreamKey_2;
3129
+ }[]) => void;
3130
+ onConnectionError?: (
3131
+ /** The connection ID, unique to this RtmpServer node */
3132
+ connectionId: string,
3133
+ /** The error */
3134
+ error: RtmpError_UnsupportedVideo | RtmpError_UnsupportedAudio) => void;
3135
+ onConnectionBytesRead?: (
3136
+ /** The connection ID, unique to this RtmpServer node */
3137
+ connectionId: string,
3138
+ /** The number of bytes read, as reported by the peer */
3139
+ bytesRead: bigint) => void;
3140
+ }
3141
+
3142
+ /** @public */
3143
+ export declare type RtmpServerInputStatus = "disconnected";
3144
+
3145
+ /**
3146
+ * @public
3147
+ * The stream keys in an RTMP input stream
3148
+ */
3149
+ export declare type RtmpServerStreamKeys = {
3150
+ audioStreamKey: StreamKey_2;
3151
+ videoStreamKey: StreamKey_2;
3152
+ }[];
3153
+
3154
+ /**
3155
+ * @public
3156
+ * A description of an Eac3 stream being delivered via RTP
3157
+ * */
3158
+ export declare interface RtpEac3 {
3159
+ kind: "eac3";
3160
+ /** The clock rate of the stream */
3161
+ clockRate: number;
3162
+ /** The language code (this will end up in outgoing metadata). RFC 5646 language tag. */
3163
+ languageCode?: string;
3164
+ ec3Extension: boolean;
3165
+ complexityIndex: number;
3166
+ }
3167
+
3168
+ /**
3169
+ * @public
3170
+ * A description of an H264 stream delivered over RTP
3171
+ * */
3172
+ export declare interface RtpH264 {
3173
+ kind: "h264";
3174
+ /** The clock rate of the stream */
3175
+ clockRate: number;
3176
+ }
3177
+
3178
+ /**
3179
+ * @public
3180
+ * A description of an HEVC stream delivered over RTP
3181
+ * */
3182
+ export declare interface RtpHEVC {
3183
+ kind: "hevc";
3184
+ /** The clock rate of the stream */
3185
+ clockRate: number;
3186
+ }
3187
+
3188
+ /**
3189
+ * @public
3190
+ * see: {@link NorskInput.rtp}
3191
+ */
3192
+ export declare class RtpInputNode extends SourceMediaNode {
3193
+ /**
3194
+ * @public
3195
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
3196
+ * */
3197
+ nudge(nudge: number): void;
3198
+ }
3199
+
3200
+ /**
3201
+ * @public
3202
+ * Settings for an RTP input
3203
+ * see: {@link NorskInput.rtp}
3204
+ * */
3205
+ export declare interface RtpInputSettings extends SourceNodeSettings<RtpInputNode>, StreamStatisticsMixin {
3206
+ sourceName: string;
3207
+ streams: readonly RtpStreamSettings[];
3208
+ }
3209
+
3210
+ /**
3211
+ * @public
3212
+ * A description of a LinearPCM stream being delivered via RTP
3213
+ * */
3214
+ export declare interface RtpLinearPcm {
3215
+ kind: "linearpcm";
3216
+ /** The sample rate of the stream */
3217
+ sampleRate: SampleRate;
3218
+ /** The channel layotu the stream */
3219
+ channelLayout: ChannelLayout;
3220
+ /** The bit depth of the stream */
3221
+ bitDepth: RtpLinearPcmBitDepth;
3222
+ }
3223
+
3224
+ /** @public */
3225
+ export declare type RtpLinearPcmBitDepth = 16 | 24;
3226
+
3227
+ /**
3228
+ * @public
3229
+ * A description of a Mpeg4 Generic Aac stream
3230
+ * */
3231
+ export declare interface RtpMpeg4GenericAacHbr {
3232
+ kind: "mpeg4-generic-aac-hbr";
3233
+ config: string;
3234
+ }
3235
+
3236
+ /**
3237
+ * @public
3238
+ * A description of an incoming RTP stream
3239
+ * */
3240
+ export declare interface RtpStreamSettings {
3241
+ /** A streamID to assign to the outgoing stream key */
3242
+ streamId: number;
3243
+ /** The IP Address to join the RTP stream on */
3244
+ ip: string;
3245
+ /** The interface to bind to, "loopback" and "any" are special cases
3246
+ * and anything else will be interpreted as the name of a network interface */
3247
+ interface: string;
3248
+ /** The port to connect to for the RTP stream itself */
3249
+ rtpPort: number;
3250
+ /** The port to connect to for the associated RTCP stream */
3251
+ rtcpPort: number;
3252
+ /** A description of the stream being joined */
3253
+ streamType: RtpLinearPcm | RtpEac3 | RtpMpeg4GenericAacHbr | RtpH264 | RtpHEVC;
3254
+ }
3255
+
3256
+ /**
3257
+ * @public
3258
+ * This is the SAR/PAR for a video stream and is an expression of what shape each pixel has within a video stream
3259
+ * x:1, y:1 being a square and the most common value for this
3260
+ * */
3261
+ export declare interface SampleAspectRatio {
3262
+ x: number;
3263
+ y: number;
3264
+ }
3265
+
3266
+ /** @public */
3267
+ export declare type SampleFormat =
3268
+ /** Signed 16 bits, non-planar */
3269
+ "s16"
3270
+ /** Signed 16 bits, planar */
3271
+ | "s16p"
3272
+ /** 32bit floating point, non-planar */
3273
+ | "flt"
3274
+ /** 32bit floating point, planar */
3275
+ | "fltp";
3276
+
3277
+ /** @public Audio sample rate, in Hz */
3278
+ export declare type SampleRate = 8000 | 11025 | 12000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000 | 64000 | 88200 | 96000;
3279
+
3280
+ /** @public */
3281
+ export declare type ScheduleComponent = {
3282
+ components: Scte35ScheduleCommandComponent[];
3283
+ };
3284
+
3285
+ /** @public */
3286
+ export declare type ScheduledTag = [number, MediaPlaylistPart, Date, DestinationId?];
3287
+
3288
+ /** @public */
3289
+ export declare type ScheduleProgram = {
3290
+ utcSpliceTime: number;
3291
+ };
3292
+
3293
+ /** @public */
3294
+ export declare type Scte35AudioComponent = {
3295
+ componentTag: number;
3296
+ isoCode: number;
3297
+ bitStreamMode: number;
3298
+ numChannels: number;
3299
+ fullSrvcAudio: boolean;
3300
+ };
3301
+
3302
+ /** @public */
3303
+ export declare type Scte35AudioDescriptor = {
3304
+ components: Scte35AudioComponent[];
3305
+ };
3306
+
3307
+ /** @public */
3308
+ export declare type Scte35AvailDescriptor = {
3309
+ providerAvailId: number;
3310
+ };
3311
+
3312
+ /** @public */
3313
+ export declare type Scte35BreakDuration = {
3314
+ autoReturn: boolean;
3315
+ duration: bigint;
3316
+ };
3317
+
3318
+ /** @public */
3319
+ export declare type Scte35DtmfDescriptor = {
3320
+ preroll: number;
3321
+ dtmfChars: Uint8Array;
3322
+ };
3323
+
3324
+ /** @public */
3325
+ export declare type Scte35GenericDescriptor = {
3326
+ identifier: number;
3327
+ spliceDescriptorTag: number;
3328
+ privateBytes: Uint8Array;
3329
+ };
3330
+
3331
+ /** @public */
3332
+ export declare type Scte35InsertCommand = {
3333
+ spliceEventId: number;
3334
+ spliceEventCancelIndicator: boolean;
3335
+ outOfNetworkIndicator: boolean;
3336
+ spliceImmediateFlag: boolean;
3337
+ mode: Scte35InsertCommandMode;
3338
+ breakDuration: Scte35BreakDuration;
3339
+ uniqueProgramId: number;
3340
+ availNum: number;
3341
+ availsExpected: number;
3342
+ };
3343
+
3344
+ /** @public */
3345
+ export declare type Scte35InsertCommandComponent = {
3346
+ componentTag: number;
3347
+ spliceTime: Scte35SpliceTime;
3348
+ };
3349
+
3350
+ /** @public */
3351
+ export declare type Scte35InsertCommandMode = InsertProgram | InsertComponent;
3352
+
3353
+ /** @public */
3354
+ export declare type Scte35PrivateCommand = {
3355
+ identifier: number;
3356
+ privateBytes: Uint8Array;
3357
+ };
3358
+
3359
+ /** @public */
3360
+ export declare type Scte35ReservedCommand = {
3361
+ reserved: number;
3362
+ };
3363
+
3364
+ /** @public */
3365
+ export declare type Scte35ScheduleCommand = {
3366
+ items: Scte35ScheduleItem[];
3367
+ };
3368
+
3369
+ /** @public */
3370
+ export declare type Scte35ScheduleCommandComponent = {
3371
+ componentTag: number;
3372
+ utcSpliceTime: number;
3373
+ };
3374
+
3375
+ /** @public */
3376
+ export declare type Scte35ScheduleCommandMode = ScheduleProgram | ScheduleComponent;
3377
+
3378
+ /** @public */
3379
+ export declare type Scte35ScheduleItem = {
3380
+ spliceEventId: number;
3381
+ spliceEventCancelIndicator: boolean;
3382
+ outOfNetworkIndicator: boolean;
3383
+ mode: Scte35ScheduleCommandMode;
3384
+ breakDuration: Scte35BreakDuration;
3385
+ uniqueProgramId: number;
3386
+ availNum: number;
3387
+ availsExpected: number;
3388
+ };
3389
+
3390
+ /** @public */
3391
+ export declare type Scte35SegmentationComponent = {
3392
+ componentTag: number;
3393
+ ptsOffset: bigint;
3394
+ };
3395
+
3396
+ /** @public */
3397
+ export declare type Scte35SegmentationDescriptor = {
3398
+ segmentationEventId: number;
3399
+ segmentationEventCancelIndicator: boolean;
3400
+ programSegmentationFlag: boolean;
3401
+ deliveryRestrictions?: Scte35SegmentDeliveryRestrictions;
3402
+ components: Scte35SegmentationComponent[];
3403
+ segmentationDuration?: bigint;
3404
+ segmentationUpidType: number;
3405
+ segmentationUpid: Uint8Array;
3406
+ segmentationTypeId: number;
3407
+ segmentNum: number;
3408
+ segmentsExpected: number;
3409
+ subSegmentNum?: number;
3410
+ subSegmentsExpected?: number;
3411
+ };
3412
+
3413
+ /** @public */
3414
+ export declare type Scte35SegmentDeliveryRestrictions = {
3415
+ webDeliveryAllowedFlag: boolean;
3416
+ noRegionalBlackoutFlag: boolean;
3417
+ archiveAllowedFlag: boolean;
3418
+ deviceRestrictions: number;
3419
+ };
3420
+
3421
+ /** @public */
3422
+ export declare type Scte35SpliceCommand = {
3423
+ type: Scte35SpliceCommandType;
3424
+ value?: Scte35InsertCommand | Scte35ScheduleCommand | Scte35TimeSignalCommand | Scte35PrivateCommand | Scte35ReservedCommand;
3425
+ };
3426
+
3427
+ /** @public */
3428
+ export declare type Scte35SpliceCommandType = "null" | "schedule" | "insert" | "timeSignal" | "bandwidthReservation" | "privateCommand" | "reserved";
3429
+
3430
+ /** @public */
3431
+ export declare type Scte35SpliceDescriptor = {
3432
+ type: Scte35SpliceDescriptorType;
3433
+ value: Scte35AvailDescriptor | Scte35DtmfDescriptor | Scte35SegmentationDescriptor | Scte35TimeDescriptor | Scte35AudioDescriptor | Scte35GenericDescriptor;
3434
+ };
3435
+
3436
+ /** @public */
3437
+ /** @public */
3438
+ export declare type Scte35SpliceDescriptorType = "avail" | "dtmf" | "segmentation" | "time" | "audio" | "generic";
3439
+
3440
+ /** @public */
3441
+ export declare type Scte35SpliceInfoSection = {
3442
+ sapType: number;
3443
+ protocolVersion: number;
3444
+ encryptedPacket: boolean;
3445
+ encryptionAlgorithm: number;
3446
+ ptsAdjustment: bigint;
3447
+ cwIndex: number;
3448
+ tier: number;
3449
+ spliceCommand: Scte35SpliceCommand;
3450
+ descriptors: Scte35SpliceDescriptor[];
3451
+ };
3452
+
3453
+ /** @public */
3454
+ export declare type Scte35SpliceTime = {
3455
+ ptsTime?: number;
3456
+ };
3457
+
3458
+ /** @public */
3459
+ export declare type Scte35TimeDescriptor = {
3460
+ taiSeconds: bigint;
3461
+ taiNs: number;
3462
+ utcOffset: number;
3463
+ };
3464
+
3465
+ /** @public */
3466
+ export declare type Scte35TimeSignalCommand = {
3467
+ spliceTime: Scte35SpliceTime;
3468
+ };
3469
+
3470
+ /** @public */
3471
+ export declare function selectAudio(streams: readonly StreamMetadata[]): StreamKey[];
3472
+
3473
+ /**
3474
+ * @public
3475
+ * Select all the audio and video streams from the input
3476
+ * @param streams - The streams from the inbound Context
3477
+ * @returns Array of selected StreamKeys
3478
+ */
3479
+ export declare function selectAV(streams: readonly StreamMetadata[]): StreamKey[];
3480
+
3481
+ /** @public */
3482
+ export declare function selectExactKey(key: StreamKey): (streams: readonly StreamMetadata[]) => StreamKey[];
3483
+
3484
+ /** @public */
3485
+ export declare function selectPlaylist(streams: readonly StreamMetadata[]): StreamKey[];
3486
+
3487
+ /** @public */
3488
+ export declare function selectSubtitles(streams: readonly StreamMetadata[]): StreamKey[];
3489
+
3490
+ /** @public */
3491
+ export declare function selectVideo(streams: readonly StreamMetadata[]): StreamKey[];
3492
+
3493
+ /** @public */
3494
+ export declare function selectVideoRendition(renditionName: string): (streams: readonly StreamMetadata[]) => StreamKey[];
3495
+
3496
+ /** @public */
3497
+ export declare type SentenceBuildMode = "raw" | "stable" | "partial" | "complete";
3498
+
3499
+ /** @public */
3500
+ export declare type SimpleEasing = "linear" | "ease_in" | "ease_in_out" | "ease_out";
3501
+
3502
+ /** @public */
3503
+ export declare interface SingleStreamStatistics extends StreamStatistics {
3504
+ streamKey: StreamKey;
3505
+ metadata: StreamMetadataMessage;
3506
+ }
3507
+
3508
+ /** @public */
3509
+ export declare class SinkMediaNode<Pins extends string> extends MediaNodeState implements SubscribeDestination {
3510
+ permissiveSubscriptionValidation(_context: Context): SubscriptionValidationResponse;
3511
+ restrictiveSubscriptionValidation(context: Context): SubscriptionValidationResponse;
3512
+ /** Subscribe to the given sources.
3513
+ *
3514
+ * This version of the function call accepts the target pins of an output
3515
+ * and is suitable for advanced use where a node is capable of subscribing to
3516
+ * multiple video streams and provides a means of distinguishing them via pins
3517
+ * discarding any existing subscriptions.
3518
+ *
3519
+ * @param done - will be called with no arguments if the subscription succeeds,
3520
+ * or an error if it failed. This error indicates the specific reason it
3521
+ * failed, so you can take appropriate actions in response. It will be called
3522
+ * before the `subscribedStreamsChangedFn` or `subscribeErrorFn` callbacks
3523
+ * provided in the config for the node.
3524
+ *
3525
+ * Errors are also logged to the debug log.
3526
+ */
3527
+ subscribeToPins(sources: ReceiveFromAddress<Pins>[], validation?: (context: Context) => SubscriptionValidationResponse, done?: (error?: SubscriptionError) => void): void;
3528
+ sourceContextChange(responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
3529
+ finalise(): void;
3530
+ }
3531
+
3532
+ /** @public */
3533
+ export declare interface SinkNodeSettings<T extends MediaNodeState> extends NodeSettings<T> {
3534
+ onSubscriptionError?: (error: SubscriptionError) => void;
3535
+ }
3536
+
3537
+ export declare interface Smpte2038Message {
3538
+ cNotYChannelFlag: boolean;
3539
+ lineNumber: number;
3540
+ horizontalOffset: number;
3541
+ payloadFormat: VancPayloadFormat;
3542
+ ancillaryId: VancType2AncillaryId;
3543
+ userData: Uint8Array;
3544
+ }
3545
+
3546
+ /** @public */
3547
+ export declare class SourceMediaNode extends MediaNodeState {
3548
+ outputStreams: StreamMetadata[];
3549
+ registerForContextChange(subscriber: SubscribeDestination): void;
3550
+ unregisterForContextChange(subscriber: SubscribeDestination): void;
3551
+ }
3552
+
3553
+ /** @public */
3554
+ export declare interface SourceNodeSettings<T extends MediaNodeState> extends NodeSettings<T> {
3555
+ onOutboundContextChange?: (streams: StreamMetadata[]) => Promise<void>;
3556
+ }
3557
+
3558
+ /**
3559
+ * @public
3560
+ * Errors found while subscribing to a particular source, separated out by reason:
3561
+ *
3562
+ * - `internal`: An opaque internal error
3563
+ *
3564
+ * - `unknownSourceId`: The media node does not exist (maybe it crashed)
3565
+ *
3566
+ * - `unknownSourceStream`: The media node exists, but does not have the stream key
3567
+ *
3568
+ * - `noSubscriberPin`: The media node is not set up to receive data on this pin (which may be auto-detected)
3569
+ *
3570
+ * - `unsupportedConversion`: Norsk does not support conversion from the media types of the source to the media types accepted by the subscriber
3571
+ */
3572
+ export declare type SourceSubscriptionError = {
3573
+ info: string;
3574
+ reason: "internal";
3575
+ } | {
3576
+ mediaNodeId: MediaNodeId;
3577
+ reason: "unknownSourceId";
3578
+ } | {
3579
+ mediaNodeId: MediaNodeId;
3580
+ streamKey: StreamKey;
3581
+ reason: "unknownSourceStream";
3582
+ } | {
3583
+ mediaNodeId: MediaNodeId;
3584
+ streamKey: StreamKey;
3585
+ pin: string;
3586
+ subscriberPins: string[];
3587
+ reason: "noSubscriberPin";
3588
+ } | {
3589
+ mediaNodeId: MediaNodeId;
3590
+ streamKey: StreamKey;
3591
+ sourceTypes: string[];
3592
+ subscriberTypes: string[];
3593
+ reason: "unsupportedConversion";
3594
+ };
3595
+
3596
+ /** @public */
3597
+ export declare function sourceToPin<Pins extends string>(source: string, pin: Pins): (streams: StreamMetadata[]) => PinToKey<Pins>;
3598
+
3599
+ /**
3600
+ * @public
3601
+ * The return value for the {@link SrtInputSettings.onConnection} callback
3602
+ * determining what to do with an incoming stream
3603
+ */
3604
+ export declare type SrtConnectionResult =
3605
+ /** Accept the stream */
3606
+ {
3607
+ accept: true;
3608
+ /** The source name to assign to the connection */
3609
+ sourceName: string;
3610
+ }
3611
+ /** Reject the stream */
3612
+ | {
3613
+ accept: false;
3614
+ };
3615
+
3616
+ /**
3617
+ * @public
3618
+ * see: {@link NorskInput.srt}
3619
+ */
3620
+ export declare class SrtInputNode extends SourceMediaNode {
3621
+ /**
3622
+ * @public
3623
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
3624
+ * */
3625
+ nudge(sourceName: string, programNumber: number, nudge: number): void;
3626
+ /**
3627
+ * @public
3628
+ * Closes a connected stream as specified by 'streamIndex'
3629
+ * @param streamIndex - the index of the stream to be terminated
3630
+ * */
3631
+ closeStream(streamIndex: number): void;
3632
+ }
3633
+
3634
+ /**
3635
+ * @public
3636
+ * Settings for an SRT Input node
3637
+ * see: {@link NorskInput.srt}
3638
+ */
3639
+ export declare interface SrtInputSettings extends RemoteInputSettings<SrtInputNode>, StreamStatisticsMixin {
3640
+ /**
3641
+ * The mode to act in (caller or listener)
3642
+ */
3643
+ mode: SrtMode;
3644
+ /**
3645
+ * Passphrase for encryption
3646
+ */
3647
+ passphrase?: string;
3648
+ /**
3649
+ * Stream ID to set on the socket when acting in caller mode
3650
+ */
3651
+ streamId?: string;
3652
+ /**
3653
+ * On connect callback, notifying that a new caller has connected (in listener mode) and set the source name accordingly
3654
+ * @eventProperty
3655
+ */
3656
+ onConnection?: (
3657
+ /** The stream_id sent on the SRT socket (or empty if none was set) */
3658
+ streamId: string,
3659
+ /**
3660
+ * Identifier indicating which connection this message refers to (for a
3661
+ * listener which may have multiple connections)
3662
+ */
3663
+ index: number,
3664
+ /** The address of the remote host */
3665
+ remoteHost: string) => SrtConnectionResult;
3666
+ /**
3667
+ * Called when the connection status has changed (e.g. when the SRT socket is closed)
3668
+ * @eventProperty
3669
+ */
3670
+ onConnectionStatusChange?: (
3671
+ /** The new connection state */
3672
+ status: SrtInputStatus,
3673
+ /** The source name assigned to the connection which changed status */
3674
+ sourceName: string | undefined) => void;
3675
+ }
3676
+
3677
+ /** @public */
3678
+ export declare type SrtInputStatus = "disconnected";
3679
+
3680
+ /** @public */
3681
+ export declare type SrtMode = "listener" | "caller";
3682
+
3683
+ /**
3684
+ * @public
3685
+ * see: {@link NorskOutput.srt}
3686
+ */
3687
+ export declare class SrtOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
3688
+ }
3689
+
3690
+ /**
3691
+ * @public
3692
+ * The settings for an SRT output
3693
+ * see: {@link NorskOutput.srt}
3694
+ * */
3695
+ export declare interface SrtOutputSettings extends SinkNodeSettings<SrtOutputNode>, StreamStatisticsMixin {
3696
+ /**
3697
+ * Passphrase for encryption
3698
+ */
3699
+ passphrase?: string;
3700
+ /**
3701
+ * Stream ID to set on the socket when acting in caller mode
3702
+ */
3703
+ streamId?: string;
3704
+ /**
3705
+ * The mode to act in (see {@link SrtMode})
3706
+ */
3707
+ mode: SrtMode;
3708
+ /**
3709
+ * The IP address to listen on in listener mode, or to connect to in caller mode
3710
+ */
3711
+ ip: string;
3712
+ /**
3713
+ * The port to listen on in listener mode, or to connect to in caller mode
3714
+ */
3715
+ port: number;
3716
+ /** Jitter buffer delay in milliseconds */
3717
+ bufferDelayMs?: number;
3718
+ /**
3719
+ * On connect callback, notifying that a new caller has connected (in listener mode) and providing the stream_id that was set on the socket
3720
+ * @eventProperty
3721
+ */
3722
+ onConnection?: (
3723
+ /** The stream_id sent on the SRT socket (or empty if none was set) */
3724
+ streamId: string,
3725
+ /** The stream index (count of connections that have been made) */
3726
+ streamIndex: number,
3727
+ /** The remote host address */
3728
+ remoteHost: string) => void;
3729
+ }
3730
+
3731
+ /** @public */
3732
+ export declare type StabilizationMode = "low" | "medium" | "high";
3733
+
3734
+ /**
3735
+ * @public
3736
+ * see: {@link NorskTransform.streamSync}
3737
+ */
3738
+ export declare class StreamAlignNode extends AutoProcessorMediaNode<"audio" | "video"> {
3739
+ }
3740
+
3741
+ /**
3742
+ * @public
3743
+ * Settings for a StreamAlign node
3744
+ * This will reset all streams to the same framerates/sample rates
3745
+ * and align their timestamps so that they completely line up for downstream operations
3746
+ * see {@link NorskTransform.streamAlign}
3747
+ * */
3748
+ export declare interface StreamAlignSettings extends ProcessorNodeSettings<StreamAlignNode> {
3749
+ sampleRate: SampleRate;
3750
+ frameRate: FrameRate;
3751
+ }
3752
+
3753
+ /**
3754
+ * @public
3755
+ * see: {@link NorskTransform.streamChaosMonkey}
3756
+ */
3757
+ export declare class StreamChaosMonkeyNode extends AutoProcessorMediaNode<"audio" | "video" | "subtitle"> {
3758
+ }
3759
+
3760
+ /**
3761
+ * @public
3762
+ * The settings for a Chaos Monkey
3763
+ * see: {@link NorskTransform.streamChaosMonkey}
3764
+ * */
3765
+ export declare interface StreamChaosMonkeySettings extends ProcessorNodeSettings<StreamChaosMonkeyNode> {
3766
+ /** Optional configuration to drop frames from a stream
3767
+ * leaving this undefined means don't drop any frames
3768
+ * */
3769
+ frameDrop?: DropRandom | DropEvery | DropStart;
3770
+ /**
3771
+ * Introduce random jitter
3772
+ */
3773
+ jitterMs?: number;
3774
+ }
3775
+
3776
+ /** @public */
3777
+ export declare interface StreamKey {
3778
+ streamId: number;
3779
+ programNumber: number;
3780
+ sourceName: string;
3781
+ renditionName: string;
3782
+ }
3783
+
3784
+ /**
3785
+ * @public
3786
+ * see: {@link NorskTransform.streamKeyOverride}
3787
+ */
3788
+ export declare class StreamKeyOverrideNode extends AutoProcessorMediaNode<"audio" | "video" | "subtitle"> {
3789
+ }
3790
+
3791
+ /**
3792
+ * @public
3793
+ * Settings for a Stream Key Override
3794
+ * see: {@link NorskTransform.streamKeyOverride}
3795
+ * */
3796
+ export declare interface StreamKeyOverrideSettings extends ProcessorNodeSettings<StreamKeyOverrideNode> {
3797
+ /** The stream key that all frames passing through this node will be assigned */
3798
+ streamKey: StreamKey;
3799
+ }
3800
+
3801
+ /**
3802
+ * Compares two stream keys by value, returning true if the stream keys refer to the same stream
3803
+ */
3804
+ export declare function streamKeysAreEqual(l: StreamKey, r: StreamKey): unknown;
3805
+
3806
+ /** @public */
3807
+ export declare interface StreamKeySettings {
3808
+ /** Source name. Default: the rtmp app */
3809
+ sourceName?: string;
3810
+ /** Program number. Default: 1 */
3811
+ programNumber?: number;
3812
+ /** Stream Id. Default: 1 for audio, 2 for video */
3813
+ streamId?: number;
3814
+ /** Rendition name. Default: the stream publishing name */
3815
+ renditionName?: string;
3816
+ }
3817
+
3818
+ /** @public */
3819
+ export declare interface StreamMetadata {
3820
+ streamKey: StreamKey;
3821
+ message: StreamMetadataMessage;
3822
+ }
3823
+
3824
+ /** @public */
3825
+ export declare type StreamMetadataMessage = {
3826
+ case: "audio";
3827
+ value: AudioStreamMetadata;
3828
+ } | {
3829
+ case: "video";
3830
+ value: VideoStreamMetadata;
3831
+ } | {
3832
+ case: "subtitle";
3833
+ value: SubtitleStreamMetadata;
3834
+ } | {
3835
+ case: "playlist";
3836
+ value: PlaylistStreamMetadata;
3837
+ } | {
3838
+ case: "ancillary";
3839
+ value: AncillaryStreamMetadata;
3840
+ } | {
3841
+ case: undefined;
3842
+ value?: undefined;
3843
+ };
3844
+
3845
+ /**
3846
+ * @public
3847
+ * see: {@link NorskTransform.streamMetadataOverride}
3848
+ */
3849
+ export declare class StreamMetadataOverrideNode extends AutoProcessorMediaNode<"audio" | "video" | "subtitle"> {
3850
+ /**
3851
+ * @public
3852
+ * Updates the config used by this metadata override node for all subsequent frames
3853
+ * @param settings - The new settings
3854
+ */
3855
+ updateConfig(settings: StreamMetadataOverrideSettingsUpdate): void;
3856
+ }
3857
+
3858
+ /**
3859
+ * @public
3860
+ * Settings for a Stream Metadata Override Node
3861
+ * see: {@link NorskTransform.streamMetadataOverride}
3862
+ * */
3863
+ export declare interface StreamMetadataOverrideSettings extends ProcessorNodeSettings<StreamMetadataOverrideNode>, StreamMetadataOverrideSettingsUpdate {
3864
+ }
3865
+
3866
+ /** @public */
3867
+ export declare interface StreamMetadataOverrideSettingsUpdate {
3868
+ video?: {
3869
+ /** Override the bitrate metadata of a compressed video stream, or `0` to clear */
3870
+ bitrate?: number;
3871
+ };
3872
+ audio?: {
3873
+ /** Override the bitrate metadata of a compressed audio stream, or `0` to clear */
3874
+ bitrate?: number;
3875
+ /** Override the language metadata of an audio stream, or `""` to clear. RFC 5646 language tag. */
3876
+ language?: string;
3877
+ };
3878
+ subtitles?: {
3879
+ /** Override the language metadata of a subtitles stream, or `""` to clear. RFC 5646 language tag. */
3880
+ language?: string;
3881
+ };
3882
+ }
3883
+
3884
+ /** @public */
3885
+ export declare interface StreamStatistics {
3886
+ /** The size of the sample window in seconds */
3887
+ sampleSizeSeconds: number;
3888
+ /** The number of bits over the sample window */
3889
+ bitsForSample: number;
3890
+ /** The bitrate, in bits per second */
3891
+ bitrate: number;
3892
+ /** The number of frames over the sample window */
3893
+ framesForSample: number;
3894
+ /** The frame rate, in frames per second */
3895
+ framerate: number;
3896
+ /** The number of key frames over the sample window */
3897
+ keyFramesForSample: number;
3898
+ }
3899
+
3900
+ /** @public */
3901
+ export declare interface StreamStatisticsMixin {
3902
+ /**
3903
+ * Sampling rates for stream stats, in seconds
3904
+ */
3905
+ statsSampling?: PlainMessage<StreamStatisticsSampling>;
3906
+ /**
3907
+ * Called at periodic intervals when stream statistics are ready.
3908
+ * @eventProperty
3909
+ */
3910
+ onStreamStatistics?: (
3911
+ /** The stats */
3912
+ stats: MultiStreamStatistics) => void;
3913
+ onGopStructure?: (structure: GopStructure) => void;
3914
+ }
3915
+
3916
+ /**
3917
+ * @public
3918
+ * see {@link NorskControl.streamStatistics}.
3919
+ */
3920
+ export declare class StreamStatisticsNode extends AutoProcessorMediaNode<"audio" | "video"> {
3921
+ }
3922
+
3923
+ /**
3924
+ * @public
3925
+ * Settings for a Stream Statistics Node
3926
+ * see: {@link NorskControl.streamStatistics}
3927
+ */
3928
+ export declare interface StreamStatisticsSettings extends ProcessorNodeSettings<StreamStatisticsNode>, StreamStatisticsMixin {
3929
+ /**
3930
+ * Called periodically with the stream stats
3931
+ * @param stats - The statistics for the stream
3932
+ * @eventProperty
3933
+ */
3934
+ onStreamStatistics: (stats: MultiStreamStatistics) => void;
3935
+ /**
3936
+ * Sampling rates for stream stats, in seconds
3937
+ */
3938
+ statsSampling?: PlainMessage<StreamStatisticsSampling>;
3939
+ }
3940
+
3941
+ /**
3942
+ * @public
3943
+ * see: {@link NorskControl.streamSwitchHard}
3944
+ */
3945
+ export declare class StreamSwitchHardNode<Pins extends string> extends ProcessorMediaNode<Pins> {
3946
+ switchSource(newSource: Pins): void;
3947
+ }
3948
+
3949
+ /**
3950
+ * @public
3951
+ * Settings for the Hard Stream Switch
3952
+ * see: {@link NorskControl.streamSwitchHard}
3953
+ * */
3954
+ export declare interface StreamSwitchHardSettings<Pins extends string> extends ProcessorNodeSettings<StreamSwitchHardNode<Pins>> {
3955
+ /** The currently active source to display on the output */
3956
+ activeSource: Pins;
3957
+ /** the source name to give the output of this switch operation */
3958
+ outputSource: string;
3959
+ }
3960
+
3961
+ /**
3962
+ * @public
3963
+ * see: {@link NorskControl.streamSwitchSmooth}
3964
+ */
3965
+ export declare class StreamSwitchSmoothNode<Pins extends string> extends ProcessorMediaNode<Pins> {
3966
+ /**
3967
+ * @public
3968
+ * Switches the source used for the current output of this node
3969
+ */
3970
+ switchSource(newSource: Pins): void;
3971
+ }
3972
+
3973
+ /**
3974
+ * @public
3975
+ * Settings for the Smooth Source Switch
3976
+ * see {@link NorskControl.streamSwitchSmooth}
3977
+ * */
3978
+ export declare interface StreamSwitchSmoothSettings<Pins extends string> extends ProcessorNodeSettings<StreamSwitchSmoothNode<Pins>> {
3979
+ /** The presently active source being used to generate output for this node */
3980
+ activeSource?: Pins;
3981
+ /** The source name given to the output of this node */
3982
+ outputSource: string;
3983
+ /** How many milliseconds to use for the fade operation between two sources */
3984
+ transitionDurationMs?: number;
3985
+ /** The constant resolution that all output video will be scaled to */
3986
+ outputResolution: Resolution;
3987
+ /** The constant framerate that all output video will be sampled to */
3988
+ frameRate: FrameRate;
3989
+ /** The constant samplerate that all output audio will be resampled to */
3990
+ sampleRate: SampleRate;
3991
+ /** The constant channel layout that all output audio will be resampled to */
3992
+ channelLayout: ChannelLayout;
3993
+ /** Alignment behaviour of the component
3994
+ * whether to rebase all incoming streams to a common timeline
3995
+ * Note: This will modify the timestamps, meaning that merging streams not involved in this may result in
3996
+ * operation may result in sync issues. To avoid this, you can use {@link NorskProcessor.streamAlign} instead of relying
3997
+ * on this component for this behaviour
3998
+ * Note: This behaviour may be removed in a future release and replaced with something similar
3999
+ * */
4000
+ alignment?: "aligned" | "not_aligned";
4001
+ /** Callback which will be called if a switch request cannot be fulfilled */
4002
+ onSwitchError?: (message: string, inputPin?: Pins) => void;
4003
+ /** Callback which will be called a transition has succesfully completed for a requested switch, i.e. the new source
4004
+ * is now showing.
4005
+ *
4006
+ * Note that if additional transitions are triggered when a transition is already in progress, a notification may only be
4007
+ * given for the last transition to finish.
4008
+ **/
4009
+ onTransitionComplete?: (inputPin: Pins) => void;
4010
+ /**
4011
+ * Callback to be called when inbound context changes on some input; presence of an
4012
+ * input means that media has arrived and is ready to switch
4013
+ * immediately
4014
+ * @param allStreams The collection of input contexts received over all input pins
4015
+ */
4016
+ onInboundContextChange?: (allStreams: Map<Pins, StreamMetadata[]>) => Promise<void>;
4017
+ }
4018
+
4019
+ /**
4020
+ * @public
4021
+ * see: {@link NorskTransform.streamSync}
4022
+ */
4023
+ export declare class StreamSyncNode extends AutoProcessorMediaNode<"audio" | "video"> {
4024
+ }
4025
+
4026
+ /**
4027
+ * @public
4028
+ * Settings for a StreamSync node
4029
+ * see {@link NorskTransform.streamSync}
4030
+ * */
4031
+ export declare interface StreamSyncSettings extends ProcessorNodeSettings<StreamSyncNode> {
4032
+ }
4033
+
4034
+ /**
4035
+ * @public
4036
+ * see: {@link NorskTransform.streamTimestampNudge}
4037
+ */
4038
+ export declare class StreamTimestampNudgeNode extends AutoProcessorMediaNode<"audio" | "video"> {
4039
+ /**
4040
+ * @public
4041
+ * Applies a gradual nudge to the stream timestamps by the specified number of milliseconds
4042
+ * */
4043
+ nudge(nudge: number): void;
4044
+ }
4045
+
4046
+ /**
4047
+ * @public
4048
+ * Settings for a Stream Timestamp Nudge
4049
+ * see: {@link NorskTransform.streamTimestampNudge}
4050
+ * */
4051
+ export declare interface StreamTimestampNudgeSettings extends ProcessorNodeSettings<StreamTimestampNudgeNode> {
4052
+ nudge?: number;
4053
+ }
4054
+
4055
+ /**
4056
+ * @public
4057
+ * see: {@link NorskDebug.streamTimestampReport}
4058
+ */
4059
+ export declare class StreamTimestampReportNode extends AutoSinkMediaNode<string> {
4060
+ }
4061
+
4062
+ /**
4063
+ * @public
4064
+ * Settings to control MP4 file output
4065
+ * see {@link NorskOutput.fileMp4}
4066
+ */
4067
+ export declare interface StreamTimestampReportSettings extends SinkNodeSettings<StreamTimestampReportNode> {
4068
+ onTimestamp?: (streamKey: StreamKey, timestamp: IntervalTimestamp) => Promise<void>;
4069
+ }
4070
+
4071
+ export declare interface SubscribeDestination {
4072
+ id?: string;
4073
+ sourceContextChange(responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
4074
+ }
4075
+
4076
+ /**
4077
+ * @public
4078
+ * Errors found while setting up subscriptions, separated out by reason:
4079
+ *
4080
+ * - `internal`: An opaque internal error
4081
+ *
4082
+ * - `unknownSubscriber`: The media node requesting the subscription does not exist
4083
+ *
4084
+ * - `multipleStreams`: Multiple stream keys found for the context type
4085
+ *
4086
+ * - `sourceSubscriptionError`: Per-source errors
4087
+ */
4088
+ export declare type SubscriptionError = {
4089
+ info: string;
4090
+ reason: "internal";
4091
+ } | {
4092
+ mediaNodeId: MediaNodeId;
4093
+ reason: "unknownSubscriber";
4094
+ } | {
4095
+ contextType: ContextType;
4096
+ streamKeys: StreamKey[];
4097
+ reason: "multipleStreams";
4098
+ } | {
4099
+ sourceErrors: SourceSubscriptionError[];
4100
+ reason: "sourceSubscriptionError";
4101
+ };
4102
+
4103
+ /**
4104
+ * @public
4105
+ * Determines what to do with an incoming context
4106
+ *
4107
+ * - true/accept: Allow the incoming context through, and any subsequent/queued data that belongs to it
4108
+ * - false/deny: Deny the incoming context, if no context has been accepted, then queue data until one is
4109
+ * - accept_and_terminate: Allow the incoming context, then deny further data, flush and shut down the node
4110
+ * this is useful for cleanly terminating outputs when the context is empty
4111
+ * */
4112
+ export declare type SubscriptionValidationResponse = true | false | "accept" | "deny" | "accept_and_terminate";
4113
+
4114
+ /** @public */
4115
+ export declare function subtitlesToPin<Pins extends string>(pin: Pins): (streams: StreamMetadata[]) => PinToKey<Pins>;
4116
+
4117
+ /**
4118
+ * @public
4119
+ * Returns the stream keys for subtitle streams in a media context
4120
+ * @param streams - The media context from which to return the stream keys
4121
+ * @returns The subtitle stream keys in the media context
4122
+ */
4123
+ export declare function subtitleStreamKeys(streams: readonly StreamMetadata[]): StreamKey[];
4124
+
4125
+ /** @public */
4126
+ export declare interface SubtitleStreamMetadata {
4127
+ }
4128
+
4129
+ /**
4130
+ * @public
4131
+ * Filters a context to only the subtitle streams within it
4132
+ * @param streams - The media context from which to return the streams
4133
+ * @returns The subtitle streams in the media context
4134
+ */
4135
+ export declare function subtitleStreams(streams: readonly StreamMetadata[]): StreamMetadata[];
4136
+
4137
+ declare class TsCommonInputNode<SourceMessage, T extends SourceMediaNode> extends SourceMediaNode {
4138
+ constructor(tsType: TsInputType, client: MediaClient, unregisterNode: (node: MediaNodeState) => void, settings: SourceNodeSettings<T> & StreamStatisticsMixin, nudgeFn: (nudge: TimestampProgramNudge) => SourceMessage, onEof: (() => void) | undefined, grpcStartFn: () => grpc.ClientDuplexStream<SourceMessage, TsInputEvent>);
4139
+ /**
4140
+ * @public
4141
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
4142
+ * */
4143
+ nudge(programNumber: number, nudge: number): void;
4144
+ }
4145
+
4146
+ declare enum TsInputType {
4147
+ TsFile = 0,
4148
+ Srt = 1,
4149
+ Udp = 2,
4150
+ M3u8 = 3
4151
+ }
4152
+
4153
+ /** @public */
4154
+ export declare type TsPlaylist = MediaPlaylistPart[];
4155
+
4156
+ /** @public */
4157
+ export declare type TsPlaylistAdditions = [MediaPlaylistPart[], Date];
4158
+
4159
+ /**
4160
+ * @public
4161
+ * see: {@link NorskInput.udpTs}
4162
+ */
4163
+ export declare class UdpTsInputNode extends TsCommonInputNode<UdpTsInputMessage, UdpTsInputNode> {
4164
+ }
4165
+
4166
+ /**
4167
+ * @public
4168
+ * Settings for a UDP Transport Stream input
4169
+ * see: {@link NorskInput.udpTs}
4170
+ * */
4171
+ export declare interface UdpTsInputSettings extends RemoteInputSettings<UdpTsInputNode> {
4172
+ interface?: string;
4173
+ timeout?: number;
4174
+ /** Whether to expect the input TS to be encapsulated in RTP via RFC 2250 (default: false) */
4175
+ rtpDecapsulate?: boolean;
4176
+ }
4177
+
4178
+ /**
4179
+ * @public
4180
+ * see: {@link NorskOutput.udpTs}
4181
+ */
4182
+ export declare class UdpTsOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
4183
+ }
4184
+
4185
+ /**
4186
+ * @public
4187
+ * The settings for an output Transport Stream over UDP
4188
+ * see: {@link NorskOutput.udpTs}
4189
+ */
4190
+ export declare interface UdpTsOutputSettings extends SinkNodeSettings<UdpTsOutputNode>, StreamStatisticsMixin {
4191
+ /**
4192
+ * The IP address to publish to
4193
+ * This can be multicast, unicast or broadcast
4194
+ */
4195
+ destinationIp: string;
4196
+ /**
4197
+ * The interface to bind to for publishing
4198
+ * This can be 'any', 'loopback' or any named interface on the machine
4199
+ * Note: If running inside docker this may be different to expected
4200
+ */
4201
+ interface: string;
4202
+ /** The port to send to */
4203
+ port: number;
4204
+ /** Jitter buffer delay in milliseconds */
4205
+ bufferDelayMs?: number;
4206
+ /** Whether to encapsulate in RTP via RFC 2250 (default: false) */
4207
+ rtpEncapsulate?: boolean;
4208
+ }
4209
+
4210
+ /**
4211
+ * @public
4212
+ * An update request for credentials on a CMAF output
4213
+ */
4214
+ export declare interface UpdateCredentials {
4215
+ /**
4216
+ * The id of the destination that is to be updated (see {@link HlsPushDestinationSettings.id})
4217
+ */
4218
+ destinationId: string;
4219
+ /**
4220
+ * the new credentials to be used by the destination
4221
+ */
4222
+ awsCredentials: AwsCredentials;
4223
+ }
4224
+
4225
+ /** @public */
4226
+ export declare type VancPayloadFormat = "other" | "afd_bar" | "pan_scan" | "scte104" | "dvb_scte_vbi" | "op47_sdp" | "op47_vanc_multipacket" | "ancillary_time_code" | "eia_708" | "eia_608";
4227
+
4228
+ /** @public */
4229
+ export declare interface VancType2AncillaryId {
4230
+ did: number;
4231
+ sdid: number;
4232
+ }
4233
+
4234
+ export { Version }
4235
+
4236
+ /**
4237
+ * @public
4238
+ * see: {@link NorskTransform.videoCompose}
4239
+ */
4240
+ export declare class VideoComposeNode<Pins extends string> extends ProcessorMediaNode<Pins> {
4241
+ /**
4242
+ * @public
4243
+ * Updates the config used for a video compose operation
4244
+ * If transitions are specified, animations will be provided, otherwise
4245
+ * the change will be immediate
4246
+ *
4247
+ * Note: This is not a 'cheap' operation and care should be taken not to
4248
+ * do this too often (more than once a second for example!)
4249
+ */
4250
+ updateConfig(settings: VideoComposeSettingsUpdate<Pins>): void;
4251
+ }
4252
+
4253
+ /** @public */
4254
+ export declare interface VideoComposeSettings<Pins extends string> extends ProcessorNodeSettings<VideoComposeNode<Pins>> {
4255
+ /**
4256
+ * Required. Stream key of the reference stream. This is the video stream
4257
+ * which defines the output frame timing, which will typically be part of the
4258
+ * composition, e.g. the main picture in the case of a simple
4259
+ * overlay/picture-in-picture, or the top left quadrant of a 4-way split
4260
+ * screen.
4261
+ */
4262
+ referenceStream: Pins;
4263
+ /** The parts (images/overlays) to include in the composition */
4264
+ parts: readonly ComposePart<Pins>[];
4265
+ /**
4266
+ * Optionally supply a fallback reference resolution. This allows description of the
4267
+ * composition in a desired coordinate system, e.g. a resolution of 100x100
4268
+ * can be specified to allow the source and destination areas to be described
4269
+ * in percentage terms, or a notional resolution can be used that is
4270
+ * independant of the source resolutions that may be provided.
4271
+ *
4272
+ * if set here, this reference resolution will be applied to
4273
+ * any parts that do not have their own reference resolution specified
4274
+ *
4275
+ * If not provided the source and destination rectangles are in terms of the
4276
+ * source and output resolutions respectively.
4277
+ */
4278
+ referenceResolution?: Resolution;
4279
+ /** The resolution of the output video */
4280
+ outputResolution: Resolution;
4281
+ /**
4282
+ * Output pixel format to use. If not specified, this will be chosen
4283
+ * automatically based on the sources present in the initial composition
4284
+ */
4285
+ outputPixelFormat?: PixelFormat;
4286
+ /**
4287
+ * Behaviour in the case of a missing stream used in an active composition
4288
+ * part. Note that this does not apply to the reference stream, but to every
4289
+ * part which does not use the reference stream, whether at startup or on
4290
+ * context change.
4291
+ *
4292
+ * Missing means not present in the context or never having sent a frame.
4293
+ */
4294
+ missingStreamBehaviour?: ComposeMissingStreamBehaviour;
4295
+ /**
4296
+ * Optionally attempt to perform the compose operation on hardware
4297
+ */
4298
+ hardwareAcceleration?: ComposeHardwareAcceleration;
4299
+ /**
4300
+ * Called when the transitions specified in the last config update have
4301
+ * completed (in the case of multiple parts with specified transitions of
4302
+ * different duration, this means that the last remaining transitions have
4303
+ * completed
4304
+ */
4305
+ onTransitionComplete?: () => void;
4306
+ }
4307
+
4308
+ /**
4309
+ * @public
4310
+ * An update operation for a VideoCompose operation
4311
+ * see: {@link VideoComposeNode.updateConfig}
4312
+ * */
4313
+ export declare interface VideoComposeSettingsUpdate<Pins extends string> {
4314
+ /** Update the parts (images/overlays) to include in the composition */
4315
+ parts: readonly ComposePart<Pins>[];
4316
+ }
4317
+
4318
+ /**
4319
+ * @public
4320
+ * see: {@link NorskTransform.videoEncode}
4321
+ */
4322
+ export declare class VideoEncodeNode extends AutoProcessorMediaNode<"video"> {
4323
+ }
4324
+
4325
+ /**
4326
+ * @public
4327
+ * A single rung in a video encode ladder
4328
+ * see: {@link NorskTransform.videoEncode}
4329
+ * */
4330
+ export declare interface VideoEncodeRung {
4331
+ /** The name of this rung, this should be unique across the ladder
4332
+ * and will end up in the renditionName of the outgoing StreamKey
4333
+ */
4334
+ name: string;
4335
+ /** The width of the outgoing video resolution */
4336
+ width: number;
4337
+ /** The height of the outgoing video resolution */
4338
+ height: number;
4339
+ /**
4340
+ * Optionally change the frameRate for this rendition
4341
+ * This can be useful if the input is 50FPS for example and some
4342
+ * lower rungs need to be 25fps
4343
+ *
4344
+ * Note: If you wish to apply the same frame rate across all rungs, it is
4345
+ * more efficient to use a single {@link VideoTransformNode} before the ladder
4346
+ * created with {@link NorskTransform.videoTransform} and leave this value undefined
4347
+ * */
4348
+ frameRate?: FrameRate;
4349
+ /**
4350
+ * Specifies the input video's Sample Aspect Ratio (SAR) to be used by the
4351
+ * encoder in width:height
4352
+ */
4353
+ sar?: SampleAspectRatio;
4354
+ /**
4355
+ * The codec (and detailed configuration) to use for the encoding operation.
4356
+ *
4357
+ * Note: Nvidia, Logan/Quadra, and Xilinx require Nvidia, Logan/Quadra and Xilinx hardware to be set up and
4358
+ * made available to Norsk
4359
+ *
4360
+ * A ladder can use several different codecs across its various rungs and the
4361
+ * VideoEncode node will attempt to build a pipeline that uses the hardware efficently
4362
+ */
4363
+ codec: X264Codec | X265Codec | NvidiaH264 | NvidiaHevc | LoganH264 | LoganHevc | QuadraH264 | QuadraHevc | XilinxH264 | XilinxHevc;
4364
+ }
4365
+
4366
+ /**
4367
+ * @public
4368
+ * Settings for a VideoEncode operation
4369
+ * see: {@link NorskTransform.videoEncode}
4370
+ * */
4371
+ export declare interface VideoEncodeSettings extends ProcessorNodeSettings<VideoEncodeNode> {
4372
+ rungs: readonly VideoEncodeRung[];
4373
+ }
4374
+
4375
+ /**
4376
+ * @public
4377
+ * Returns the stream keys for video streams in a media context
4378
+ * @param streams - The media context from which to return the stream keys
4379
+ * @returns The video stream keys in the media context
4380
+ */
4381
+ export declare function videoStreamKeys(streams: readonly StreamMetadata[]): StreamKey[];
4382
+
4383
+ /** @public */
4384
+ export declare interface VideoStreamMetadata {
4385
+ codec: string;
4386
+ width: number;
4387
+ height: number;
4388
+ frameRate?: FrameRate_2;
4389
+ }
4390
+
4391
+ /**
4392
+ * @public
4393
+ * Filters a context to only the video streams within it
4394
+ * @param streams - The media context from which to return the streams
4395
+ * @returns The video streams in the media context
4396
+ */
4397
+ export declare function videoStreams(streams: readonly StreamMetadata[]): StreamMetadata[];
4398
+
4399
+ /**
4400
+ * @public
4401
+ * see: {@link NorskInput.audioSignal}
4402
+ */
4403
+ export declare class VideoTestcardGeneratorNode extends SourceMediaNode {
4404
+ }
4405
+
4406
+ /**
4407
+ * @public
4408
+ * Settings for an Video Testcard Generator
4409
+ * see: {@link NorskInput.videoTestcard}
4410
+ * */
4411
+ export declare interface VideoTestcardGeneratorSettings extends SourceNodeSettings<VideoTestcardGeneratorNode> {
4412
+ /** The source name to set in the stream key of the outgoing stream */
4413
+ sourceName: string;
4414
+ /** The number of frames to send before shutting down */
4415
+ numberOfFrames?: number;
4416
+ /** Resolution of the test card stream **/
4417
+ resolution: {
4418
+ width: number;
4419
+ height: number;
4420
+ };
4421
+ /** Framerate of the produced video stream **/
4422
+ frameRate: {
4423
+ frames: number;
4424
+ seconds: number;
4425
+ };
4426
+ pattern: Pattern;
4427
+ }
4428
+
4429
+ /** @public */
4430
+ export declare function videoToPin<Pins extends string>(pin: Pins): (streams: StreamMetadata[]) => PinToKey<Pins>;
4431
+
4432
+ /**
4433
+ * @public
4434
+ * see: {@link NorskTransform.videoTransform}
4435
+ */
4436
+ export declare class VideoTransformNode extends AutoProcessorMediaNode<"video"> {
4437
+ }
4438
+
4439
+ /**
4440
+ * @public
4441
+ * Settings for a Video Transform node
4442
+ * see: {@link NorskTransform.videoTransform}
4443
+ * */
4444
+ export declare interface VideoTransformSettings extends ProcessorNodeSettings<VideoTransformNode> {
4445
+ /** An optional resolution to rescale this single stream to */
4446
+ resolution?: Resolution;
4447
+ /** An optional framerate to resample this single stream to */
4448
+ frameRate?: FrameRate;
4449
+ /** An optional SAR to set on the outgoing stream
4450
+ * Note: You can set this and only this if the SAR on your incoming stream is incorrect
4451
+ * for example (An often-seen problem with sources)
4452
+ * */
4453
+ sar?: SampleAspectRatio;
4454
+ }
4455
+
4456
+ /**
4457
+ * @public
4458
+ * see: {@link NorskDuplex.webRtcBrowser}
4459
+ */
4460
+ export declare class WebRTCBrowserNode extends AutoProcessorMediaNode<"audio" | "video"> {
4461
+ /** @public The URL of the local player */
4462
+ playerUrl: string;
4463
+ }
4464
+
4465
+ /**
4466
+ * @public
4467
+ * Settings for a WebRTC browser session
4468
+ * see: {@link NorskDuplex.webRtcBrowser}
4469
+ * */
4470
+ export declare interface WebRTCBrowserSettings extends ProcessorNodeSettings<WebRTCBrowserNode>, StreamStatisticsMixin {
4471
+ iceServers?: IceServerSettings[];
4472
+ reportedIceServers?: IceServerSettings[];
4473
+ hostIps?: string[];
4474
+ serverReflexiveIps?: string[];
4475
+ /** Jitter buffer delay in milliseconds */
4476
+ bufferDelayMs?: number;
4477
+ }
4478
+
4479
+ /**
4480
+ * @public
4481
+ * see: {@link NorskOutput.whep}
4482
+ */
4483
+ export declare class WhepOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
4484
+ /** @public The URL of the local player */
4485
+ playerUrl: string;
4486
+ /** @public The URL of the WHEP endpoint */
4487
+ endpointUrl: string;
4488
+ }
4489
+
4490
+ /**
4491
+ * @public
4492
+ * The settings for a WebRTC WHEP Output
4493
+ * see {@link NorskOutput.whep}
4494
+ */
4495
+ export declare interface WhepOutputSettings extends SinkNodeSettings<WhepOutputNode>, StreamStatisticsMixin {
4496
+ iceServers?: IceServerSettings[];
4497
+ reportedIceServers?: IceServerSettings[];
4498
+ hostIps?: string[];
4499
+ serverReflexiveIps?: string[];
4500
+ /** Jitter buffer delay in milliseconds */
4501
+ bufferDelayMs?: number;
4502
+ }
4503
+
4504
+ /**
4505
+ * @public
4506
+ * see: {@link NorskInput.whip}
4507
+ */
4508
+ export declare class WhipInputNode extends SourceMediaNode {
4509
+ /** @public The URL of the local test client */
4510
+ clientUrl: string;
4511
+ /** @public The URL of the WHIP endpoint */
4512
+ endpointUrl: string;
4513
+ /**
4514
+ * @public
4515
+ * Applies a gradual nudge to the outgoing stream timestamps by the specified number of milliseconds
4516
+ * */
4517
+ nudge(sourceName: string, programNumber: number, nudge: number): void;
4518
+ }
4519
+
4520
+ /** @public */
4521
+ export declare interface WhipInputSettings extends InputSettings<WhipInputNode>, StreamStatisticsMixin {
4522
+ /** List of ice servers to use as part of session negotiation */
4523
+ iceServers?: IceServerSettings[];
4524
+ /** Internal addresses for the ice servers (defaults to iceServers) */
4525
+ reportedIceServers?: IceServerSettings[];
4526
+ /**
4527
+ * List of IPs to advertise as your host address - useful e.g. when on a cloud server
4528
+ * so that the public rather than private IP is used.
4529
+ */
4530
+ hostIps?: string[];
4531
+ /**
4532
+ * Similar to hostIps, but a list of server reflexive candidates so that ICE negotiations can be
4533
+ * sped up
4534
+ */
4535
+ serverReflexiveIps?: string[];
4536
+ }
4537
+
4538
+ /**
4539
+ * @public
4540
+ * see: {@link NorskOutput.whip}
4541
+ */
4542
+ export declare class WhipOutputNode extends AutoSinkMediaNode<"audio" | "video"> {
4543
+ }
4544
+
4545
+ /**
4546
+ * @public
4547
+ * The settings for a WebRTC Whip Output
4548
+ * see {@link NorskOutput.whip}
4549
+ */
4550
+ export declare interface WhipOutputSettings extends SinkNodeSettings<WhipOutputNode>, StreamStatisticsMixin {
4551
+ /**
4552
+ * The URI to make the initial publish request to (as per the WHIP protocol)
4553
+ */
4554
+ uri: string;
4555
+ /** The auth header to supply (for example: 'Bearer: mybearertoken') */
4556
+ authHeader: string;
4557
+ /** Jitter buffer delay in milliseconds */
4558
+ bufferDelayMs?: number;
4559
+ }
4560
+
4561
+ /** @public */
4562
+ export declare interface X264Codec {
4563
+ type: "x264";
4564
+ threads?: number;
4565
+ /**
4566
+ * Rate control options - one of abr, cqp or crf
4567
+ */
4568
+ bitrateMode?: BitrateMode;
4569
+ /**
4570
+ * Set the H264 profile of the output
4571
+ */
4572
+ profile?: X264Profile;
4573
+ /**
4574
+ * Sets the level flag in the output
4575
+ */
4576
+ level?: X264Level;
4577
+ /**
4578
+ * Sets the minimum length between IDR frames
4579
+ */
4580
+ keyFrameIntervalMin?: number;
4581
+ /**
4582
+ * Sets the maximum length between IDR frames
4583
+ */
4584
+ keyFrameIntervalMax?: number;
4585
+ /**
4586
+ * Sets the maximum number of concurrent B-frames
4587
+ */
4588
+ bframes?: number;
4589
+ /**
4590
+ * Tune options to further optimize them for your input content. If you
4591
+ * specify a tuning, the changes will be applied after 'preset' but before all
4592
+ * other parameters.
4593
+ */
4594
+ tune?: X264Tune;
4595
+ /**
4596
+ * Change options to trade off compression efficiency against encoding speed.
4597
+ * If you specify a preset, the changes it makes will be applied before all
4598
+ * other parameters are applied.
4599
+ */
4600
+ preset?: X264Preset;
4601
+ /**
4602
+ * Maximum number of reference frames, i.e., the number of previous frames
4603
+ * each P-frame can use as references
4604
+ */
4605
+ frameReference?: number;
4606
+ /**
4607
+ * Enables CABAC (Context Adaptive Binary Arithmetic Coder) stream compression
4608
+ * instead of the less efficient CAVLC (Context Adaptive Variable Length
4609
+ * Coder) system. Significantly improves both the compression efficiency
4610
+ * (10-20% typically) and the decoding requirements, at the expense of encode
4611
+ * CPU requirements
4612
+ */
4613
+ cabac?: boolean;
4614
+ /**
4615
+ * Sets the maximum rate the VBV buffer should be assumed to refill at
4616
+ */
4617
+ vbvMaxRate?: number;
4618
+ /**
4619
+ * Sets the size of the VBV buffer in kilobits
4620
+ */
4621
+ vbvBufferSize?: number;
4622
+ /**
4623
+ * Sets the threshold for I/IDR frame placement. Setting sceneCut to zero
4624
+ * disables adaptive I-frame decisioning
4625
+ */
4626
+ sceneCut?: number;
4627
+ /**
4628
+ * Use access unit delimiters in the output
4629
+ */
4630
+ aud?: boolean;
4631
+ /**
4632
+ * Disables the loop filter. Not Recommended.
4633
+ */
4634
+ noDeblock?: boolean;
4635
+ /**
4636
+ * Signal HRD information
4637
+ */
4638
+ nalHrd?: X264NalHrd;
4639
+ }
4640
+
4641
+ /**
4642
+ * @public
4643
+ * See the X264 Docs for a description of this value
4644
+ * */
4645
+ export declare type X264Level = 1 | 1.1 | 1.2 | 1.3 | 2 | 2.1 | 2.2 | 3 | 3.1 | 3.2 | 4 | 4.1 | 4.2 | 5 | 5.1;
4646
+
4647
+ /**
4648
+ * @public
4649
+ * Three possible values:
4650
+ *
4651
+ * - "none": specify no HRD information
4652
+ *
4653
+ * - "vbr": specify HRD information
4654
+ *
4655
+ * - "cbr": specify HRD information and pack the bitstream to the bitrate specified
4656
+ *
4657
+ * See the X264 Docs for a further description of this value
4658
+ */
4659
+ export declare type X264NalHrd = "none" | "vbr" | "cbr";
4660
+
4661
+ /**
4662
+ * @public
4663
+ * See the X264 Docs for a description of this value
4664
+ * */
4665
+ export declare type X264Preset = "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
4666
+
4667
+ /** @public */
4668
+ export declare type X264Profile = "baseline" | "main" | "high" | "high10" | "high422" | "high444";
4669
+
4670
+ /**
4671
+ * @public
4672
+ * See the X264 Docs for a description of this value
4673
+ * */
4674
+ export declare type X264Tune = "film" | "animation" | "grain" | "stillimage" | "psnr" | "ssim" | "fastdecode" | "zerolatency";
4675
+
4676
+ /** @public X265 codec */
4677
+ export declare interface X265Codec {
4678
+ type: "x265";
4679
+ threads?: number;
4680
+ bitrateMode?: BitrateMode;
4681
+ profile?: X265Profile;
4682
+ /**
4683
+ * Sets the level flag in the output
4684
+ */
4685
+ level?: X265Level;
4686
+ tier?: X265Tier;
4687
+ /**
4688
+ * Sets the minimum length between IDR frames
4689
+ */
4690
+ keyFrameIntervalMin?: number;
4691
+ /**
4692
+ * Sets the maximum length between IDR frames
4693
+ */
4694
+ keyFrameIntervalMax?: number;
4695
+ /**
4696
+ * Sets the maximum number of concurrent B-frames
4697
+ */
4698
+ bframes?: number;
4699
+ /**
4700
+ * Tune options to further optimize them for your input content. If you
4701
+ * specify a tuning, the changes will be applied after 'preset' but before all
4702
+ * other parameters.
4703
+ */
4704
+ tune?: X265Tune;
4705
+ /**
4706
+ * Change options to trade off compression efficiency against encoding speed.
4707
+ * If you specify a preset, the changes it makes will be applied before all
4708
+ * other parameters are applied.
4709
+ */
4710
+ preset?: X265Preset;
4711
+ /**
4712
+ * Maximum number of reference frames, i.e., the number of previous frames
4713
+ * each P-frame can use as references
4714
+ */
4715
+ frameReference?: number;
4716
+ /**
4717
+ * Sets the maximum rate the VBV buffer should be assumed to refill at
4718
+ */
4719
+ vbvMaxRate?: number;
4720
+ /**
4721
+ * Sets the size of the VBV buffer in kilobits
4722
+ */
4723
+ vbvBufferSize?: number;
4724
+ /**
4725
+ * Sets the threshold for I/IDR frame placement. Setting sceneCut to zero
4726
+ * disables adaptive I-frame decisioning
4727
+ */
4728
+ sceneCut?: number;
4729
+ /**
4730
+ * Use access unit delimiters in the output
4731
+ */
4732
+ aud?: boolean;
4733
+ /**
4734
+ * Disables the loop filter. Not Recommended.
4735
+ */
4736
+ noDeblock?: boolean;
4737
+ }
4738
+
4739
+ /**
4740
+ * @public
4741
+ * See the X265 Docs for a description of this value
4742
+ * */
4743
+ export declare type X265Level = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
4744
+
4745
+ /**
4746
+ * @public
4747
+ * See the X265 Docs for a description of this value
4748
+ * */
4749
+ export declare type X265Preset = "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
4750
+
4751
+ /**
4752
+ * @public
4753
+ * See the X265 Docs for a description of this value
4754
+ * */
4755
+ export declare type X265Profile = "main" | "main10" | "main444_8" | "main422_10" | "main444_10";
4756
+
4757
+ /**
4758
+ * @public
4759
+ * See the X265 Docs for a description of this value
4760
+ * */
4761
+ export declare type X265Tier = "main" | "high";
4762
+
4763
+ /**
4764
+ * @public
4765
+ * See the X265 Docs for a description of this value
4766
+ * */
4767
+ export declare type X265Tune = "psnr" | "ssim" | "grain" | "zerolatency" | "fastdecode" | "animation";
4768
+
4769
+ /**
4770
+ * @public
4771
+ * Settings for a H264 Encode using Netint Xilinx hardware
4772
+ * A detailed description of these params can be found
4773
+ * on the Netint Xilinx Encoder Documentation
4774
+ *
4775
+ * These fields have deliberately been written to maintain the same semantics as the
4776
+ * Xilinx documentation where possible.
4777
+ *
4778
+ * If left undefined, all will default to Xilinx's own defaults
4779
+ * */
4780
+ export declare interface XilinxH264 {
4781
+ type: "xilinx-h264";
4782
+ profile?: XilinxH264Profile;
4783
+ level?: XilinxH264Level;
4784
+ }
4785
+
4786
+ /** @public */
4787
+ export declare type XilinxH264Level = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
4788
+
4789
+ /** @public */
4790
+ export declare type XilinxH264Profile = "baseline" | "main" | "extended" | "high" | "high10";
4791
+
4792
+ /**
4793
+ * @public
4794
+ * Settings for a HEVC Encode using Netint Xilinx hardware
4795
+ * A detailed description of these params can be found
4796
+ * on the Netint Xilinx Encoder Documentation
4797
+ *
4798
+ * These fields have deliberately been written to maintain the same semantics as the
4799
+ * Xilinx documentation where possible.
4800
+ *
4801
+ * If left undefined, all will default to Xilinx's own defaults
4802
+ * */
4803
+ export declare interface XilinxHevc {
4804
+ type: "xilinx-hevc";
4805
+ profile?: XilinxHevcProfile;
4806
+ level?: XilinxHevcLevel;
4807
+ tier?: XilinxHevcTier;
4808
+ }
4809
+
4810
+ /** @public */
4811
+ export declare type XilinxHevcLevel = 1 | 2 | 2.1 | 3 | 3.1 | 4 | 4.1 | 5 | 5.1 | 5.2 | 6 | 6.1 | 6.2;
4812
+
4813
+ /** @public */
4814
+ export declare type XilinxHevcProfile = "main" | "main10";
4815
+
4816
+ /** @public */
4817
+ export declare type XilinxHevcTier = "main" | "high";
4818
+
4819
+ export { }