From 935d5ade76ca81ce87548fef85a435d35bc53842 Mon Sep 17 00:00:00 2001 From: TonyChyi Date: Tue, 11 Oct 2022 07:47:04 +0800 Subject: [PATCH] video latency should be less --- TODO | 5 ++++- lib/webrtcconnection/connection.go | 2 +- servers/qemuserver/server.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 5d078b1..4e5292f 100644 --- a/TODO +++ b/TODO @@ -12,4 +12,7 @@ 1. 虚拟设备应当一直运行,无阻塞 # 2022-10-10 -1. 视频设备延迟过高 \ No newline at end of file +1. 视频设备延迟过高 + +# 2022-10-11 +1. 解决视频设备延迟 \ No newline at end of file diff --git a/lib/webrtcconnection/connection.go b/lib/webrtcconnection/connection.go index 605beb7..07cb257 100644 --- a/lib/webrtcconnection/connection.go +++ b/lib/webrtcconnection/connection.go @@ -119,7 +119,7 @@ func setupCodec(videoBPS int) (*mediadevices.CodecSelector, error) { return nil, err } x264Prarm.BitRate = videoBPS - x264Prarm.Preset = x264.PresetMedium + x264Prarm.Preset = x264.PresetFaster opusParam, err := opus.NewParams() if err != nil { diff --git a/servers/qemuserver/server.go b/servers/qemuserver/server.go index ef0b4d4..7d63af6 100644 --- a/servers/qemuserver/server.go +++ b/servers/qemuserver/server.go @@ -39,7 +39,7 @@ func NewServer(o *Options) (*Server, error) { options: o, audioHeader: make(chan *audio.WavHeader, 1), pcm: make(chan []byte), - ppm: make(chan io.ReadCloser, int(o.Video.FPS)), // to be configured + ppm: make(chan io.ReadCloser), // to be configured } u, err := url.Parse(o.QmpAddress) @@ -130,7 +130,7 @@ func (s *Server) Run() error { case <-ticker.C: continue } - //<-ticker.C + <-ticker.C } }()