-
Notifications
You must be signed in to change notification settings - Fork 0
/
ffmpeg-input-slovakia.js
117 lines (110 loc) · 2.59 KB
/
ffmpeg-input-slovakia.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
var fs = require('fs');
let computedInput = "";
let fileName = "montage-slovakia.txt";
let sequences = [{
path: "/Volumes/Volumina/frames/ravines/intro-fade-in/intro-fade-in-",
start: 1,
end: 950,
copies: 1
},
{
path: "/Volumes/Volumina/frames/ravines/oily-non-cartesian/oily-non-cartesian-",
start: 1,
end: 633,
copies: 1
},
{
path: "/Volumes/Volumina/frames/ravines/non-cartesian-cauliflower/non-cartesian-cauliflower-",
start: 1,
end: 817,
copies: 1
},
{
path: "/Volumes/Volumina/frames/ravines/muscular-pyramid2/muscular-pyramid2-",
start: 1,
end: 596,
copies: 1
},
{
path: "/Volumes/Volumina/frames/ravines/star/star-",
start: 1,
end: 619,
copies: 1
},
{
path: "/Volumes/Volumina/frames/ravines/star-fade-out/star-fade-out-",
start: 620,
end: 842,
copies: 1
}
];
let credits = [{
path: "./frames/credits/fondnoir-",
start: 1,
end: 1,
copies: 2
},
{
path: "./frames/credits/1-",
start: 1,
end: 3,
copies: 14
},
{
path: "./frames/credits/2-",
start: 1,
end: 3,
copies: 14
},
{
path: "./frames/credits/3-",
start: 1,
end: 3,
copies: 25
},
{
path: "./frames/credits/4-",
start: 1,
end: 3,
copies: 14
},
{
path: "./frames/credits/fondnoir-",
start: 1,
end: 1,
copies: 6
}
];
for (s of sequences) {
for (let f = s.start; f <= s.end; f++) {
var formattedF = "" + f;
while (formattedF.length < 5) {
formattedF = "0" + formattedF;
}
let line = `file '${s.path}${formattedF}.png'\n`;
for (let i = 0; i < s.copies; i++) {
computedInput += line;
}
}
}
// Building the credits requires a slightly different algorithm.
for (s of credits) {
for (let i = 0; i < s.copies; i++) {
for (let f = s.start; f <= s.end; f++) {
var formattedF = "" + f;
while (formattedF.length < 5) {
formattedF = "0" + formattedF;
}
let line = `file '${s.path}${formattedF}.png'\n`;
computedInput += line;
computedInput += line;
}
}
}
fs.writeFile(fileName, computedInput, function(err) {
if (err) {
return console.error(err);
} else {
console.log(fileName + ' written successfully.');
}
});