-1

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?

  • How can anyone provide help when you did not include any of your code and any of the actual errors you may be encountering? – llogan May 03 '15 at 01:36

2 Answers2

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.

  1. For creating video from still images read this: Create a video slideshow from images
  2. For adding audio to video: ffmpeg, how to add new audio (not mixing) in video
Community
  • 1
  • 1
bman
  • 5,016
  • 4
  • 36
  • 69