Questions tagged [moviepy]

MoviePy is a Python module for video editing, which can be used for basic operations (like cuts, concatenations, title insertions), video compositing (a.k.a. non-linear editing), video processing, or to create advanced effects.

References

763 questions
69
votes
4 answers

How can I efficiently cut out part of a video?

I want to remove the first few seconds from a video that's about 25 minutes long. I found the moviepy package, and tried writing this code: from moviepy.editor import * clip = VideoFileClip("video1.mp4").cutout(0,…
Pranav Arora
  • 993
  • 2
  • 10
  • 16
23
votes
3 answers

How To Resize a Video Clip in Python

I want to resize a video clip in python 2.7. For example we give "movie.mp4" with 1080p quality The result should be "movie.mp4" with 360p quality I Think that there should be solutions with Moviepy. If you know a solution with it. I would be…
Seyed Ali Akhavani
  • 633
  • 1
  • 6
  • 18
17
votes
1 answer

How to concatenate videos in moviepy?

I am trying to use moviepy to generate video with texts. First, I want to show one messages and then another one. In my case I want to show "Dog" for one second and than "Cat Cat". For that I use the following code: from moviepy.editor import * def…
Roman
  • 124,451
  • 167
  • 349
  • 456
13
votes
15 answers

Getting "TypeError: must be real number, not NoneType" whenever trying to run write_videofile to a clip in moviepy

Example code: from moviepy.editor import * clip = VideoFileClip('video.mp4') clip.write_videofile('video2.mp4', fps=30) After showing the following messages, showing that the video is being built and written, Moviepy - Building video…
Sato
  • 1,013
  • 1
  • 12
  • 27
13
votes
5 answers

Can't import moviepy.editor

i was trying to create an application with python using the moviepy library. I installed it using: pip install moviepy I found this from a MoviePy crash-course: # Import everything needed to edit video clips from moviepy.editor import * After…
Ingmar05
  • 501
  • 2
  • 8
  • 25
12
votes
3 answers

Video editing with python : adding a background music to a video with sound

I would like to add a background music to a video file (.mp4) in python. I have looked the web and did some tricks with moviepy for python, but I did not found a single way to add background music to a video file that already contains music. Any…
Eli O.
  • 1,543
  • 3
  • 18
  • 27
12
votes
2 answers

Convert image sequence to video using Moviepy

I tried to convert PNG images to video by list images in directory clips[] for filename in os.listdir('.'): if filename.endswith(".png"): clips.append(ImageClip(filename)) Then convert it video = concatenate(clips,…
Adil Blanco
  • 616
  • 2
  • 6
  • 23
11
votes
6 answers

raise NeedDownloadError('Need ffmpeg exe. ' NeedDownloadError: Need ffmpeg exe)

I'm trying to execute a call to an unofficial Instagram API python library, after several errors for dependencies needed I fixed, I'm stuck at this one. File…
Pablo
  • 4,821
  • 12
  • 52
  • 82
10
votes
4 answers

MoviePY can't detect ImageMagick binary on Windows

I just got myself a new laptop, wanted to setup MoviePY on that new Windows 64x (Python3.7.0) machine. I triple checked everything but when it comes to text part of my code, it throws that error at me; OSError: MoviePy Error: creation of None failed…
cem akbulut
  • 185
  • 1
  • 3
  • 12
10
votes
2 answers

How to merge two videos?

I use https://github.com/Zulko/moviepy library for merge two videos with python. It merged successfully but sound of videos is not exists in merged.mp4. The python code : clip1 = VideoFileClip("2.mp4",audio=True) clip2 =…
Alexander
  • 1,720
  • 4
  • 22
  • 40
10
votes
3 answers

Adding subtitles to a movie using moviepy

I'm tried to follow this example how to add subtitles to a movie clip: from moviepy.video.tools.subtitles import SubtitlesClip from moviepy.video.io.VideoFileClip import VideoFileClip subs = [((0, 3), 'sub1'), ((3, 7), 'sub2'), ((9,…
Noam Peled
  • 4,484
  • 5
  • 43
  • 48
9
votes
1 answer

Moviepy - Crop video with frame (region of interest) moving from left to right with time

I'm working on creating GIF from video clips automatically on the server using MoviePy. The library helped in various transformations and trimming of video to create GIFs. In my current project, I have a video clip with lots of moving objects…
Anna23
  • 680
  • 2
  • 8
  • 16
9
votes
7 answers

No audio when adding Mp3 to VideoFileClip MoviePy

I'm trying to add an mp3 audio file to a video clip that I'm creating out of images with MoviePy. When the script runs it creates the mp4 file and plays successfully, however there's no audio. I'm not really sure why and can't seem to find a ton of…
damaniel
  • 269
  • 2
  • 3
  • 10
8
votes
2 answers

Crop a video in python

I am wondering to create a function which can crop a video in a certain frame and save it on my disk (OpenCV,moviepy,or something like that) I am specifying my function with parameters as dimension of frame along with source and target name…
rish_hyun
  • 451
  • 1
  • 7
  • 13
8
votes
4 answers

Getting "OSError: [WinError 6] The handle is invalid" in VideoFileClip function

I am creating a program using python by importing moviepy library, but getting following error: from moviepy.editor import VideoFileClip white_output = 'videos/testVideo.mp4' clip1 = VideoFileClip("videos/testVideo.mp4") OSError …
Deepak Tekchandani
  • 488
  • 2
  • 5
  • 15
1
2 3
50 51