-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfont.js
31 lines (29 loc) · 1021 Bytes
/
font.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
/*drawtext="fontfile=/path/to/font.ttf: \
text='Stack Overflow': fontcolor=white: fontsize=24: box=1: [email protected]: \
boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" -codec:a copy*/
let ffmpeg = require('fluent-ffmpeg');
let Promise = require('bluebird')
ffmpeg('./black.mp4')
//.addOption('-vf', `drawtext="fontfile=./fonts/SIXTY.TTF: text='Título do imóvel, que pode ser bem grande ou bem pequeno, tratar isso...': fontcolor=white: fontsize=24: box=1: [email protected]: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2"`)
.addOption('-strict', 'experimental')
.complexFilter({
filter: 'drawtext',
options: {
'fontfile': 'SIXTY.TTF',
'text': 'Lindo apartamento na Barra da Tijuca',
fontsize: 24,
fontcolor: 'white',
borderw: 3,
bordercolor: 'black',
box: 0,
x: '(w-text_w)/2',
y: '(h-text_h)/2'
}
})
.on('end', () => {
console.log('Done')
})
.on('error', (err) => {
console.log(err)
})
.saveToFile('./output_audio.mp4')