Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy as np
- import random
- def babushkin(output_file="future_movie.avi", width=320, height=240, frames=120):
- a = random.randint(10**5, 10**9)
- b = random.randint(1, 9999)
- remainder = a % b
- fourcc = cv2.VideoWriter_fourcc(*'XVID')
- video = cv2.VideoWriter(output_file, fourcc, 24.0, (width, height))
- random.seed(remainder)
- for i in range(frames):
- frame = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
- cv2.putText(frame, f"Frame {i+1}", (10, height - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255), 1)
- video.write(frame)
- video.release()
- if __name__ == "__main__":
- babushkin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement