Skip to content

Commit 050038b

Browse files
committed
slowmo and timelapse code by python3
1 parent ce979ae commit 050038b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

video-operations/slow-motion.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#author : Avee Chakraborty
2+
#Department of software engineering, Diu
3+
#Bangladesh
4+
5+
import cv2
6+
7+
capture = cv2.VideoCapture(0)
8+
fourcc = cv2.VideoWriter_fourcc(*'XVID')
9+
output = cv2.VideoWriter('slowmotion.mp4',fourcc,5,(640,480))
10+
11+
while True:
12+
ret, frame = capture.read()
13+
output.write(frame)
14+
cv2.imshow('frame',frame)
15+
if cv2.waitKey(1) & 0xFF == ord('x'):
16+
break
17+
18+
capture.release()
19+
output.release()
20+
cv2.destroyAllWindows()

video-operations/timelapse.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#author : Avee Chakraborty
2+
#Department of software engineering, Diu
3+
#Bangladesh
4+
5+
6+
import cv2
7+
8+
capture = cv2.VideoCapture(0)
9+
fourcc = cv2.VideoWriter_fourcc(*'XVID')
10+
output = cv2.VideoWriter('timelapse.mp4',fourcc,30,(640,480))
11+
12+
while True:
13+
ret, frame = capture.read()
14+
output.write(frame)
15+
cv2.imshow('frame',frame)
16+
if cv2.waitKey(1) & 0xFF == ord('x'):
17+
break
18+
19+
capture.release()
20+
output.release()
21+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)