From d1e90c6aefb021b1851f7bc7231974a7ff30103f Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Tue, 13 Jun 2017 21:50:00 +0300 Subject: [PATCH] fixed bug with video sending --- toxygen/calls.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toxygen/calls.py b/toxygen/calls.py index cde8133..f7fa9cc 100644 --- a/toxygen/calls.py +++ b/toxygen/calls.py @@ -292,17 +292,17 @@ class AV: """ frame = cv2.cvtColor(frame, cv2.COLOR_BGR2YUV_I420) - y = frame[:self._video_height, :].tolist() + y = frame[:self._video_height, :] y = list(itertools.chain.from_iterable(y)) - u = np.zeros((self._video_width // 2, self._video_height // 2), dtype=np.int) - u[::2, :] = frame[self._video_height:self._video_height * 5 // 4, :self._video_height // 2] - u[1::2, :] = frame[self._video_height:self._video_height * 5 // 4, self._video_height // 2:] + u = np.zeros((self._video_height // 2, self._video_width // 2), dtype=np.int) + u[::2, :] = frame[self._video_height:self._video_height * 5 // 4, :self._video_width // 2] + u[1::2, :] = frame[self._video_height:self._video_height * 5 // 4, self._video_width // 2:] u = list(itertools.chain.from_iterable(u)) - v = np.zeros((self._video_width // 2, self._video_height // 2), dtype=np.int) - v[::2, :] = frame[self._video_height * 5 // 4:, :self._video_height // 2] - v[1::2, :] = frame[self._video_height * 5 // 4:, self._video_height // 2:] + v = np.zeros((self._video_height // 2, self._video_width // 2), dtype=np.int) + v[::2, :] = frame[self._video_height * 5 // 4:, :self._video_width // 2] + v[1::2, :] = frame[self._video_height * 5 // 4:, self._video_width // 2:] v = list(itertools.chain.from_iterable(v)) return bytes(y), bytes(u), bytes(v)