Hi, here is how to play a movie, an mp4 file, for example, with the library moviepy, that needs pygame
After you installed the 2 libraries with
pip install pygame
pip install moviepy
from the cmd (windows button + R and then write cmd and press Return)
Now you can import the libraries and make the clip play
from moviepy.editor import * import pygame clip = VideoFileClip('pygame4.mp4') clip.preview() pygame.quit()
As you can see, you just have to pass the name of the mp4 file to load it and you use the preview method to watch it. At the end you use pygame.quit to close the window
Now it could be interesting to resize the window.
Resize the movie screen window
To resize the window, scaling the movie images, you just have to use resize, like this
import moviepy from moviepy.editor import * import pygame clip = VideoFileClip('pygame4.mp4').resize(0.5) clip.preview() pygame.quit()
This way you can see the image that is the half of the original size, but you can also put something like this:
import moviepy from moviepy.editor import * import pygame clip = VideoFileClip('pygame4.mp4').resize((600, 500)) clip.preview() pygame.quit()