moviepy
moviepy copied to clipboard
concatenate_videoclips introduces audio loops
I create two mp4 files using moviepy. They have audio tracks that are shorter than the video itself. If I write the clips to files they look and sound all good. Now I want to concatenate the two videos.
import moviepy.editor import as mpy
clip1 = mpy.VideoFileClip("path/to/clip1")
clip2 = mpy.VideoFileClip("path/to/clip2")
final_clip = mpy.concatenate_videoclips([clip1, clip2])
final_clip.write_videofile("path/to/target", fps=self.config.fps)
Expected Behavior
Both clips are combined into one clip, one clip after the other without changing the clip itself. Sound should end when it's over, even when video is not over yet. Since the audio is shorter than the video for both clips the sequence should look like: Video With Audio (clip1) - Only Video (clip1) - Video With Audio (clip2) - Only Video (clip2)
Actual Behavior
The parts of the clips where the audio is over in the original clip are filled with looping of the last second or so of the audio. So the sequence actually looks like: Video With Audio (clip1) - Video with last sec of audio looping (clip1) - Video With Audio (clip2) - Video with last sec of audio looping (clip2)
The audio should be over at the black vertical line, but instead it is looping.
Specifications
- Python Version: 3.8.5
- Moviepy Version: 1.0.3
- Platform Name: Ubuntu
- Platform Version: 18.04.5 LTS
I got the same issue.
Hi ! I have the same issue, did you succeed solving the problem ?
Thanks
Same issue! +1
same issue +1
The audio and the video track have the same duration. However, when using the concatenate_videoclips
and write_videofile
functions, an unusual sound appears after the video track ends. Additionally, an extra frame is added at the beginning of the initial video track, but once this frame passes, the concatenated clip operates normally.