6

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.

Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
  • Did you find any solution to this ? I am also able to create video from a set of pictures but cant seem to apply any effects to it. Please let me know if you've figured out a way to do this. – San Dec 21 '15 at 06:28
  • @San Nope. I did not. – Narendra Singh Dec 21 '15 at 12:37
  • 1
    See [Create video from images with fade in/out or crossfade effect in ffmpeg](https://superuser.com/a/834035). – llogan Dec 04 '19 at 19:00

2 Answers2

2

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.

Guillaume
  • 581
  • 4
  • 11
0

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.

Community
  • 1
  • 1
Maxito
  • 619
  • 11
  • 26
  • Talking about your first approach ---- is there any command to generate video for each image by providing the image sequence only....or do I need to do it manually for each image one by one? – Narendra Singh Apr 25 '15 at 07:39
  • Also, I guess, the first approach will not help in making cross-fade transitions, wt do you suggest? – Narendra Singh Apr 25 '15 at 09:44
  • For the first one, I think you do need to do it manually. For the cross-fade (if I undertand correctly what it means) you may have to play with the images Alpha (transparency) and overlay them http://ffmpeg.org/ffmpeg-filters.html#overlay-1 – Maxito Apr 28 '15 at 17:13