Hello,

Allow me to begin with the fact that I have been playing around with ffmpeg enough to make it work a couple of times and it allowed me to create legit videos that were worthy of using afterwards. However I also need to mention that throughout this learning curve that easily finding THE proper information on what (I think) are simple matters proves sometimes very complicated.

This is why I have registered on this forum: because this community seems to know their stuff. And with that being said, I am trying to encode a slideshow from some jpegs(all standardized to 4096x2160) and 1x wav(freshly extracted) files using the following:

$ ffmpeg -loop 1 -r 1/10 -i img%03d.jpg -i my.wav -c:v libx264 -vf fps=1 -pix_fmt yuv420p -shortest myslideshow.mp4
And the result is generally a myslideshow.mp4 that will display all of my jpegs files img???.jpg over the my.wav that were all sharing the same folder. As it should be. And it happens on most of the days.

But on the bad days the myslideshow.mp4 file will play correctly(showing 1 picture every 10 seconds per requested) but it will also have added an extra 2 minutes of silence at the end. And during that silence period jpegs will continue to slideshow. Why is that??

As I already said I spent a couple of nights reading on how ffmpeg works and over that time period I discovered the -af "adelay=1|1" switch. But I am not sure that I need to go that far since my goal is to encode simple videos from simply and standardized jpegs & waves in a quick way and in batch mode. Therefore I am on the look-out for a basic recipe(command line) that I can constantly reuse and that will always work while keeping the esoteric stuff away (like calculating audio & video lenght and combining them after, such as what the adelay switch hints me at doing).

So, dear VideoHelp community, can anyone of you please guide me on how to use ffmpeg properly so that each time I encode a .mp4 file that they never end with a 2+ minutes of silence at the end while only displaying pictures?