-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathtransition.js
42 lines (38 loc) · 937 Bytes
/
transition.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
var videoshow = require('../')
var audio = __dirname + '/../test/fixtures/song.mp3'
var options = {
transition: true
}
var images = [
{
path: __dirname + '/../test/fixtures/step_1.png',
disableFadeOut: true,
loop: 2
}, {
path: __dirname + '/../test/fixtures/step_2.png',
disableFadeIn: true,
loop: 5
}, {
path: __dirname + '/../test/fixtures/step_3.png',
transitionColor: '0xFF66C7'
}, {
path: __dirname + '/../test/fixtures/step_4.png',
transition: false,
transitionColor: 'red'
}, {
path: __dirname + '/../test/fixtures/step_5.png',
transition: false
}
]
videoshow(images, options)
.audio(audio)
.save('video.mp4')
.on('start', function (command) {
console.log('ffmpeg process started:', command)
})
.on('error', function (err) {
console.error('Error:', err)
})
.on('end', function (output) {
console.log('Video created in:', output)
})