gwuhaolin / livego

live video streaming server in golang
MIT License
9.66k stars 2k forks source link

在windowsserver下当有13个推流时,偶尔会抛出内存异常,无法长时间稳定运行, #81

Open lhb303re opened 4 years ago

lhb303re commented 4 years ago

2020/01/13 16:01:32 writer.go:168: http flv closed 2020/01/13 16:01:34 server.go:102: url: /live/tl2v1.flv path: live/tl2v1 paths: [live tl2v1] 2020/01/13 16:01:34 stream.go:57: HandleWriter: info[<key: live/tl2v1, URL: /live/tl2v1.flv, UID: Kd87iSAxQfe4HgMJ, Inter: true>] panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x18 pc=0x64bbf3]

goroutine 2244832 [running]: bufio.(Writer).Flush(0xc002e60140, 0xc00222f657, 0x152) /opt/hostedtoolcache/go/1.13.3/x64/src/bufio/bufio.go:593 +0x63 bufio.(Writer).Write(0xc002e60140, 0xc00222f657, 0x2ae, 0x459a9, 0xb, 0x0, 0x0) /opt/hostedtoolcache/go/1.13.3/x64/src/bufio/bufio.go:629 +0xeb net/http.(response).write(0xc00017a700, 0x2ae, 0xc00222f657, 0x2ae, 0x459a9, 0x0, 0x0, 0xb, 0x0, 0x0) /opt/hostedtoolcache/go/1.13.3/x64/src/net/http/server.go:1572 +0x2a1 net/http.(response).Write(0xc00017a700, 0xc00222f657, 0x2ae, 0x459a9, 0xb, 0x0, 0x0) /opt/hostedtoolcache/go/1.13.3/x64/src/net/http/server.go:1541 +0x5d github.com/gwuhaolin/livego/protocol/httpflv.(*FLVWriter).SendPacket(0xc001a103c0, 0xc000160440, 0x10) /home/runner/work/livego/livego/protocol/httpflv/writer.go:143 +0x198 github.com/gwuhaolin/livego/protocol/httpflv.NewFLVWriter.func1(0xc001a103c0) /home/runner/work/livego/livego/protocol/httpflv/writer.go:49 +0x36 created by github.com/gwuhaolin/livego/protocol/httpflv.NewFLVWriter /home/runner/work/livego/livego/protocol/httpflv/writer.go:48 +0x365

lhb303re commented 4 years ago

ffmpeg -threads 4 -i rtmp://down.qqq.com/live/tl/all-10 -an -profile:v baseline -tune zerolatency -c:v libx264 -x264-params level=30::bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:rc-lookahead=0:weightb=0:fast-pskip=0:mixed-refs=1:partitions=all -preset superfast -s svga -r 12+1 -keyint_min 122 -g 124 -sc_threshold 0 -b:v 300k -minrate 50k -maxrate 50k -pix_fmt yuv420p -f flv -flv_metadata 1 rtmp://127.0.0.1:1935/live/tldt11

推流命令