question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompositeVideoClip has no audio

See original GitHub issue

Expected Behavior

The video file generated at end of the process with orignal audio.

Actual Behavior

The video file generated at end of the process has no audio.

Steps to Reproduce the Problem

def add_watermark_logo(video_filename):
    """
    Adds the logo as watermark to the video, given its filename.
    :param video_url: String containing the video filename.
    :return:
    """

    video = mp.VideoFileClip(video_filename)
    logo = (mp.ImageClip("logo.png")
              .set_duration(video.duration)
              .resize(height=50)
              .margin(right=10, bottom=10, opacity=0)
              .set_pos(("right", "bottom")))

    final = mp.CompositeVideoClip([video, logo])
    final.write_videofile("{}".format(video_filename), progress_bar=False)

Specifications

  • Python Version: 3.6
  • Moviepy Version: 0.2.3.5
  • Platform Name: Docker on MacOs 10.13.6
  • Platform Version: 18.06.1-ce-mac73 (26764)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
haigendongcommented, Jan 10, 2019

i remove the ‘-an’ and it did work

7reactions
russellyicommented, Feb 28, 2019

I found the solution in other issue #820

Read more comments on GitHub >

github_iconTop Results From Across the Web

No audio when adding Mp3 to VideoFileClip MoviePy
I solved this through a workaround using ffmpeg directly. It uses the temp audio file and video file from moviepy to create a...
Read more >
moviepy.video.compositing.CompositeVideoClip
CompositeVideoClip. import numpy as np from moviepy.audio. ... If it has no transparency, the final clip will have no mask. The clip with...
Read more >
moviepy.video.compositing.CompositeVideoClip
Source code for moviepy.video.compositing.CompositeVideoClip ... Built with Sphinx using a theme provided by Read the Docs. Read the Docs v: latest.
Read more >
How to use the moviepy.editor.CompositeVideoClip function ...
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
MoviePy - Creating Composite Video Clips - GeeksforGeeks
In order to do this we will use CompositeVideoClip method ... MoviePy - Writing audio in __temp__TEMP_MPY_wvf_snd.mp3 MoviePy - Done.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found