increase read size and listen on local

This commit is contained in:
Blake Blackshear 2021-05-30 07:36:33 -05:00
parent 8413e10091
commit 4e0203ca68

View File

@ -20,7 +20,7 @@ from frigate.util import SharedMemoryFrameManager
class FFMpegConverter(object): class FFMpegConverter(object):
def __init__(self): def __init__(self):
ffmpeg_cmd = "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i pipe: -f mpegts -s 1280x720 -codec:v mpeg1video -b:v 1000k -bf 0 pipe:".split( ffmpeg_cmd = "ffmpeg -f rawvideo -pix_fmt yuv420p -video_size 1920x1080 -i pipe: -f mpegts -s 640x360 -codec:v mpeg1video -b:v 1000k -bf 0 pipe:".split(
" " " "
) )
self.process = sp.Popen( self.process = sp.Popen(
@ -55,7 +55,7 @@ class BroadcastThread(threading.Thread):
def run(self): def run(self):
while True: while True:
buf = self.converter.read(4096) buf = self.converter.read(65536)
if buf: if buf:
self.websocket_server.manager.broadcast(buf, binary=True) self.websocket_server.manager.broadcast(buf, binary=True)
elif self.converter.process.poll() is not None: elif self.converter.process.poll() is not None:
@ -80,7 +80,7 @@ def output_frames(config, video_output_queue):
# start a websocket server on 8082 # start a websocket server on 8082
WebSocketWSGIHandler.http_version = "1.1" WebSocketWSGIHandler.http_version = "1.1"
websocket_server = make_server( websocket_server = make_server(
"", "127.0.0.1",
8082, 8082,
server_class=WSGIServer, server_class=WSGIServer,
handler_class=WebSocketWSGIRequestHandler, handler_class=WebSocketWSGIRequestHandler,