Skip to content

Instantly share code, notes, and snippets.

@yashrathi-git
Created March 24, 2023 08:51
Show Gist options
  • Save yashrathi-git/fbc75cbddf68dca0357a1b16d04be017 to your computer and use it in GitHub Desktop.
Save yashrathi-git/fbc75cbddf68dca0357a1b16d04be017 to your computer and use it in GitHub Desktop.

Python code using turtle to draw a star:

import turtle

star = turtle.Turtle()

for i in range(5):
    star.forward(100)
    star.right(144)

turtle.done()

Python code for skipping 75% of frames

from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.video.io.ImageSequenceClip import ImageSequenceClip



clip = VideoFileClip('vid.mp4')

# Might take lot of memory for huge videos though
frames = list(clip.iter_frames())[::4]

new_clip = ImageSequenceClip(frames, fps=clip.fps)
new_clip.write_videofile('skipped_video.mp4')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment