How can I make a slideshow with ffmpeg?
Your ffmpeg is old. Update it before doing anything else. See FFmpeg Downloads for links to builds for Linux, Windows, and macOS.
Use -framerate instead of -r for input.
Change -acodec libvo_aacenc to -c:a aac. libvoaac_enc is a low quality encoder and support for it has been removed from FFmpeg.
Some players do not like a low frame rate. Declare an output frame rate with -r or the fps filter when the input -framerate is below ~5 fps.
Use -crf instead of -b / -b:v.
Output MP4 instead of AVI.


Example command:

ffmpeg -y -pattern_type glob -loop 1 -framerate 1/4 -i "folder/*.jpg"  -i "folder/voice.mp3" -c:v libx264 -preset veryslow -crf 22 -pix_fmt yuv420p -r 25 -shortest -movflags +faststart folder.mp4