Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(ffmpeg-video): fig bug for scaling videos to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
felix committed Sep 20, 2019
1 parent 780aad0 commit 6aa0c3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions gnes/service/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions gnes/service/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6aa0c3c

Please sign in to comment.