Comments (6)
Thanks for the feedback ! Have you tried with a newer version ? Like the one currently on Github or PyPI ? I can't garantee anything, but this example works on my computer.
Tell me if it works (and if the newer version works on your computer :) )
from moviepy.
I just installed the version from github, and the code now runs without throwing an error.
But now I don't get a background color at all if I supply any value of col_opacity. If it omit the col_opacity parameter I get a black box, as expected. If I add the col_opacity parameter I get no background color at all, regardless of what value I support. I tried col_opacity= 1, col_opacity= 0, col_opacity= 0.5, and others.
BTW, thanks for this great tool. I've been hand coding ffmpeg command lines, and moviepy is so much better!
from moviepy.
Here's some code that shows the background disappearing if I use a col_opacity argument:
from moviepy.editor import *
green= ColorClip((200,200), (0,255,0)).set_duration(5)
txt= TextClip('Hello, world!', color= 'white')
txt= txt.on_color(
size= (100,100),
#col_opacity= 0.5, ## the black bg goes away if I uncomment this
).set_duration(5)
video= CompositeVideoClip([green, txt])
video.to_videofile(
'demos.mp4',
fps= 25,
codec= 'mpeg4',
)
And here's a couple of images showing a screen capture of the resulting video with and without col_opacity parameter.
Without col_opacity, I get a nice black background behind the text:
With col_opacity, it's gone:
from moviepy.
Thanks for the bug report, I just fixed it (I think).
from moviepy.
Confirmed, it works for me now. Thanks!
from moviepy.
Not a bug, but I've a related question : How to make "black" background disappear in the case above? How can I get full white text and remaining area should have full opacity green background? Not able to get this effect, maybe some specific type of blending is needed?
from moviepy.
Related Issues (20)
- No sound HOT 2
- how to keep the aspect ratio for my vertical video? HOT 5
- I cut 1800 seconds of audio, but the result is 1846 seconds. Why is this happening? How can I solve this problem?
- Resizable rounded rectangle
- Getting `AttributeError: 'NoneType' object has no attribute 'get_frame'` when trying to save a `CompositeVideoClip`
- Error When Generating a Long video and not getting the error when generating a shorter video HOT 1
- AttributeError: 'NoneType' object has no attribute 'get_frame' when calling write_videofile HOT 1
- Vertical MOV video to MP4 HOT 3
- yielding write_videofile progress HOT 5
- Output video without sound
- Inconsistent video duration before and after write_videofile HOT 1
- Audio glitching when concatenating with moviepy
- Error Using MoviePy in Django Project on Linux (Python 3.12, MoviePy 1.0.3)
- Adapt to setuptools v72 HOT 4
- How to obtain an AudioArrayClip or AudioFileClip object from a MP3 BytesIO object?
- CompositeAudioClip not compute duration
- Documentation in a PDF or any other downloadable format please?
- Incorrect Rendering of Bengali Ligatures in Subtitles Using MoviePy HOT 2
- How to set opacity in text_clip using Lambda HOT 1
- Moviepy unable to concatenate a long list of videos but is able to concatenate a short list of videos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moviepy.