1

I am trying to concatenate two clips using MoviePy [ Windows 10 , Python 3.7.4 ] , but there is no audio in the output video. I can see the temporary audio file while the videos are being concatenated.

from moviepy.editor import VideoFileClip, concatenate_videoclips

clip1 = VideoFileClip("C1.mp4")
clip2 = VideoFileClip("C2.mp4")
final_clip = concatenate_videoclips([clip1,clip2])
final_clip.write_videofile("my_concatenation.mp4")

Terminal gives this ouput,

Moviepy - Building video my_concatenation.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video my_concatenation.mp4

Moviepy - Done !
Moviepy - video ready my_concatenation.mp4

I have also tried this answer but it doesn't solve the issue. Any ideas why this might be happening?

prog_SAHIL
  • 63
  • 10

2 Answers2

2

Update MoviePy to v1.0.2 or greater, or apply the changes from https://github.com/Zulko/moviepy/pull/968 to your installation.

Tom Burrows
  • 2,225
  • 2
  • 29
  • 46
0

The issue is caused by a ffmpeg parameter , just go to moviepy -> video -> io -> ffmpeg_wrtier.py. Then search for ['-i', '-', '-an']. Then change the order into ['-an','-i','-']. Now the audio will work in any player. The first order binds the -an flag to the next stream, which is the audio file (which is subsequently ignored).