I have been trying with openCV but it doesn't seem to help much. Also, I have tried ffmpeg and avconv. But I think am making a mistake somewhere. Could someone please guide me?
Asked
Active
Viewed 2,832 times
2 Answers
6
Try with MoviePy:
import moviepy.editor as mpy
clip = mpy.ImageSequenceClip("some/folder/with/images", fps=10)
audio = (mpy.AudioFileClip("some_audio_file.mp3") # or any other format
.set_duration(clip.duration))
clip.audio = audio
clip.write_videofile("my_video.mp4") # or any other format

Zulko
- 3,540
- 1
- 22
- 18
-
+1 for this quick workaround. However, setting audio throws this error: `OSError: Error in file, Accessing time t=6.42-6.47 seconds, with clip duration=6 seconds` – Shameer Kashif May 08 '21 at 13:47
0
OpenCV is useful for image processing and computational imaging. What you need is just ffmpeg.
- For creating video from still images read this: Create a video slideshow from images
- For adding audio to video: ffmpeg, how to add new audio (not mixing) in video