I am currently able to convert a series of images to video, but I do also need to add transitions / animation in between them.
String[] ffmpegCommand = {"/data/data/mypackage/app_bin/ffmpeg", "-y",
"-qscale", "1", "-r", "" + framerate, "-i", "/data/data/mypackage/app_ipImg/image%3d.jpg",
"-t", "" + (((total_images) * delay_of_each_frame_in_seconds) + 4), //"-s",heightwidth,
"-vcodec", "libx264", "-s", "640x480",
Environment.getExternalStorageDirectory() + "/photo_directory/myVideo.mp4"};
The above command is working for me to create video from image series
But
Now, I do want to add fade or other transition / animation to be displayed in final video before each of the frames.
I googled a lot, but didn't find any solution to this trouble, yet.
Please suggest me the way.
Thanks in advance.
Two approaches
1) Create a video for each image/slide and add the fade-in fade-out to each one, then add the videos together. This link explains how to create a fade effect for images.
2) Use the a mixture of filters along with the -loop option as explained in this link.
I would suggest you to find more information about Frame Blending or Motion interpolation.
This is for example used in timelapse videos to smooth the render.
To blend frames, use ffmpeg with the tblend filter.
For example the following command can help :
ffmpeg -i {input} -vf "tblend=average,framestep=2,setpts=0.50*PTS" -r {srcfps} -{encoding parameters} {output}
. Replace {input}
by your input file, {output}
by the name of the output file, {srcfps}
by your source frames per second, and -{encoding parameters}
the parameters you tell ffmpeg to output.
You could also add minterpolate
filter to the filter stack to add some motion blur.
To generate new frames based on motion, the Butterflow project can help : https://github.com/dthpham/butterflow
Features
Makes motion interpolated videos (increase a video's frame rate by rendering intermediate frames based on motion, uses a combination of pixel-warping and blending).
Makes smooth motion videos (simple blending between frames).
Leverages interpolated frames to make fluid slow motion videos.