ffmpeg - make a slideshow images+music video with

2019-06-13 19:51发布

问题:

I can make a slideshow video like that but It's just a simple image-to-image slideshow which has no effect. I don't know how to add some transition effects into the video. For example: Fade in-out, 3D rotation, flip in-out, zoom in-out, bounce,...

回答1:

Use below command it perfectly work

    public String getCommand_zoominout() {
    StringBuilder stringBuilder = new StringBuilder();
    // ffmpeg -loop 1 -i image_1.jpg -vf "zoompan=z='if(lte(zoom,1.0),
    // 1.5,max(1.001,zoom-0.0015))':d=125" -c:v libx264 -t 5 -s "800x450"
    // zoomout.mp4
    stringBuilder.append("-loop 1 -i ");
    stringBuilder.append(folder.getAbsolutePath());
    stringBuilder.append("/IMG%d.jpg");
    stringBuilder.append(" -i " + targetsongsfolder.getAbsolutePath());
    stringBuilder.append(" -strict -2 ");

    stringBuilder.append(" -vf ");
    stringBuilder
            .append("zoompan=z='if(lte(zoom,1.0),1.5,max(1.001,zoom-0.0015))':d=125");
    stringBuilder.append(" -c:v libx264 -t 15 -s ");
    stringBuilder.append("800x400 ");
    stringBuilder.append(outputimage.getAbsolutePath());

    return stringBuilder.toString();
}