-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
65 lines (59 loc) · 2.06 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
/*
███ ███ ██████ ███ ██ 👑 ██████ ██ ██ ██████ █████
████ ████ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ ██ ██ ██ ██ ██ ██ ██████ ██ ██ ██ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██ ████ ██ ██████ ██████ ██████ ██ ██
The live stream server for Go
(c) dexter 2019-present
*/
import (
"context"
"flag"
"fmt"
"os"
"time"
"m7s.live/engine/v4"
"m7s.live/engine/v4/util"
_ "m7s.live/plugin/admin/v4"
_ "m7s.live/plugin/cascade/v4"
_ "m7s.live/plugin/cdn/v4"
_ "m7s.live/plugin/crypto/v4"
_ "m7s.live/plugin/debug/v4"
_ "m7s.live/plugin/ffmpeg/v4"
_ "m7s.live/plugin/gb28181/v4"
_ "m7s.live/plugin/hdl/v4"
_ "m7s.live/plugin/hls/v4"
_ "m7s.live/plugin/hook/v4"
_ "m7s.live/plugin/jessica/v4"
_ "m7s.live/plugin/logrotate/v4"
_ "m7s.live/plugin/preview/v4"
_ "m7s.live/plugin/record/v4"
_ "m7s.live/plugin/room/v4"
_ "m7s.live/plugin/rtmp/v4"
_ "m7s.live/plugin/rtsp/v4"
_ "m7s.live/plugin/sei/v4"
_ "m7s.live/plugin/transcode/v4"
_ "m7s.live/plugin/voice/v4"
_ "m7s.live/plugin/webrtc/v4"
_ "m7s.live/plugin/webtransport/v4"
)
var (
version = "dev"
)
func main() {
if len(os.Args) > 1 && os.Args[1] == "version" {
fmt.Print(version)
return
}
fmt.Println("start monibuca pro version:", version)
conf := flag.String("c", "config.yaml", "config file")
flag.Parse()
_ctx := context.WithValue(context.Background(), "version", version)
ctx, cancel := context.WithTimeout(_ctx, time.Hour)
// ctx, cancel := context.WithDeadline(_ctx, time.Date(2025, 3, 1, 0, 0, 0, 0, time.UTC))
// ctx, cancel := context.WithCancel(_ctx)
go util.WaitTerm(cancel)
engine.Run(ctx, *conf)
}