Skip to content
SumGuy's Ramblings
Go back

Creating Image Slideshows with Voiceovers using FFMPEG

FFMPEG

In the world of multimedia processing, FFMPEG stands as a powerful and versatile tool for handling audio and video files. FFMPEG, short for Fast Forward Moving Picture Expert Group, is a command-line-based utility that enables users to manipulate media files with ease. This article aims to provide a comprehensive guide on installing FFMPEG on Ubuntu and utilizing a specific code snippet to create stunning image slideshows accompanied by audio tracks.

Installing FFMPEG

Before diving into the utilization of FFMPEG, it’s important to have the tool installed on your Ubuntu system. Follow these steps to install FFMPEG:

Once the installation process completes, you will have FFMPEG up and running on your Ubuntu system, ready to unleash its capabilities. Now that you have FFMPEG installed, let’s explore how to utilize it to create captivating image slideshows accompanied by audio tracks.

Examples

First example: I have an image file called mountain.jpg and a mp3 file called awesome_song.mp3. I want to make one mp4 file from these files called mountainsongs.mp4:

ffmpeg -loop 1 -i "mountain.jpg" -i "awesome_song.mp3" -r 1 -c:v libx264 -pix_fmt yuv420p -preset veryslow -crf 12 -tune stillimage -c:a copy -shortest mountainsongs.mp4

In the second example, I have a folder with 10 images all named various things ending in extension png. I also have 10 audio tracks named after each image (you can have any audio including tracks you recorded or downloaded). e.g. 1.png 2.png 3.png along with 1.mp3 2.mp3 3.mp3

for i in *.PNG; do ffmpeg -loop 1 -i "${i%.*}.PNG" -i "${i%.*}.mp3" -r 1 -c:v libx264 -pix_fmt yuv420p -preset veryslow -crf 12 -tune stillimage -c:a copy -shortest "${i%.*}.mp4"; done

Piece-by-piece explanation:

By running this code snippet, FFMPEG will process each PNG image file and its associated MP3 audio file, creating MP4 video files as output. The resulting videos will feature a still image slideshow with synchronized audio tracks.

Conclusion on FFMPEG

FFMPEG is a powerful multimedia tool that can be harnessed to manipulate audio and video files from the command line. This article guides you through the installation process of FFMPEG on Ubuntu and provided an explanation of the provided code snippet, which enables you to create captivating image slideshows accompanied by audio tracks. By leveraging FFMPEG’s extensive options and parameters, you can customize your output videos to suit your specific needs. With FFMPEG in your toolkit, you have the means to unleash your creativity and enhance your multimedia projects.


Share this post on:

Previous Post
Set the Timezone in Ubuntu with timedatectl
Next Post
Understanding the Mogrify Tool in Linux: A Guide to Image Manipulation