diff --git a/video-operations/slow-motion.py b/video-operations/slow-motion.py new file mode 100644 index 00000000000..12f92b511c3 --- /dev/null +++ b/video-operations/slow-motion.py @@ -0,0 +1,20 @@ +#author : Avee Chakraborty +#Department of software engineering, Diu +#Bangladesh + +import cv2 + +capture = cv2.VideoCapture(0) +fourcc = cv2.VideoWriter_fourcc(*'XVID') +output = cv2.VideoWriter('slowmotion.mp4',fourcc,5,(640,480)) + +while True: + ret, frame = capture.read() + output.write(frame) + cv2.imshow('frame',frame) + if cv2.waitKey(1) & 0xFF == ord('x'): + break + +capture.release() +output.release() +cv2.destroyAllWindows() diff --git a/video-operations/timelapse.py b/video-operations/timelapse.py new file mode 100644 index 00000000000..ff2c04c98ec --- /dev/null +++ b/video-operations/timelapse.py @@ -0,0 +1,21 @@ +#author : Avee Chakraborty +#Department of software engineering, Diu +#Bangladesh + + +import cv2 + +capture = cv2.VideoCapture(0) +fourcc = cv2.VideoWriter_fourcc(*'XVID') +output = cv2.VideoWriter('timelapse.mp4',fourcc,30,(640,480)) + +while True: + ret, frame = capture.read() + output.write(frame) + cv2.imshow('frame',frame) + if cv2.waitKey(1) & 0xFF == ord('x'): + break + +capture.release() +output.release() +cv2.destroyAllWindows()