From 6aa0c3ca124467b21057486d70c1a322e6e3469a Mon Sep 17 00:00:00 2001 From: felix Date: Fri, 23 Aug 2019 14:44:39 +0800 Subject: [PATCH] fix(ffmpeg-video): fig bug for scaling videos to stdout --- gnes/service/base.py | 10 ++++++---- gnes/service/frontend.py | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gnes/service/base.py b/gnes/service/base.py index c440951b..89f3595a 100644 --- a/gnes/service/base.py +++ b/gnes/service/base.py @@ -129,11 +129,13 @@ def build_socket(ctx: 'zmq.Context', host: str, port: int, socket_type: 'SocketT sock.setsockopt(zmq.SUBSCRIBE, identity.encode('ascii') if identity else b'') # sock.setsockopt(zmq.SUBSCRIBE, b'') - sock.setsockopt(zmq.RCVHWM, 100) - sock.setsockopt(zmq.RCVBUF, 512 * 1024 * 1024) # network buffer 512M - sock.setsockopt(zmq.SNDHWM, 100) - sock.setsockopt(zmq.SNDBUF, 512 * 1024 * 1024) + # Note: the following very dangerous for pub-sub socketc + sock.setsockopt(zmq.RCVHWM, 10) + sock.setsockopt(zmq.RCVBUF, 10 * 1024 * 1024) # limit of network buffer 100M + + sock.setsockopt(zmq.SNDHWM, 10) + sock.setsockopt(zmq.SNDBUF, 10 * 1024 * 1024) # limit of network buffer 100M return sock, sock.getsockopt_string(zmq.LAST_ENDPOINT) diff --git a/gnes/service/frontend.py b/gnes/service/frontend.py index d9316031..8604c74d 100644 --- a/gnes/service/frontend.py +++ b/gnes/service/frontend.py @@ -137,9 +137,10 @@ def Search(self, request, context): def StreamCall(self, request_iterator, context): with self.zmq_context as zmq_client: - num_request = 0 # network traffic control - max_outstanding = 1000 + num_request = 0 + max_outstanding = 500 + for request in request_iterator: timeout = 25 if self.args.timeout > 0: