Skip to content

Commit

Permalink
👉 Update: resize preview window to fixed size, show current selected …
Browse files Browse the repository at this point in the history
…video in the UI
  • Loading branch information
AdnanMuhib committed Mar 2, 2019
1 parent 4d0bf05 commit f3dac57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ def btnPreviewVideo_clicked(self):
for x in range(int(nframe)):
flag, frame = cap.read()
if flag:
cv2.imshow('frame',frame)
res = cv2.resize(frame,(400, 400), interpolation = cv2.INTER_CUBIC)
cv2.imshow('frame',res)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
Expand All @@ -241,6 +242,7 @@ def btnNextVideo_clicked(self):
if(self.current_index < len(self.data_videos) - 1):
self.current_index = self.current_index + 1
print(self.data_videos[self.current_index])
self.label_5.setText("Selected Video -> " + self.data_videos[self.current_index])

def btnPreviousVideo_clicked(self):
if self.data_videos == None:
Expand All @@ -249,6 +251,7 @@ def btnPreviousVideo_clicked(self):
if(self.current_index >= 0):
self.current_index = self.current_index - 1
print(self.data_videos[self.current_index])
self.label_5.setText("Selected Video -> " + self.data_videos[self.current_index])

def atoi(self, text):
return int(text) if text.isdigit() else text
Expand All @@ -265,6 +268,7 @@ def UpdateVideosList(self):
if(i.endswith('.mp4') or i.endswith('.avi')):
item = QtGui.QStandardItem(i)
model.appendRow(item)
self.label_5.setText("Selected Video -> " + self.data_videos[0])
def btnBrowseVideosFolder_clicked(self):
folder = QtGui.QFileDialog.getExistingDirectory(None,'Select Videos Folder')
if folder != None:
Expand Down

0 comments on commit f3dac57

Please sign in to comment.