I'm trying to visually manipulate a video by taking the following steps:
- Breaking the video into frames (using CV2)
- Editing each frame (using PIL)
- Compiling the frames back into a new video (using moviepy)
I'd like to use the audio of the original video in the newly created video. To do that I first extract the audio from the original video like this:
video = VideoFileClip("original_video.mp4")
video.audio.write_audiofile("audio.mp3")
For some reason, the last few seconds of the newly created audio file ("audio.mp3") repeats themselves 2-3 times at the end of the recording. I'm not sure why it happens or how to avoid it.
I'd appreciate your help.
Thanks.