FFmpeg 图像幻灯片(多幅图像)无限循环直到音频文件结束

FFmpeg 图像幻灯片(多幅图像)无限循环直到音频文件结束

我想制作一个图片幻灯片(多张图片),无限循环播放,直到音频文件结束,并且音频文件持续播放。有谁能帮我吗......

之前我在下面做了这个:

 String[] commd1fdf2 = {
                    "-loop", "1", "-t", "5", "-i", imagepath1.jpg,
                    "-loop", "1", "-t", "5", "-i", imagepath2.jpg,
                    "-loop", "1", "-t", "5", "-i", imagepath3.jpg,
                    "-loop", "1", "-t", "5", "-i", imagepath4.jpg,
                    "-loop", "1", "-t", "5", "-i", imagepath5.jpg,
                    "-i", audio_file_path.mp3,
                    "-preset", "ultrafast",
                    "-filter_complex",
                    "[1]format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+4/TB[f0];" +
                            "[2]format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+8/TB[f1];" +
                            "[3]format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+12/TB[f2];" +
                            "[4]format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+16/TB[f3];" +
                            "[0][f0]overlay[bg1];" +
                            "[bg1][f1]overlay[bg2];" +
                            "[bg2][f2]overlay[bg3];" +
                            "[bg3][f3]overlay,format=yuv420p[v]",
                    "-map", "[v]", "-map", "5:a", "-shortest", "-acodec", "copy", filePath_output.mp4};

但它的输出只有 20 到 21 秒,歌曲的其余部分未编码在视频输出中。所以我想要完整的歌曲,并带有图像重复的图像幻灯片。

相关内容