forked from pulsejet/memories
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
48 lines (40 loc) · 851 Bytes
/
main.go
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
package main
import (
"fmt"
"log"
"os"
"github.com/pulsejet/memories/go-vod/transcoder"
)
const VERSION = "0.2.4"
func main() {
// Build initial configuration
c := &transcoder.Config{
VersionMonitor: false,
Version: VERSION,
Bind: ":47788",
ChunkSize: 3,
LookBehind: 3,
GoalBufferMin: 1,
GoalBufferMax: 4,
StreamIdleTime: 60,
ManagerIdleTime: 60,
}
// Parse arguments
for _, arg := range os.Args[1:] {
if arg == "-version-monitor" {
c.VersionMonitor = true
} else if arg == "-version" {
fmt.Print("go-vod " + VERSION)
return
} else {
c.FromFile(arg) // config file
}
}
// Auto detect ffmpeg and ffprobe
c.AutoDetect()
// Start server
code := transcoder.NewHandler(c).Start()
// Exit
log.Println("Exiting go-vod with status code", code)
os.Exit(code)
}