Thank you all for leading me to the solution. See below for my solved post.
I've spent over an hour online trying to get this to work... And it doesn't.
I've googled it and followed the directions. Nope.
Windows computer.
I have 24 images... Named e01.png through e24.png
I have an MP3 file called audio.mp3
I want to make an MP4 file slideshow of these images. I've followed the instructions online and it doesn't work.
Directions are confusing on how to understand the duration per image, as well...
Need help.
I have also tried:Code:ffmpeg -r 1/5 -i e%02d.png -i audio.mp3 -c:a copy -c:v libx264 -r 30 output.mp4
In the past, I've done a single image file and this works:Code:ffmpeg -y -loop 1 -r 0.2 -i e%02d.png -i audio.mp3 -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4
^^ that works fine.Code:ffmpeg -loop 1 -i image.png -i audio.mp3 -c:a copy -c:v libx264 -tune stillimage -strict experimental -shortest output.mp4
So, need help on how to understand how to get a slideshow of 'n' number of images, and 5 seconds each, loops if finishes before audio finishes.
Online didn't help. I tried for an hour following 3 different sites.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 22 of 22
Thread
-
Last edited by Tolwyn; 15th Aug 2017 at 16:46. Reason: Solved
-
The problem online is that not one source indicates the OS they are using. I'm guessing the %02d escape doesn't work in Windows, but no where can I find how this should work as a batch file in Windows.
-
Also, obviously, I'm concerned about the -r 1/5 values with the -r and the 0.2 with the -r 0.2. I'm wondering if the forward or backslash is messing me up.
This doesn't work at all:
http://www.bogotobogo.com/FFMpeg/ffmpeg_adv_slide_show_from_images_jpeg.phpLast edited by Tolwyn; 15th Aug 2017 at 17:30.
-
What doesn't work ? Can you be more specific ? Is there an error message ?
Add -pix_fmt yuv420p , -shortest , -start_number 1 , loop 1
Code:ffmpeg -loop 1 -r 0.2 -i "e%02d.png" -i audio.mp3 -shortest -start_number 1 -c:v libx264 -pix_fmt yuv420p -r 30 -c:a copy "output.mp4"
There won't be an easy way to batch it because of different numbering schemes (image sequences usually start at zero) and patterns (different "placeholder" digits) -
-
Or you can use a list file and concat:
https://trac.ffmpeg.org/wiki/Slideshow
Code:ffmpeg.exe -f concat -i list.txt -i audio.mp3 -c:a copy -c:v libx264 -r 30 output.mp4
Code:file 'e00.png' duration 5 file 'e01.png' duration 5 file 'e02.png' duration 5 file 'e03.png' duration 5 file 'e04.png' duration 5 file 'e05.png' duration 5 file 'e06.png' duration 5 file 'e07.png' duration 5 file 'e08.png' duration 5 file 'e09.png' duration 5 file 'e10.png' duration 5 file 'e11.png' duration 5 file 'e12.png' duration 5 file 'e13.png' duration 5 file 'e14.png' duration 5 duration 5 file 'e15.png' duration 5 file 'e16.png' duration 5 file 'e17.png' duration 5 file 'e18.png' duration 5 file 'e19.png' duration 5 file 'e20.png' duration 5 file 'e21.png' duration 5 file 'e22.png' duration 5 file 'e23.png' duration 5 file 'e23.png'
-
Thanks everyone for your responses I really appreciate them. So it looks like it might be the escaping the % which is where I was getting hung up just something simple that I had either forgotten over time or never tried at all.
So I'll try that first and then if that doesn't work I'll work with Con cat and make a list. But my images I can bulk rename so I have them all named with the same exact syntax.
-
If your images start at 1 rather than 0 you can use "-start_number 1".
https://trac.ffmpeg.org/wiki/Slideshow -
@jagabo, I noticed you concat e023 twice.
file 'e23.png'
duration 5
file 'e23.png'
Thanks
Budman1
UPDATE: Yes I found it noted during online search. Looks like it affects last image or 2 depending which method is used.
ThanksLast edited by Budman1; 12th Aug 2017 at 16:31.
-
Yes, the wiki link I gave indicated the last frame had to be included twice in the list. I didn't try it with the last name only once.
-
Nope. Still doesn't work.
My files (images) are named e00.png through e24.png.
Code:ffmpeg -r 1/5 -i e%%02.png -i audio.mp3 -c:v libx264 -r 30 -pix_fmt yuv420p -shortest output.mp4
-
When it delivers that msg, it usually means some path is not complete. According to you script, you would need ffmpeg and all your images in the same folder as well as running the cmd window from it as well. Try using complete path for the images folder.
-
-
THANK YOU. Gawd. I forgot the d.
Hey, is there a location where I can find these escape codes? -
Ok. another question. I have 20 images. The audio source is like 4 minutes. Obviously, 5 seconds/image won't work. What's the switch to get it to loop through?
-
-
Yeah, I did that and it didn't work:
Code:ffmpeg -loop 1 -r 1/5 -i e%%02d.png -i audio.mp3 -c:v libx264 -r 30 -pix_fmt yuv420p -c:a copy output.mp4
-
-shortest will terminate at the shortest input. In you case the audio will end with the newly created video at 100 seconds.
You might also use the -t 00:04:00 option with the -loop
ffmpeg -loop 1 -r 1/5 -i e%%02d.png -i audio.mp3 -c:v libx264 -r 30 -pix_fmt yuv420p -c:a copy -t 00:04:00 output.mp4Last edited by Budman1; 14th Aug 2017 at 23:49.
-
Actually it would end with the audio. Because -loop 1 for time image sequence is longer than 4 minutes, it's basically infinite
Everything works here, I don't know what's up
@ Tolywn what does the console output say ? Any error messages ? Are your paths correct ?
If you're using a batch file file (but not batch processing more than one series), add pause to the end to see the messages
as a batch file
Code:ffmpeg -loop 1 -r 0.2 -i "e%%02d.png" -i audio.mp3 -shortest -start_number 1 -c:v libx264 -pix_fmt yuv420p -r 30 -c:a copy "output.mp4" pause
-
The -loop issue is solved.
One of the images in my sequence (the last one, of all things)... is rotated 90 degrees. The images are 512x384 (4:3), except the LAST image, which is 3:4 - 384x512. That frame size borked the entire operation. I simply... missed it. -
@poisondeathray Thanks, I finally understand loop option... I think LOL
@jagabo Thanks, I understand the problem with the last frames during image to video conversion.
Similar Threads
-
m3u8 dropping/stopping in VLC, ffmpeg, & doesn't work in livestreamer.
By nobodyhome in forum Video Streaming DownloadingReplies: 3Last Post: 12th Oct 2016, 08:56 -
Re-packaging *.mkv--->*.avi does not work with ffmpeg
By pxstein in forum Newbie / General discussionsReplies: 7Last Post: 6th Nov 2013, 09:39 -
youtube m3u8 files ffmpeg doesn't work
By raz3 in forum Video Streaming DownloadingReplies: 6Last Post: 10th Sep 2013, 01:49 -
Diamond VC500 online drivers dont work... lost disc
By Chibears85 in forum CapturingReplies: 0Last Post: 10th Dec 2012, 14:19 -
new ffmpeg - my BATs doesn't work anymore - HELP! [SOLVED]
By CactusMan in forum Newbie / General discussionsReplies: 2Last Post: 1st Sep 2012, 14:24