-
Notifications
You must be signed in to change notification settings - Fork 10
/
TsMuxing.ts
79 lines (69 loc) · 2.53 KB
/
TsMuxing.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
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';
import TsMuxingConfiguration from './TsMuxingConfiguration';
/**
* @export
* @class TsMuxing
*/
export class TsMuxing extends Muxing {
/**
* Discriminator property for Muxing
* @type {string}
* @memberof TsMuxing
*/
public readonly type: MuxingType = MuxingType.TS;
/**
* Length of the fragments in seconds
* @type {number}
* @memberof TsMuxing
*/
public segmentLength?: number;
/**
* Segment naming policy
* @type {string}
* @memberof TsMuxing
*/
public segmentNaming?: string;
/**
* Segment naming policy containing one or both of the following placeholders: - '{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. - '{segment_rand_chars:x}', which will be replaced by a random alphanumeric string of length x (default 32) for each different segment. This is intended to avoid guessing segment URLs by replacing segment numbers. If segmentNamingTemplate is set, segmentNaming must not be set.
* @type {string}
* @memberof TsMuxing
*/
public segmentNamingTemplate?: string;
/**
* Offset of MPEG-TS timestamps in seconds. E.g., first packet will start with PTS 900,000 for a 10 seconds offset (90,000 MPEG-TS timescale).
* @type {number}
* @memberof TsMuxing
*/
public startOffset?: number;
/**
* Number of segments which have been encoded
* @type {number}
* @memberof TsMuxing
*/
public segmentsMuxed?: number;
/**
* Advanced Configuration of the MPEG Transport Stream Parameters
* @type {TsMuxingConfiguration}
* @memberof TsMuxing
*/
public configuration?: TsMuxingConfiguration;
constructor(obj?: Partial<TsMuxing>) {
super(obj);
if(!obj) {
return;
}
this.segmentLength = map(obj.segmentLength);
this.segmentNaming = map(obj.segmentNaming);
this.segmentNamingTemplate = map(obj.segmentNamingTemplate);
this.startOffset = map(obj.startOffset);
this.segmentsMuxed = map(obj.segmentsMuxed);
this.configuration = map(obj.configuration, TsMuxingConfiguration);
}
}
export default TsMuxing;