-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample-usage.js
147 lines (131 loc) · 3.41 KB
/
example-usage.js
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// const EDL = require('edl_composer');
const fs = require('fs');
const EDL = require('./index.js');
var edlSq = {
"title": "Demo Title of project",
"events": [
{ "id":1,
"startTime": 10, // in seconds
"endTime": 20,
"reelName":"SomeReelName",
"clipName":"Something.mov",
"offset": "00:00:28:08", //offset is optional default is "00:00:00:00"
"fps": 25
},
{ "id":2,
"startTime": 45,
"endTime": 55,
"reelName":"SomeOtherReelName",
"clipName":"SomethingElse.mov",
"offset": "00:00:28:08",
"fps": 29.97
},
{ "id":2,
"startTime": 45,
"endTime": 55,
"reelName":"NA",
"clipName":"SomethingElse.mp4",
"offset": "00:00:28:08",
"fps": 24
}
]
}
var edl = new EDL(edlSq)
const dat1 = edl.compose();
fs.writeFileSync('./sample-output/regualr.edl',dat1);
// console.log('---')
/*
* returns
TITLE: Demo Title of project
FCM: NON-DROP FRAME
001 SOMEREE AA/V C 00:00:00:00 00:00:00:00 00:00:00:00 00:00:10:00
* FROM CLIP NAME: Something.mov
FINAL CUT PRO REEL: SomeReelName REPLACED BY: SOMEREE
002 SOMEOTH AA/V C 00:00:00:00 00:00:00:00 00:00:10:00 00:00:20:00
* FROM CLIP NAME: SomethingElse.mov
FINAL CUT PRO REEL: SomeOtherReelName REPLACED BY: SOMEOTH
002 AX AA/V C 00:00:00:00 00:00:00:00 00:00:20:00 00:00:30:00
* FROM CLIP NAME: SomethingElse.mov
*/
var edlSqWithMxf = {
"title": "Demo MXF EDL project",
"events": [
{ "id":1,
"startTime": 1.62, // in seconds
"endTime": 11.86,
"reelName":"NA",
"clipName":"516_0008.MXF",
"offset": "00:38:43:04", //offset is optional default is "00:00:00:00"
"fps": 25//23.98
},
{ "id":2,
"startTime": 16.02,
"endTime": 22.98,
"reelName":"NA",
"clipName":"516_0008.MXF",
"offset": "00:38:43:04",
"fps":23.98
},
// { "id":3,
// "startTime": 23,
// "endTime": 24,
// "reelName":"NA",
// "clipName":"516_0008.MXF",
// "offset": "00:38:43:04",
// "fps":23.98
// },
// { "id":4,
// "startTime": 16.02,
// "endTime": 22.98,
// "reelName":"NA",
// "clipName":"516_0008.MXF",
// "offset": "00:38:43:04",
// "fps": 23.98
// },
]
}
var edlWithMxf = new EDL(edlSqWithMxf)
const data = edlWithMxf.compose();
console.log(data)
fs.writeFileSync('./sample-output/mxfedl.edl',data);
var edlSqMixedMxf = {
"title": "Demo MXF EDL project",
"events": [
{ "id":1,
"startTime": 1.62, // in seconds
"endTime": 11.86,
"reelName":"NA",
"clipName":"516_0008.mp4",
"offset": "00:38:43:04", //offset is optional default is "00:00:00:00"
"fps": 25//23.98
},
{ "id":2,
"startTime": 16.02,
"endTime": 22.98,
"reelName":"NA",
"clipName":"516_0008.MXF",
"offset": "00:38:43:04",
"fps":23.98
},
{ "id":3,
"startTime": 23,
"endTime": 24,
"reelName":"NA",
"clipName":"516_0008.mov",
"offset": "00:38:43:04",
"fps":23.98
},
{ "id":4,
"startTime": 16.02,
"endTime": 22.98,
"reelName":"NA",
"clipName":"516_0008.MXF",
"offset": "00:38:43:04",
"fps": 23.98
},
]
}
var edlMixedMxf = new EDL(edlSqMixedMxf)
const dataMixed = edlMixedMxf.compose();
console.log(dataMixed)
fs.writeFileSync('./sample-output/mixed-mxfedl.edl',dataMixed);