I am using opencv and successfully created a video file using number of images. Now i want to add some effects to the images, Transition effects as we mostly have in slide shows e.g. FadeIn or FadeOut. And a background audio also. Is it possible to do with the opencv??
Also i want to show one image at one second delay? the below code is showing four images in one second. I am new to opencv so please help with that.
import cv
im1 = cv.LoadImage("Sunset.jpg")
im2 = cv.LoadImage("Blue hills.jpg")
im3 = cv.LoadImage("Water lilies.jpg")
im4 = cv.LoadImage("Winter.jpg")
fps = 4.0
frame_size = cv.GetSize(im1)
writer = cv.CreateVideoWriter("out.avi", -1, fps, frame_size, True)
for i in range(4):
print cv.WriteFrame(writer, eval('im' + str(i+1)))
del writer
Yes and No.
OpenCV is not meant for editing videos. I mean, you can do that, but it's not the focus of the library. However, OpenCV offers image processing techniques that might help you achieve those cool effects you are looking for, but it's up to you to write them.
For pausing between frames, check the sleep function (from python's Time library).
OpenCV is aimed at computer vision (audio/video processing), not audio. You might want to take a look at ffmpeg for that. I posted an answer some time ago that shared C code to play audio/video on a SDL window, using a combination of OpenCV to deal with images and FFmpeg to load audio stream from a video file.