2

I am working on something similar to the following link, and I have tried to do the same but I get some errors. I tried to comment on that post and share my problem, but I couldn't due to low reputation. FFmpeg making video from images placed in different folders

I have followed the steps, i.e., to create a file with paths to different folders and then run the ffmpeg concat command. My textfile contains file '/folder1/frame%04d.png' file '/folder2/frame%04d.png' file '/folder3/frame%04d.png'

And my ffmpeg command is ffmpeg -f concat -i file.txt sample.mp4

I have images with names frame0001-frame0030 in folder1, frame0031-frame0060 in folder2 and frame0061-frame0090 in folder3. I would like to make a video of all these images. But I get the following error [image2 @ 000002699492a980] Could find no file with path '/folder2/frame%04d.png' and index in the range 0-4 [concat @ 0000026993e5a8c0] Impossible to open '/folder2/frame%04d.png' file.txt: No such file or directory file.txt: I/O error

Can anyone please help where I have gone wrong?

ST94
  • 35
  • 8

1 Answers1

3

First number has to be in range 0-4. The image demuxer does allow one to specify a custom start_number, however the concat demuxer does not accept options for slave demuxers. You'll have to ingest the three sequences separately and concat them.

ffmpeg -start_number 1  -i /folder1/frame%04d.png
       -start_number 31 -i /folder2/frame%04d.png
       -start_number 61 -i /folder3/frame%04d.png
       -filter_complex "concat=n=3" out.mp4

Alternate method is to write an entry for each individual image (with path) in your text file.

In either case, you will need to add -pix_fmt yuv420p for wide compatbility of MP4.

Gyan
  • 85,394
  • 9
  • 169
  • 201