moviepy

Mixing audio files in MoviePy

▼魔方 西西 提交于 2019-12-11 05:13:40
问题 I've been writing a script using MoviePy. So far I've been able to import videos, clip them, add text, replace the audio and write a new file. It's been a great learning experience. My question is this: The movie that I'm editing has audio attached. I'd like to be able to import an audio track and add it to the movie without replacing the original audio. In other words, I'd like to mix the new audio file with the audio that's attached to the video so both can be heard. Does anyone know how to

Python Moviepy installation problems (windows 7x64)

≡放荡痞女 提交于 2019-12-10 23:49:25
问题 Good day, i have a problem with instalation moviepy for python 64 bit and windows 64 bit. Library was succesfully installed, file ffmpeg downloaded. Every time i run it or using video = VideoFileClip("path") OSError: [WinError 193] %1 is not valid win32 application. How can this be solved? Imagemagick and PIL are already installed. 回答1: # moviepy.__version__=='0.2.3.5' solved following next steps : 1) manual download following instructions here adaptivesamples.com/how-to-install-ffmpeg-on

ffmpeg installation on macOS for MoviePy fails with SSL error

柔情痞子 提交于 2019-12-09 10:16:49
问题 I'm trying to write a Python program that uses MoviePy on Mac OS 10.11.16 to convert an MP4 file to GIF. I use: import moviepy.editor as mp and I get an error saying I need to call imageio.plugins.ffmpeg.download() so I can download ffmpeg. I use: import imageio imageio.plugins.ffmpeg.download() which gives me the following error: Imageio: 'ffmpeg.osx' was not found on your computer; downloading it now. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate

How to concatenate videos in moviepy?

假如想象 提交于 2019-12-09 08:33:38
问题 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 my_func(messeges): clips = {} count = 0 for messege in messeges: count += 1 clips[count] = TextClip(messege, fontsize=270, color='green') clips[count] = clips[count].set_pos('center').set_duration(1) clips[count].write_videofile(str(count) + '.avi'

Unable to create a textclip in moviepy (imagemagick succesfully installed?) - got Utf8 Error

扶醉桌前 提交于 2019-12-08 08:57:42
问题 i got this error when using moviepy with "TextClip": 'utf8' codec can't decode byte 0x84 in position 5: invalid start byte Imagemagick and wand are (proper?) installed. Does anybody knows a possible solution? 回答1: Apparently moviePy expects non unicode strings (file moviepy/video/VideoClip.py , line 1095). the workaround for this would be to decode your unicode strings before passing them to the TextClip: if isinstance(mytext, unicode): mytext = mytext.encode('latin1') EDIT MoviePy expects

Convert image sequence to video using Moviepy

梦想的初衷 提交于 2019-12-07 05:40:51
问题 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, method='compose') video.write_videofile('test.mp4') The error is: Full code import os from moviepy.editor import * clips = [] base_dir = os.path.realpath(".") print(base_dir) for filename in os.listdir('.'): if filename.endswith(".png"): clips.append(ImageClip(filename)) video =

Convert image sequence to video using Moviepy

扶醉桌前 提交于 2019-12-05 09:16:57
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, method='compose') video.write_videofile('test.mp4') The error is: Full code import os from moviepy.editor import * clips = [] base_dir = os.path.realpath(".") print(base_dir) for filename in os.listdir('.'): if filename.endswith(".png"): clips.append(ImageClip(filename)) video = concatenate(clips, method='compose') video.write_videofile('test.mp4') I found another way to do it: from

Difficulty animating a matplotlib graph with moviepy

天大地大妈咪最大 提交于 2019-12-04 12:07:27
问题 I have to make an animation of a large number (~90,000) figures. For context, it's a plot of a map for every day from 1700 - 1950, with events of interest marked on relevent days. I can do this using matplotlib.animation.FuncAnimation , and I have code that does this successfully for a small test period. However, with the complete set of figures this is taking an impractical amount of time to render and will result in a very large movie file. I have read that apparently moviepy offers both

Difficulty animating a matplotlib graph with moviepy

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 07:49:16
I have to make an animation of a large number (~90,000) figures. For context, it's a plot of a map for every day from 1700 - 1950, with events of interest marked on relevent days. I can do this using matplotlib.animation.FuncAnimation , and I have code that does this successfully for a small test period. However, with the complete set of figures this is taking an impractical amount of time to render and will result in a very large movie file. I have read that apparently moviepy offers both speed and file size advantages. However, I am having trouble getting this to work – I believe my problem

Cutting out a portion of video - python

余生长醉 提交于 2019-12-03 06:23:05
问题 I have videos of length approximately 25 min each and I wish to cut a few seconds from the start using python. Searching about it, I stumbled upon the moviepy package for python. The problem is, it takes up a lot of time even for a single video. Following is the code snippet I use to cut 7 seconds from the start of a single video. The write process consumes a lot of time. Is there a better way to cut the videos using python? from moviepy.editor import * clip = VideoFileClip("video1.mp4")