-
Notifications
You must be signed in to change notification settings - Fork 10
/
CmafMuxing.ts
86 lines (75 loc) · 2.77 KB
/
CmafMuxing.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import {map, mapArray} from '../common/Mapper';
import EncodingOutput from './EncodingOutput';
import Ignoring from './Ignoring';
import Muxing from './Muxing';
import MuxingStream from './MuxingStream';
import MuxingType from './MuxingType';
import StreamConditionsMode from './StreamConditionsMode';
/**
* @export
* @class CmafMuxing
*/
export class CmafMuxing extends Muxing {
/**
* Discriminator property for Muxing
* @type {string}
* @memberof CmafMuxing
*/
public readonly type: MuxingType = MuxingType.CMAF;
/**
* Length of the fragments in seconds (required)
* @type {number}
* @memberof CmafMuxing
*/
public segmentLength?: number;
/**
* Segment naming policy
* @type {string}
* @memberof CmafMuxing
*/
public segmentNaming?: string;
/**
* Segment naming policy containing a placeholder of the format '{rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) on each (re)start of the encoding. The resulting string will be copied to the segmentNaming property. Intended to avoid re-use of segment names after restarting a live encoding. If segmentNamingTemplate is set, segmentNaming must not be set.
* @type {string}
* @memberof CmafMuxing
*/
public segmentNamingTemplate?: string;
/**
* Init segment name
* @type {string}
* @memberof CmafMuxing
*/
public initSegmentName?: string;
/**
* Segment naming policy containing a placeholder of the format '{rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) on each (re)start of the encoding. The resulting string will be copied to the initSegmentName property. Intended to avoid re-use of segment names after restarting a live encoding. If initSegmentNameTemplate is set, initSegmentName must not be set.
* @type {string}
* @memberof CmafMuxing
*/
public initSegmentNameTemplate?: string;
/**
* Number of segments which have been encoded
* @type {number}
* @memberof CmafMuxing
*/
public segmentsMuxed?: number;
/**
* Number of media frames per CMAF chunk. Defaults to: Length of a segment in frames. Minimum: 1. Maximum: Length of a segment in frames.
* @type {number}
* @memberof CmafMuxing
*/
public framesPerCmafChunk?: number;
constructor(obj?: Partial<CmafMuxing>) {
super(obj);
if(!obj) {
return;
}
this.segmentLength = map(obj.segmentLength);
this.segmentNaming = map(obj.segmentNaming);
this.segmentNamingTemplate = map(obj.segmentNamingTemplate);
this.initSegmentName = map(obj.initSegmentName);
this.initSegmentNameTemplate = map(obj.initSegmentNameTemplate);
this.segmentsMuxed = map(obj.segmentsMuxed);
this.framesPerCmafChunk = map(obj.framesPerCmafChunk);
}
}
export default CmafMuxing;