Concatenation with TextClip and VideoFileClip results in unplayable video, MoviePy 1.0.3
See original GitHub issueExpected Behavior
Concatenating a TextClip with a VideoFileClip should put the two clips together and be playable.
Actual Behavior
Concatenating a TextClip with a VideoFileClip renders an unplayable video. When opened in the Movies & TV Windows app, it simply cannot be played. When opened with Windows Media Player it also cannot be played and causes the app to become unresponsive.
Steps to Reproduce the Problem
- Initialize virtual environment and install moviepy=1.0.3
- Download Windows ImageMagick-7.0.10-Q16-HDRI
- Set binary locations for ffmpeg and ImageMagick in config_defaults.py
- Run the following code
from moviepy.editor import *
first_five_seconds = VideoFileClip('./videos/2019-10-18.mp4').subclip(0, 5)
first_five_seconds.write_videofile('./clips/first_five_seconds.mp4')
title = TextClip('Title', fontsize=75, color='green')
title = title.set_position('bottom').set_duration(4)
with_title_screen = CompositeVideoClip([title, first_five_seconds])
with_title_screen.write_videofile('./clips/with_title_screen.mp4')
- The first is playable while the second is unplayable
Specifications
- Python Version:
3.8.3
- Moviepy Version:
1.0.3
- ImageMagick Binary Version:
ImageMagick-7.0.10-Q16-HDRI
- Platform Name: Windows
- Platform Version: Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Mixing clips — MoviePy 1.0.2 documentation
Two simple ways of putting clips together is to concatenate them (to play them one after the other in a single long clip)...
Read more >MoviePy – Concatenating multiple Video Files - GeeksforGeeks
Syntax : concatenate_videoclips(clips) ; Argument : It takes list of video file clips as argument ; Return : It returns VideoFileClip object.
Read more >How to concatenate videos in moviepy? - Stack Overflow
import moviepy.editor as mp messages = ["Dog", "Cat", "Duck", "Wolf"] clips = [ mp.TextClip(txt, fontsize=170, color='green', ...
Read more >movie-py/Lobby - Gitter
I know moviepy.editor.VideoFileClip gets just the video but how can I get the audio and video? ... How can I add some fancy...
Read more >Editing Video with Python + MoviePy - Section.io
In this tutorial, we will use MoviePy, a Python library, to edit and add effects to a given video clip. This tutorial uses...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
have same problem with TextClip and VideoFileClip with same specifications, but in my case there’s glitch in the end of the video.
Interestingly, removing
with_position
andfont_size
creates a working 36x12 video (using Moviepy version 2.0.0.dev2 at f5944d4):What I think is happening is the section of
sub_clip
that overlaps withtitle
is being shown. I experimented a bit withTextClips
and found that setting the position to"bottom"
often places them off screen (you usually want to use thealign
property for this sort of thing anyway). So perhaps in the original script the lack of overlap betweenfirst_five_seconds
andtitle
causes the compositing to break. Although, it should be noted that changing the order oftitle
andfirst_five_seconds
inCompositeVideoClip([...])
creates a functional video, so its more than just a lack of overlapping (if that’s even the cause).