Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a946567

Browse files
Merge pull request avinashkranjan#2789 from avinashkranjan/deepsource-transform-9c7405a4
format code with autopep8
2 parents f59321d + ef4acc3 commit a946567

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

‎Video reversing/video_reversing.py‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
window = tk.Tk()
66
window.title("Video reversing")
77
window.geometry('400x200')
8-
label = tk.Label(window, text="Input video file should be in the current folder").grid(row=0, column=0)
9-
label = tk.Label(window, text="Output/reversed video file is saved in the current folder").grid(row=1, column=0)
10-
label = tk.Label(window, text="Close this dialog box to proceed").grid(row=3, column=0)
8+
label = tk.Label(window, text="Input video file should be in the current folder").grid(
9+
row=0, column=0)
10+
label = tk.Label(
11+
window, text="Output/reversed video file is saved in the current folder").grid(row=1, column=0)
12+
label = tk.Label(window, text="Close this dialog box to proceed").grid(
13+
row=3, column=0)
1114
window.mainloop()
1215

1316

@@ -27,19 +30,19 @@
2730
print("No. of frames: ", frames)
2831
print("FPS: ", fps)
2932

30-
frameIdx = frames - 1
31-
if(cap.isOpened()):
33+
frameIdx = frames - 1
34+
if(cap.isOpened()):
3235
# printing the progress
3336
print("Progress:\n")
34-
while(frameIdx!=0): # iterating from last frame to first
35-
cap.set(cv2.CAP_PROP_POS_FRAMES, frameIdx) # pointing to last frame
36-
ret, frame = cap.read()
37+
while(frameIdx!=0): # iterating from last frame to first
38+
cap.set(cv2.CAP_PROP_POS_FRAMES, frameIdx) # pointing to last frame
39+
ret, frame = cap.read()
3740
frame = cv2.resize(frame, size)
3841
frameIdx = frameIdx - 1
39-
if(frameIdx%100 == 0): # progress updated every 100 frames
42+
if(frameIdx%100 == 0): # progress updated every 100 frames
4043
print(frameIdx)
4144
out.write(frame)
42-
45+
4346
out.release()
4447
cap.release()
4548
cv2.destroyAllWindows()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /