简体   繁体   English

如何使用ffmpeg从图像创建幻灯片?

[英]How to create slideshow from images with ffmpeg?

I want to create a slideshow from images, where each image would be displayed for some period of time (several seconds). 我想从图像创建幻灯片,其中每个图像将显示一段时间(几秒钟)。

How do I do that? 我怎么做?

Currently I was trying to encode short clips with ffmpeg and then stitch those together with mencoder : 目前,我正在尝试使用ffmpeg编码短片,然后使用mencoder将它们拼接在一起:

        foreach (var item in filePattern)
        {
            var otpt = item.Key + ".mpg";
            Process.Start("ffmpeg",
                string.Format("-y -r 25 -f image2 -vframes 75 -i {0} {1}", item.Value, otpt)//-loop 1
                ).WaitForExit();
        }

ffmpeg -y -r 25 -f image2 -vframes 75 -i input-pattern output does create a file with 1 frame in it, while ffmpeg -y -loop 1 -r 25 -f image2 -vframes 75 -i input-pattern output on windows never finishes (needs ctrl+c to stop); ffmpeg -y -r 25 -f image2 -vframes 75 -i input-pattern output的确会创建一个包含1帧的文件,而ffmpeg -y -loop 1 -r 25 -f image2 -vframes 75 -i input-pattern output ffmpeg -y -r 25 -f image2 -vframes 75 -i input-pattern output的确会创建一个文件在Windows上永远无法完成(需要ctrl + c停止); the second command worked on linux for me. 第二个命令对我来说适用于Linux。

I need to make this work primary on Windows. 我需要将此工作作为Windows的主要工作。 Which params should I use? 我应该使用哪些参数?

just add -t 3: 只需添加-t 3:

-y -r 25 -f image2 -vframes 75 -i {0} -t 3 {1} -y -r 25 -f image2 -vframes 75 -i {0} -t 3 {1}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM