FFmpeg slideshow with images of different dimensions

2

I have .jpg files like (img001.jpg), each of them with different dimensions. I also have an audio file .ogg. I wanna create slideshow with audio but I have a scaling problem, because the image dimensions are different.

ffmpeg -r 1/2 -i img%03d.jpg -i example.ogg -s 1920x1080 AL_SlideShow.mkv

(2 second image change interval, x265 1920*1080)

And sound only plays last 30 second I think.

Mesut Komser

Posted 2018-04-13T18:22:05.003

Reputation: 21

Answers

1

You have to scale the images to a common size. Add a scale video filter:

ffmpeg -r 1/2 -i img%03d.jpg -i example.ogg \
-vf "scale=1920:1080,format=yuv420p" \
AL_SlideShow.mkv

If you want to use libx265, you need to specify -c:v libx265 as well.

You may want to add -shortest before the output filename to stop the encoding when all images have been read. That way, the audio stream will be cut.

slhck

Posted 2018-04-13T18:22:05.003

Reputation: 182 472