moviepy

TypeError when using MoviePy

荒凉一梦 提交于 2020-01-07 02:37:34
问题 In trying to learn a little about MoviePy, I copied some sample code (which I modified slightly) that cuts a 10 second section out of a movie file, overlays text on it, and writes it as a different file. The code works perfectly...only for certain files. I have two video files that I wanted to use the code on (just for practice). Both are .mov files, both are on the same drive and both of the paths are correct (I have verified them multiple times). The problem is I'm getting a TypeError on

How can I play a mp4 movie using Moviepy and Pygame

北城以北 提交于 2020-01-02 05:05:14
问题 How do you play an mp4 video in Pygame? I have tried pygame.movie but this does not work... Theres also moviepy, but I am having trouble changing the title of the window that pops up. It says "MoviePy", not sure how to change that. import moviepy from moviepy.editor import * import os os.environ["SDL_VIDEO_CENTERED"] = "1" clip = VideoFileClip('qq.mp4') clip.preview() execfile("qq.py") # Execute my game right after the clip shows How would I change the title from "MoviePy" to my "my game name

Moviepy fullscreen

微笑、不失礼 提交于 2019-12-24 05:55:19
问题 I'm creating a simple pygame, and cannot find out how to make Moviepy preview clip in full screen. Using Moviepy for my opening cinematic. Here is my code: import moviepy import os from moviepy.editor import * import pygame pygame.display.set_caption('Game title') os.environ["SDL_VIDEO_CENTERED"] = "1" clip = VideoFileClip('qq.mp4') clip.preview() execfile("startGame.py") I'm not sure if this is the best practice in pygame to use for an opening full-screen cinematic... 回答1: I changed in

Adding watermark to video

有些话、适合烂在心里 提交于 2019-12-24 03:22:32
问题 I am able to use the moviepy library to add a watermark to a section of video. However when I do this it is taking the watermarked segment, and creating a new file with it. I am trying to figure out if it is possible to simply splice in the edited part back into the original video, as moviepy is EXTREMELY slow writing to the disk, so the smaller the segment the better. I was thinking maybe using shutil? video = mp.VideoFileClip("C:\\Users\\admin\\Desktop\\Test\\demovideo.mp4").subclip(10,20)

Adding watermark to video

喜你入骨 提交于 2019-12-24 03:21:04
问题 I am able to use the moviepy library to add a watermark to a section of video. However when I do this it is taking the watermarked segment, and creating a new file with it. I am trying to figure out if it is possible to simply splice in the edited part back into the original video, as moviepy is EXTREMELY slow writing to the disk, so the smaller the segment the better. I was thinking maybe using shutil? video = mp.VideoFileClip("C:\\Users\\admin\\Desktop\\Test\\demovideo.mp4").subclip(10,20)

issue with movie.py with renaming script

一曲冷凌霜 提交于 2019-12-23 04:35:18
问题 I have a lot of videos stored in different subfolders. All the videos have weird file names like f4vd5sd1b5dsd41s415d . And I have a text file where there are the correct file names of each file. To know which video goes with which title, I added the file duration of the video I want to correspond with the title, so in my text file there is: in line 1: the name of video 1 in line 2: the video length of video 1 in line 3: the name of video 2 in line 4: the video length of video 2 To better

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

荒凉一梦 提交于 2019-12-20 00:09:08
问题 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 Traceback (most recent call last) <ipython-input-40-f49638833528> in <module>() 1 white_output = 'videos/testVideo.mp4' ----> 2 clip1 = VideoFileClip("videos/testVideo.mp4") 3 white_clip = clip1.fl_image(process_image) #NOTE: this function expects color images!! 4 get

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

我的梦境 提交于 2019-12-20 00:08:28
问题 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 Traceback (most recent call last) <ipython-input-40-f49638833528> in <module>() 1 white_output = 'videos/testVideo.mp4' ----> 2 clip1 = VideoFileClip("videos/testVideo.mp4") 3 white_clip = clip1.fl_image(process_image) #NOTE: this function expects color images!! 4 get

Moviepy OSError Exec format error - Missing Shebang?

廉价感情. 提交于 2019-12-13 17:34:31
问题 I am attempting to use MoviePy with Python 3.2.3 on Raspian. I have installed it (for Python 2.7, 3.2 and 3.5... long story) and the line from moviepy.editor import * works fine. When I try clip = VideoFileClip("vid.mov") which is the most basic command, it gives the error Traceback (most recent call last): File "/home/pi/QuickFlicsPics/moviepytest.py", line 8, in <module> clip = VideoFileClip("vid.mov") File "/usr/local/lib/python3.2/distpackages/moviepy/video/io/VideoFileClip.py", line 55,

How to show a frame of a video file (image) with tkinter in python

孤人 提交于 2019-12-12 03:50:07
问题 I am trying to show video frames (not from a stream) with tkinter. The next step are buttons which allow the user to get a frame backward or forward in the video. I have to say that I am quite new in programming with python. So first I read the following articles: Python snippets: Converting video to images http://srand.fr/blog/python%20import%20video.html The Tkinter PhotoImage Class: http://effbot.org/tkinterbook/photoimage.htm The problem is that I can’t use the image converted with