In this article we will see how we can save a single frame at given time of the video file clip in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIF’s. Video is formed by the frames, combination of frames creates a video each frame is an individual image. We can store the specific frame at any time.
In order to do this we will use
save_framemethod with the VideoFileClip object
Syntax : clip.save_frame(“frame.png”, t)
Argument : It takes image name as argument and time as optional argument
Return : It returns None
Below is the implementation
Moviepy - Building video __temp__.mp4. Moviepy - Writing video __temp__.mp4 Moviepy - Done ! Moviepy - video ready __temp__.mp4
Below is the saved image
Moviepy - Building video __temp__.mp4. MoviePy - Writing audio in __temp__TEMP_MPY_wvf_snd.mp3 MoviePy - Done. Moviepy - Writing video __temp__.mp4 Moviepy - Done ! Moviepy - video ready __temp__.mp4
Below is how the saved image will look like
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- MoviePy –Saving Video File Clip
- MoviePy – Changing Display Frame of Video Clip
- MoviePy – Getting color of a Frame of Video Clip where cursor touch
- MoviePy – Showing a Frame of Video Clip
- MoviePy – Displaying a Frame of Video Clip using inbuilt display method
- MoviePy – Getting frame from Video File Clip
- MoviePy – Saving Video File as GIF
- MoviePy – Checking Mask of Video File Clip
- MoviePy - Lading Video File Clip
- MoviePy – Showing Video File Clip
- MoviePy Composite Video - Setting starting time of single clip
- MoviePy – Adding Margin to Video File Clip
- MoviePy – Mirroring Video File Clip for x-axis
- MoviePy – Mirroring Video File Clip for y-axis
- MoviePy – Getting Width of Video File Clip
- MoviePy – Getting Height of Video File Clip
- MoviePy – Getting Original File Name of Video File Clip
- MoviePy – FPS of Video File Clip
- MoviePy Composite Video - Setting Position of Clip
- MoviePy – Applying Resize effect on Video Clip
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.