Skip to content

Commit

Permalink
Change crop to expand
Browse files Browse the repository at this point in the history
  • Loading branch information
JargeZ committed Aug 13, 2021
1 parent e7a584c commit 48f5919
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from imutils.video import FileVideoStream

from app.logs import logger
from app.funcs import resize_to_height, trim_to_4width
from app.funcs import resize_to_height, trim_to_4width, expand_to_4width


class Renderer(QtCore.QObject):
Expand Down Expand Up @@ -64,7 +64,6 @@ def run(self):
time.sleep(0.3)
continue

# cap.set(1, frame_index)
frame_index += 1
frame = cap.read()
if frame is None or not self.running:
Expand All @@ -77,13 +76,15 @@ def run(self):

# crash workaround
if render_wh[0] % 4 != 0:
frame = trim_to_4width(frame)
frame = expand_to_4width(frame)

if self.mainEffect:
frame = self.render_data["nt"].composite_layer(frame, frame, field=2, fieldno=2)
frame = cv2.convertScaleAbs(frame)
frame[1:-1:2] = frame[0:-2:2] / 2 + frame[2::2] / 2

frame = frame[:, 0:render_wh[0]]

if frame_index % 10 == 0 or self.liveView:
self.frameMoved.emit(frame_index)
self.newFrame.emit(frame)
Expand Down

0 comments on commit 48f5919

Please sign in to comment.