视频分析2.0 多进程拆分仓库
zhangmeng
2019-05-07 ae15376db2c1b2497b01589c5ec810ab0511560b
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
package main
 
import (
    "analysis/demo"
    srv "analysis/work/service"
    "flag"
    "fmt"
)
 
var (
    streamURL string
    picFolder string
 
    asServer bool
)
 
func init() {
    flag.StringVar(&streamURL, "i", "rtsp://192.168.1.203:8554/16.mkv", "input url")
    flag.StringVar(&picFolder, "f", ".", "test pic folder")
 
    flag.StringVar(&ipcURL, "ipc", "ipc:///tmp/pic.ipc", "ipc label")
    flag.StringVar(&proc, "proc", "", "proc name")
 
    flag.BoolVar(&asServer, "server", false, "run ipc as server")
}
 
const (
    sender   = "snd"
    reciever = "rcv"
)
 
func main() {
    flag.Parse()
 
    fmt.Println("start test, pic folder: ", picFolder)
 
    imageChan := make(chan srv.ImageInfo)
    d := srv.NewReciever(ipcURL, imageChan)
 
    if asServer {
        go d.RunAsServer()
    } else {
        go d.RunAsClient()
    }
 
    demo.ShowYolo(imageChan)
 
    fakeStartProc()
}