Ffmpeg video from images windows

In this guide, we’ll walk you through the steps to convert images into a video, covering essential commands and tips to ensure smooth playback and optimal quality. Let’s get started!

Installing FFmpeg

FFmpeg is one of the most versatile tools for multimedia processing. Its ability to handle virtually any format, combined with its speed and efficiency, makes it an excellent choice for converting images into video. Whether you’re dealing with sequential frames or unordered files, FFmpeg can manage it all.

Before starting, ensure FFmpeg is installed on your system. Here’s a quick installation guide:

  • Windows: Download the latest FFmpeg build from ffmpeg.org, extract it, and add the bin folder to your system’s PATH.
  • MacOS: Use Homebrew:
brew install ffmpeg
  • Linux: Use your package manager:
sudo apt install ffmpeg

Preparing Your Images

Preparing your images is a crucial step in ensuring a smooth and seamless conversion into a video. Proper preparation saves you from potential errors and guarantees a polished final output. Here’s a detailed guide to help you get your images ready:

Step 1: Collecting Your Images

To start, gather all the images you plan to include in your video. The quality of your video largely depends on the consistency and resolution of these images.

  • Ensure all the images are in the same format (e.g., .png, .jpg). Mixing formats can confuse FFmpeg and lead to errors during processing. Stick to one format throughout the project.
  • All images should have the same resolution to avoid jarring transitions or black borders appearing in the video. If your images vary in size, consider resizing them to a uniform resolution using FFmpeg or image editing tools.

By paying attention to these details, you’ll ensure a professional and consistent video output.

Step 2: Naming and Organizing Images

Naming and organizing your images is critical for FFmpeg to interpret them correctly and maintain their order in the video sequence.

  • Rename your files in a numerical order, such as image001.jpg, image002.jpg, and so on. This ensures FFmpeg processes the images in the correct sequence, creating a smooth video.
  • Use file renaming tools or scripts to rename files quickly, especially when working with a large number of images.
  • Keep all images in a single folder dedicated to your project. This simplifies the command syntax and minimizes errors caused by misplaced files.

Proper naming and organization streamline the entire process and make troubleshooting easier if any issues arise.

Step 3: Choosing the Desired Frame Rate

The frame rate is a defining factor in how your video will look and feel. It determines how many images (frames) are displayed per second.

  • Understanding Frame Rate:
    • A higher frame rate means smoother playback but requires more images to maintain duration.
    • A lower frame rate creates a choppy effect, often used for artistic or slow-motion videos.
  • Common Frame Rates:
    • 24 fps: Standard for cinematic videos, offering a classic, film-like appearance.
    • 30 fps: Ideal for smoother playback, commonly used in online content and presentations.
  • Impact on Playback Speed: For example, if you have 120 images and choose a frame rate of 24 fps, your video will last 5 seconds. Opting for 30 fps will shorten it to 4 seconds.

You can specify the desired frame rate later in your FFmpeg command to achieve the exact playback speed you need for your project. With your images collected, named, and organized, and your frame rate decided, you’re ready to move on to the next steps. 

Basic FFmpeg Command to Convert Images to Video

When you have a sequence of images and you’re ready to turn them into a video, FFmpeg provides a straightforward command that makes the process efficient and easy. Below is an in-depth breakdown of the syntax you’ll need to follow.

This command assumes that your images are sequentially numbered and stored in the same folder. FFmpeg will then take these images and create a smooth video from them, ensuring that they appear in the correct order.

Syntax Breakdown

The basic command looks like this:

ffmpeg -framerate [fps] -i [input_pattern] -c:v [codec] [output_file]

Let’s break down each component:

  • -framerate [fps]:
    • This option specifies the frame rate of the video. The frame rate determines how many images are shown per second. For instance, 24 is commonly used for cinematic videos, while 30 is popular for smoother playback in most cases.
    • Example: If you use -framerate 24, your video will display 24 images per second.
  • -i [input_pattern]:
    • The input pattern tells FFmpeg where to find your images and in what order. For sequentially named images, you would use a pattern like image%03d.png, where %03d is a placeholder for the sequential numbers of your images (e.g., image001.png, image002.png).
    • Example: -i image%03d.png tells FFmpeg to look for images named image001.png, image002.png, and so on.
  • -c:v [codec]:
    • This specifies the video codec that FFmpeg will use to encode the output video. The codec defines how the video is compressed. A popular codec for MP4 videos is libx264, which provides high-quality output.
    • Example: -c:v libx264 will use the H.264 video codec, a widely supported format for creating MP4 videos.
  • [output_file]:
    • This is the name of the final video file you want to create, including the file extension (e.g., output.mp4). FFmpeg will combine all your images into this video file.

Example Commands

Here are a couple of examples that demonstrate how to use the basic FFmpeg command with different image formats.

  1. Converting a PNG Sequence to MP4: If you have a series of PNG images (named sequentially like image001.png, image002.png, etc.), you can convert them into an MP4 video with the following command:
ffmpeg -framerate 24 -i image%03d.png -c:v libx264 output.mp4

This command will take the PNG images, set a frame rate of 24 frames per second, and encode the video using the libx264 codec, resulting in an MP4 video named output.mp4.

  1. Converting a JPG Sequence to MP4: Similarly, if your images are JPEG files (e.g., image001.jpg, image002.jpg), use this command:
ffmpeg -framerate 30 -i image%03d.jpg -c:v libx264 output.mp4

This command will process the JPEG images at a frame rate of 30 frames per second, encode them into an MP4 video using the libx264 codec, and output the video as output.mp4.

By using these basic commands, you can easily convert a sequence of images into a video. Just make sure your images are properly named and organized, and you’re ready to go. You can also experiment with different frame rates and codecs to adjust the look and feel of the final video.

Using glob for Non-Sequential Images

When your images are not sequentially named, such as holiday.jpg, vacation.jpg, and beach.jpg, you might think that creating a video from them would be a challenge. Fortunately, FFmpeg provides the -pattern_type glob option, which simplifies working with non-sequentially named files. This feature lets you specify a pattern that matches all files of a particular type in a folder, eliminating the need for renaming.

Syntax Breakdown

The command for processing non-sequential images looks like this:

ffmpeg -pattern_type glob -i "[file_pattern]" -c:v [codec] [output_file]

Let’s break it down:

  • -pattern_type glob:
    • This option tells FFmpeg to use the glob pattern matching method. With glob, you can match all files that share a common extension (e.g., .jpg or .png) regardless of their specific names.
    • Example: *.jpg matches all .jpg files in the folder.
  • -i «[file_pattern]»:
    • The file pattern specifies which files to include in the video. You can use wildcards (*) to match multiple files of the same type.
    • Example: «*.jpg» matches files like holiday.jpg, vacation.jpg, and beach.jpg.
  • -c:v [codec]:
    • This specifies the video codec, such as libx264 for MP4 files.
  • [output_file]:
    • The name of the final video file, including the extension (e.g., output.mp4).

Example Command

Here’s an example of how to create a video from non-sequential .jpg files:

ffmpeg -pattern_type glob -i "*.jpg" -c:v libx264 output.mp4

This command takes all .jpg files in the folder, regardless of their names, and combines them into a video. It uses the libx264 codec to encode the video and saves the output as output.mp4.

Here are some key points for you to keep in mind: 

  1. File Sorting: FFmpeg processes files in alphabetical order by default. For example, beach.jpg will come before holiday.jpg if sorted alphabetically. If you want a custom order, you’ll need to rename the files or pre-sort them.
  2. Mixed File Types: If you have multiple file types (e.g., .jpg, .png), you can either run separate commands for each file type or include both in the same folder and use a more specific glob pattern like «*.jpg».
  3. Folder Organization: Place only the images you want to include in the video in a dedicated folder to avoid processing unwanted files.

With the -pattern_type glob option, FFmpeg eliminates the need for tedious renaming when working with non-sequential images. This feature is perfect for quick projects or situations where your files aren’t named systematically but still need to be combined into a stunning video.

Advanced FFmpeg Options for Creating Videos

FFmpeg’s versatility shines with its advanced features, allowing you to enhance your videos in numerous ways. Whether you want to add background music, customize resolutions, create looping slideshows, or overlay text, FFmpeg provides simple yet powerful commands to achieve your goals.

Adding Audio to the Video

Adding an audio track to your video can transform a simple slideshow into a dynamic and engaging presentation. FFmpeg makes it easy to combine images and audio.

Here’s how you can use this command: 

ffmpeg -framerate 24 -i image%03d.png -i background.mp3 -shortest -c:v libx264 -c:a aac output.mp4

Let’s understand the breakdown of this command: 

  • -framerate 24: Sets the frame rate of the video.
  • -i image%03d.png: Specifies the input sequence of images.
  • -i background.mp3: Adds the audio track to the video.
  • -shortest: Ensures the video ends when the shorter of the audio or video streams finishes, preventing playback issues.
  • -c:v libx264: Encodes the video using the H.264 codec.
  • -c:a aac: Encodes the audio using the AAC codec.

Setting Custom Resolutions

You may want to resize your video to meet specific platform requirements or improve compatibility. FFmpeg allows you to adjust the resolution directly during the conversion process.

The command that lets you do it is: 

ffmpeg -framerate 24 -i image%03d.png -vf scale=1280:720 -c:v libx264 output.mp4

Here are the key parameters of the above command, and what they mean: 

  • -vf scale=1280:720: Scales the video to 1280×720 pixels (HD resolution). You can modify the values to match your desired resolution.
  • -c:v libx264: Ensures high-quality video encoding.

Creating a Looping Slideshow

Want to loop your video for a specific duration or number of times? FFmpeg can repeat your images, creating a looping effect. Here’s how: 

ffmpeg -stream_loop 3 -i image%03d.png -c:v libx264 output.mp4

Here’s what this command breaks down to: 

  • -stream_loop 3: Loops the sequence three times.
  • -i image%03d.png: Specifies the input image sequence.
  • -c:v libx264: Encodes the video in MP4 format.

Adding Text Overlays

Overlaying text on your video is a great way to add captions, titles, or watermarks. FFmpeg provides a flexible drawtext filter for this purpose. Here’s how: 

ffmpeg -framerate 24 -i image%03d.png -vf "drawtext=text='My Slideshow':fontcolor=white:fontsize=24:x=10:y=10" -c:v libx264 output.mp4

Here’s what this command includes: 

  • -vf «drawtext=text=’My Slideshow’:fontcolor=white:fontsize=24:x=10:y=10»:
    • Adds the text «My Slideshow» in white, with a font size of 24.
    • x=10 and y=10 set the text’s position on the screen (10 pixels from the top-left corner).
  • -c:v libx264: Encodes the output video.

You can mix and match these advanced options to create highly customized videos. For instance, you might want to:

  • Add background music and text overlays.
  • Create a looping slideshow at a custom resolution.

For instance, 

ffmpeg -framerate 24 -i image%03d.png -i background.mp3 -vf "scale=1920:1080,drawtext=text='Event Highlights':fontcolor=yellow:fontsize=36:x=50:y=50" -shortest -c:v libx264 -c:a aac output.mp4

Troubleshooting Common Errors

Despite FFmpeg’s efficiency and robustness, you may encounter a few common errors when converting images to video. Understanding these issues and their solutions will help you navigate challenges and create a seamless video. Below are the most frequent problems and their resolutions.

1. Error: «Image file not found»

This error occurs when FFmpeg cannot locate the input image files specified in the command. It typically stems from incorrect file names, extensions, or file paths.

Possible Causes:

  • Files are not sequentially named (e.g., image001.png, image002.png).
  • File extensions in the command do not match the actual image file extensions (e.g., .jpg vs. .png).
  • Files are not located in the specified directory.

Solution:

  • Double-check filenames: Ensure that all images are named sequentially using a consistent pattern, such as image%03d.png for files like image001.png, image002.png, etc.
  • Verify extensions: Confirm that the extension in the command matches the actual file format (e.g., .jpg or .png).
  • Correct file path: If the images are stored in a different directory, provide the full file path in the command.

2. Output Video Quality Issues

Low video quality is a common issue when default settings are used, as FFmpeg might apply minimal compression to save processing time. If the output video appears pixelated or blurry, the problem usually lies in the bitrate or codec settings.

Possible Causes:

  • Insufficient bitrate for high-resolution images.
  • Default codec settings not optimized for quality.

Solution:

  • Increase the bitrate: Specify a higher bitrate to enhance video quality. For example, -b:v 2M sets the bitrate to 2 Mbps, suitable for most HD videos.
  • Use a better codec: Opt for codecs like libx264 for MP4 videos, which are known for preserving quality while maintaining reasonable file sizes.

For even higher quality, experiment with the -crf (Constant Rate Factor) setting:

ffmpeg -framerate 24 -i image%03d.png -crf 18 -c:v libx264 output.mp4

Lower CRF values (e.g., 18) result in higher quality but larger file sizes.

3. Mismatch in Audio and Video Length

When adding an audio track to a video, you may encounter synchronization issues if the video duration is shorter or longer than the audio. This can result in the audio cutting off or the video playing with a silent ending.

Possible Causes:

  • Video duration does not match the audio length.
  • FFmpeg processes the video and audio streams independently by default.

Solution:

  • Trim the longer stream: Use the -shortest flag to ensure the video stops at the end of the shorter stream (either video or audio). This prevents unwanted silent segments or audio cut-offs.
ffmpeg -framerate 24 -i image%03d.png -i audio.mp3 -shortest -c:v libx264 output.mp4
  • -shortest: Automatically adjusts the output duration to match the shorter stream (audio or video).
  • -c:v libx264: Encodes the video in H.264 format.

If the audio needs to loop to match the video duration, use the -stream_loop option for the audio file:

ffmpeg -framerate 24 -i image%03d.png -stream_loop -1 -i audio.mp3 -c:v libx264 output.mp4

Points to Remember

Creating videos from images using FFmpeg is an efficient and customizable process, but attention to detail is key to achieving a polished result. Here are some quick takeaways to keep in mind:

  1. Prepare Your Images Properly:
    • Use consistent formats (e.g., .png or .jpg) and resolutions.
    • Name your files sequentially for smooth processing.
  2. Master Basic and Advanced Commands:
    • Use the correct syntax for sequential images or the -pattern_type glob option for non-sequential images.
    • Explore advanced options like adding audio, setting custom resolutions, creating looping slideshows, and overlaying text.
  3. Optimize Quality:
    • Increase the bitrate or use a lower CRF value to enhance video clarity.
    • Choose reliable codecs like libx264 for high-quality output.
  4. Troubleshoot Common Errors:
    • Double-check file naming and paths if FFmpeg reports missing files.
    • Use the -shortest flag to sync audio and video durations.
  5. Experiment and Customize:
    • Combine features like audio tracks, text overlays, and custom resolutions for a unique final product.
    • Adjust the frame rate to achieve the desired playback speed and style.

Following these steps and leveraging FFmpeg’s powerful features allows you to create stunning, professional-quality videos from your image collections with ease. Experiment with different commands to find what works best for your project!

FAQs

1. Can FFmpeg handle different image formats in one video?

Yes, use -pattern_type glob to include multiple formats (e.g., .jpg, .png).

2. What are the alternatives to FFmpeg for converting images to video?

Tools like Adobe Premiere Pro, DaVinci Resolve, or free software like Shotcut can achieve similar results.

3. How to add an image to a video in FFmpeg?

Overlay an image using:

ffmpeg -i video.mp4 -i image.png -filter_complex «[1:v]scale=1280:720[overlay];[0:v][overlay]overlay» output.mp4

4. How can I ensure high-quality output when converting images to video using FFmpeg?

Here’s how:

  • Use a high bitrate.
  • Choose a high-quality codec like libx264.
  • Ensure your input images are high resolution.

In this tutorial, we will learn how to create a video from images using FFmpeg. FFmpeg can do this easily if the input is fed as a sequence of images that have been named in an appropriate and easy-to-parse manner.

Creating a video from images is very useful, especially when you indulge in stop-motion photography or into time-lapse movies. In time-lapse movies, you basically set up your camera to take a picture and then go to sleep for N seconds. It then wakes up and takes another picture, and goes back to sleep. You do process this long enough, and you have a 100s of images shot from a single position, and when you make a movie out of them, the result is spectacular.

If you are interested in making a time-lapse video, then take a look at this tutorial that shows you how to make a video from images using FFmpeg.

Table of Contents

Step 0: Preparing the Images

As mentioned, for this method to work as desired, it is necessary to prepare the input correctly. FFmpeg uses string matching to identify and line up the input images — and so it is important that the input images are sequentially numbered.

FFmpeg provides support for approximately three different patterns. The patterns are as follows:

  1. Filenames with leading zeroes, e.g. filename-%03d.png corresponds to images named from filename-001.png to filename-999.png.
  2. Filenames without leading zeroes, e.g. filename-%d.png correspond to images named from filename-1.png to filename-999.png.
  3. Prefixed without a regular pattern, e.g. filename-*.png correspond to all images that start with the prefix filename- but do not strictly follow a sequential numbering order. If you use this option, then you need to provide an additional parameter for the image to video conversion and we’ll see this in a later section.

Note: If the filename contains the character ‘%’, it can be solved by adding “%%” at the positioning of the literal to “escape” this problem!

Now that we have the images prepared, let’s demonstrate how to create a video using these images.

For this demo, I used the previously published article Thumbnails & Screenshots using FFmpeg – 3 Efficient Techniques to generate the images required. As you can see from the screenshot below, the images are sequentially numbered which makes the images-to-video conversion much easier!

video from images using FFmpeg

The most basic form of the command to create a video from images using FFmpeg is as follows:

ffmpeg -framerate 10 -i filename-%03d.jpg output.mp4

If the -framerate parameter is not provided, FFmpeg selects the default rate of 25 fps. Depending on the format used to prepare the images, substitute the appropriate string matching pattern. 

Using glob for Pattern Matching When Sequential Input Is Not Provided

If a sequential order is not provided, but the input filenames are appropriately prefixed and follow a logical order, then you can use the glob parameter to create the video. For example, you might have input-00.png, input-10.png, and input-30.png, etc. Here is an example of the command line for creating a video from such images.

ffmpeg -framerate 10 -pattern_type  glob -i "filename-*.jpg" output.mp4

Note:

  1. It is necessary to quote the glob pattern, else the command will fail due to the command interpreting the files as multiple arguments. 
  2. Windows has a problem with globbing as it does not have access to glob.h. See here and here. The easiest way out is to actually ensure that the files are sequentially ordered.

Examples

Here are some examples of videos created from images using FFmpeg with different frame rates.

Framerate = 25 fps (default)

Notice how FAST the video progresses, which is because we have 25 frames every second. This is unwatchable, in my opinion! It could be a great option if you are making a stop motion movie, or a time lapse movie.

Framerate = 2 fps

Notice how slow the video progresses which is because we have only two frames every second.

Framerate = 10 fps

That’s it. I hope you were able to successfully create a video from images using FFmpeg from this tutorial. If you are interested in FFmpeg, please check out the rest of the FFmpeg tuorials on OTTVerse.com.



Akshay Rajeev

Akshay is a student at the NYU Tandon School of Engineering, completing his M.S. in Computer Engineering. His area of interest includes software system design, machine learning, and cybersecurity.

Akshay also serves as a Contributing Author on OTTVerse.com

Turning a sequence of images into a video can be useful for creating stop-frame movies, scientific animations, and simple slide shows. This post shows you how you can use the free command line tool ffmpeg to create a video from images. ffmpeg is a powerful, versatile command line tool which is widely used for other movie and animation manipulation tasks.

Prepare Your Image Files

It’s actually quite easy to create a video from images using ffmpeg, as long as you prepare your image files in right way.

You need to make sure your sequence of images are in the same folder and named correctly. They should be named sequentially, for example img-00.png, img-01.png, img-02.png and so on. By default ffmpeg expects that images should be numbered starting from zero.

video from images

Once you have your source images named correctly and in the same directory, you can run this command at the command line (from inside your image directory):

ffmpeg -i img-%02d.png video_name.avi

In this example, ffmpeg will look for images with file names with ‘img-‘ followed by a two-digit number and a .png file extension, and convert these images into a avi video file named ‘video_name.avi’.

In this command you need to specify a search pattern for ffmpeg to find the image sequence it should use. This search pattern depends on what you named your images when preparing them.

Setting The Frame Rate

An important consideration when you create a video from images is the frame rate – the number of frames (images) per second (fps) in the video. The most appropriate frame rate will depend on your source images. If you are making a stop-frame animation for example, you may be happy with the default of 25 fps. If however you want something more like a slow moving slide show, you may want a slower frame rate such as 2 fps.

If you don’t specify the frame rate, you may find some odd results in your output video file. For example, to set an output video with a frame rate of 5 fps, you would need to run:

ffmpeg -framerate 5 -i img-%02d.png video.avi

Changing the Video Format

In these examples I have used avi as the output video format. ffmpeg supports a range of different video formats and you can change the format of your output video by changing the file extension of the output video file.

To see which output formats are available you can run:

ffmpeg -encoders

FFmpeg видео из картинки со скроллом

FFmpeg — это фреймворк который позволяет делать разные крутые штуки с видео, аудио и картинками. Его можно использовать как самостоятельное консольное приложение или встраивать его в свои продукты (FFmpeg выпускается под лицензией LGPL).

Одно из очень полезных его применений — создание роликов из статичного контента, картинок и текста. Например для описаний товаров. Об этом его применении и пойдет речь в запланированной серии роликов на канале Azzrael.

Задача

Есть масса лотов товаров представленных в виде нескольких картинок, текстовых заголовков, текстового описания товара и комментариев. Нужно сделать из этих данных видео, где картинки будут демонстрироваться с некоторыми эффектами (прокрутка, плавное появление, зум, паннинг и т.п.), заголовки и описания озвучиваться, комменты скриниться и зачитываться, все это под легкую музыку. Также необходимо чтобы в каждом ролике была картинка превью с Заголовком товара и ссылкой на магазин и финальная картинка с мотивашкой на подписку и лайки.

В принципе задача может быть реализована разными способами. Однако когда товаров много, скажем речь идет о тысячах лотов а сроки сжаты, то нужна автоматизация и здесь FFmpeg просто незаменим.

В результате мы планируем разработать некоторый программный комплекс, который мог бы делать такие пакеты видеоконтента на потоке по заранее заданному сценарию.

Разработка идет под Windows 10 x64, но в целом все в ролик не сложно портировать на *nix.

Сегодня начало, поэтому просто скачаем ffmpeg и напишем простой консольный скрипт (bat), который из картинки делает видео с прокручиваемой картинкой.

Установка FFmpeg под Windows 10 x64

Нам для работы нужен обычный бинарник (готовый к запуску файл, программа) ffmpeg.exe. Качаем нужную версию с официального сайта.

  • В архиве несколько файлов, нам нужен только ffmpeg.exe.
  • Создаем папку проекта, разархивируем туда ffmpeg.exe.
  • В эту же папку проекта кладем картинку из которой будем делать видео.
  • Создаем в этой папке файл run.bat — это обычный текстовый файл, в котором мы будем писать скрипт. Bat файл это исполняемый скрипт windows. Для его запуска просто кликните по нему дважды.

Пишем скрипт для создания видео с прокруткой

В файл run.bat пишем следующий код

echo «** Hey, Azzrael Youtube viewers!!!»

ffmpeg.exe  -f lavfi -i color=c=#DD0000:s=1920×1080 -loop 1 -i 1.png -s «1920×1080» -t 5 -filter_complex «[1:v]scale=1920:-2[fg], [0:v][fg]overlay=y=-‘t*((h-1080)/5)’:eof_action=endall» -y out.mp4

pause

Сохраняем. Запускаем. Если все прошло хорошо, то в папке должен появиться файл out.mp4. Это результат работы нашего скрипта.

Как работает скрипт ffmpeg создания видео из картинки с прокруткой

Сначала мы создаем два потока (параметры -i) первый поток — это фон с заливкой цветом. Второй поток — это наша картинка. -s задает размер видео, -t его продолжительность.

-filter_complex делает всю магию. Здесь мы берем поток картинки и растягиваем его по ширине видео = 1920. Затем мы его накладываем на фон с заливкой и каждый кадр смещаем картинку вверх, таким образом создаем эффект скроллинга. Скорость скроллинга, его направление, мы можем регулировать в фильтре overlay.

Ссылки

lavfi , filter_complex , scale , overlay

John on March 26, 2021

In this tutorial, we will learn how to create a video from a collection of images using FFmpeg. This will be useful for scientific animations, stop-motion movies and picture slideshows.

Create a Directory of Images

The first step is to create a directory and add your images inside it. The name of each image should be a number starting at 0 and counting up. All the file extensions should be the same too.

mkdir image-sequence

image-sequence

0.jpg
1.jpg
2.jpg
3.jpg
4.jpg
5.jpg

Now move to the image-sequence directory in the terminal:

cd image-sequence

The FFmpeg Command

In the FFmpeg command, specify the input file as %d.jpg followed by the name of the output file.

%d is a placeholder for any number. The default behaviour of FFmpeg is to start at 0 and continue counting up until no more files are found when it is given a placeholder number.

ffmpeg -i %d.jpg output.mp4

You can tell FFmpeg to start counting at a number other than 0 using the -start_number flag like this:

ffmpeg -start_number 3 -i %d.jpg output.mp4

If you get an error saying; height not divisible by 2, scale the output like this to fix the problem:

ffmpeg -i %d.jpg scale=-2:720 output.mp4

Replace 720 with the height in pixels that the video should be.

Setting a Custom Frame Rate

You will notice that the image sequence in your output video moves super fast. This is because the default framerate for FFmpeg is 25fps. You can reduce or increase this value using the -framerate flag. Typically for slideshows, you will want a slow framerate of maybe 0.1fps.

ffmpeg -framerate 0.1 -i %d.jpg output.mp4

Note – you must specify the -framerate as the first argument of the FFmpeg command or it will not work.

ffmpeg
image
video

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как обновиться с windows xp до windows vista
  • Intel graphics media accelerator 3600 windows 7 driver
  • Как запустить готику 2 ночь ворона на windows 10
  • Какой эмулятор андроида для пк windows 7 лучше
  • Как проверить запущен ли postgresql windows