Giter VIP home page Giter VIP logo

Comments (6)

Zulko avatar Zulko commented on August 28, 2024

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.

chunder avatar chunder commented on August 28, 2024

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.

chunder avatar chunder commented on August 28, 2024

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:

without_col_opacity

With col_opacity, it's gone:

with_col_opacity

from moviepy.

Zulko avatar Zulko commented on August 28, 2024

Thanks for the bug report, I just fixed it (I think).

from moviepy.

chunder avatar chunder commented on August 28, 2024

Confirmed, it works for me now. Thanks!

from moviepy.

jitendra-koodo avatar jitendra-koodo commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.