简体   繁体   中英

FFMpeg: Images into video

I'm trying to turn a series of images into a video.

My idea is to have a very low frame rate so it's essentially a slideshow video for the frames.

I currently have my images in the following format...

*1-1.jpg *1-2.jpg *1-3.jpg *1-4-1.jpg *1-4-2.jpg *1-4-3.jpg *2-1.jpg *2-2.jpg

etc...

So, here's the command I'm trying to run...

c:\wamp\www\videos\images>c:\ffmpeg\bin\ffmpeg.exe -f image2 -r 1 -i %d-%d.jpg movie.mpg

This command won't do exactly what I want it to, but it'll let me at least get a test video done.

Ideally, I'd like to be able to do multiple run throughs via PHP (which will be easy, I think once I get a working command)

So, on the first run it would process all the images that start with 1, then on the second the ones that start with 2, and so on.

However, no matter how I format the image section of the command, I get the following error...

%d-%d.jpg: No such file or directory

If I just do %d.jpg, I get the same error, but with %d.jpg instead of %d-%d.jpg

Do you have any ideas how I can get this to work? If I can get it to work with one set, I can use variables and loops in PHP to get it to process the other videos I'll be making.

Thanks in advance for any thoughts.

Make sure you quote your input. Per the manual...use -vframes 1 instead of -r 1.

You need to change your image naming scheme. ffmpeg is expecting something like image1.jpg, image2.jpg, image3.jpg, etc. That would be read in with -i image%d.jpg . It's not clear to me what order your images should play in, and it certainly isn't clear to ffmpeg.

Rename your images, or use symlinks to get the same effect, so that you can input them to ffmpeg with only one %d term.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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