[FFmpeg-user] Converting pictures to video

Dan Bridges dosdan at gmail.com
Sat Dec 7 08:42:40 EET 2019


On 7/12/2019 11:49 am, Anwuli Okwuashi wrote:
> [image2 @ 000001d077c4a440] Could find no file with path
> 'C:\Users\analyst\Desktop\STATA\projects\animation3\graph%02d.png' and
> index in the range 0-4


I created a 1500x1000 1000-image set: Sequence_000.png ->
Sequence_999.png. This loads fine using at the start of the command line:

ffmpeg -i Sequence_%03d.png

This will also work if the sequence numbers are inside the filename:

ffmpeg -i 0191107-154%03d-214.png

But if you rename the first 5 files to:  _Sequence_000.png ... 
_Sequence_004.png it will fail because the first file starting with
Sequence is now Sequence_005.png.

Renaming _Sequence_004.png -> Sequence_004.png  will allow the remaining
995 files in the sequence to load.

If you can not batch rename the sequence to start from 00 or if it is a
non-contiguous list because you deleted some damaged/missing images, you
can tell FFMPEG to load a list of filenames. This has to be in a
particular 1 or 2-line format (if including  image duration).

For example, I've deleted the first 83 images, substituted a
Replacement.png, and the remaining image names jump by 3. Then I created
a list of filenames.

To create such a list in Windows, I use create_list.bat, here designed
to look in the "Sequence Directory", beneath the current directory
("C:\test directory"), where the images files are situated, create a
2-line name-sorted list where the 2nd line is the duration in secs (1
frame at 25fps = 40ms), and then load this list in the associated text
editor so you can delete or move blocks, change durations etc., if required.

@echo off
SETLOCAL EnableDelayedExpansion
if exist mylist.txt del mylist.txt
for %%I in ("Sequence Directory\*.png") do (echo file '%%~fI' >>
mylist.txt & echo duration 0.04 >> mylist.txt)  
start /i mylist.txt

The first 4 files in the list:

file 'C:\test directory\Sequence directory\Replacement.png' 
duration 0.04
file 'C:\test directory\Sequence directory\Sequence_0083.png' 
duration 0.04
file 'C:\test directory\Sequence directory\Sequence_0086.png' 
duration 0.04
file 'C:\test directory\Sequence directory\Sequence_0089.png' 
duration 0.04

If you decrease the duration below 0.04 @25fps FFMPEG will start to drop
frames. Conversely, if you go above 0.04, it will start to replicate frames.

To use this list:

ffmpeg.exe -f concat -safe 0 -i "C:\test directory\mylist.txt" -maxrate
30000k -y "C:\test directory\Sequence directory"\map_video6.mpg


Dan.











*
*



More information about the ffmpeg-user mailing list