Skip to content

Commit

Permalink
Restore configurations to troubleshoot
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Jan 19, 2023
1 parent 93b0320 commit 7c4d8b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/selkies_gstreamer/gstwebrtc_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def build_video_pipeline(self):

# encoder
x264enc = Gst.ElementFactory.make("x264enc", "x264enc")
x264enc.set_property("sliced-threads", True)
x264enc.set_property("threads", 4)
x264enc.set_property("bframes", 0)
x264enc.set_property("key-int-max", 0)
x264enc.set_property("byte-stream", True)
Expand Down Expand Up @@ -380,6 +380,7 @@ def build_video_pipeline(self):

# VPX Parameters
# Borrowed from: https://github.com/nurdism/neko/blob/df98368137732b8aaf840e27cdf2bd41067b2161/server/internal/gst/gst.go#L94
vpenc.set_property("threads", 4)
vpenc.set_property("cpu-used", 8)
vpenc.set_property("deadline", 1)
vpenc.set_property("error-resilient", "partitions")
Expand Down Expand Up @@ -759,12 +760,11 @@ def send_clipboard_data(self, data):
CLIPBOARD_RESTRICTION = 65488
clipboard_message = base64.b64encode(data.encode()).decode("utf-8")
clipboard_length = len(clipboard_message)
logger.debug("clipboard base64 encoded message length: %d" % clipboard_length)
if clipboard_length <= CLIPBOARD_RESTRICTION:
self.__send_data_channel_message(
"clipboard", {"content": clipboard_message})
else:
logger.warning("clipboard may not be sent to the client because the base64 message length {} is {} above the maximum length of {}".format(clipboard_length, clipboard_length - CLIPBOARD_RESTRICTION, CLIPBOARD_RESTRICTION))
logger.warning("clipboard may not be sent to the client because the base64 message length {} is above the maximum length of {}".format(clipboard_length, CLIPBOARD_RESTRICTION))

def send_cursor_data(self, data):
self.last_cursor_sent = data
Expand Down Expand Up @@ -891,7 +891,7 @@ def __send_data_channel_message(self, msg_type, data):

msg = {
"type": msg_type,
"data": data
"data": data,
}
self.data_channel.emit("send-string", json.dumps(msg))

Expand Down

0 comments on commit 7c4d8b6

Please sign in to comment.