-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffmpeg2.js
45 lines (40 loc) · 878 Bytes
/
ffmpeg2.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
const ffmpeg2 = (youtube, twitch, facebook, customRTMP) => {
return [
'-i',
'-',
// select first stream intended for output
'-map',
'0',
// video codec config: low latency, adaptive bitrate
'-c:v',
'libx264',
'-preset',
'veryfast',
'-tune',
'zerolatency',
'-g:v',
'60',
// audio codec config: sampling frequency (11025, 22050, 44100), bitrate 64 kbits
'-c:a',
'aac',
'-strict',
'-2',
'-ar',
'44100',
'-b:a',
'64k',
//force to overwrite
'-y',
// used for audio sync
'-use_wallclock_as_timestamps',
'1',
'-async',
'1',
'-flags',
'+global_header',
'-f',
'tee',
`[f=flv:onfail=ignore]${youtube}|[f=flv:onfail=ignore]${twitch}|[f=flv:onfail=ignore]${facebook}|[f=flv:onfail=ignore]${customRTMP}`,
]
}
module.exports.ffmpeg2 = ffmpeg2