I have a bunch of PNG files in separate directories that I'll turn into videos with FFMPEG. Say each clip will be a minute long. I then want to stitch those together into a final video. The final format can be anything YouTube accepts.

So, I need a format that won't lose a lot of quality when the PNGs are encoded the first time, and that doesn't lose any quality when it's concatenated to other videos of the same format (some need to be re-encoded and some behave like UNIX's cat). They will also each have their own audio tracks which need to stay lined up correctly. So, do any audio formats have problems with this? I can have them in any format.

Also, is there a way to set the video durration longer than then would be assumed? Say I have 48 frames showing at 24 fps. Could I have it make the video 3 seconds instead of 2; holding the last frame for a full second?

  • Please show some details on an example png file. The complete output of ffmpeg -i input.png will suffice.
    – llogan
    Mar 12 '13 at 0:47

What you wish to do is somewhat convoluted. There is a path to achieving it in the 2 step process you propose, but I would just suggest creating a new folder where you copy all the input files and rename to form a continuous sequence.

Let's say you have 3 folders and the following files in them to be joined in that order

Folder A: a001.png, a002.png, a003.png, ...... a175.png

Folder B: b0001.png, b0002.png, b0003.png, ...... b1075.png

Folder C: c01.png, c02.png, c03.png, ...... c75.png

Also let's say you want to hold the last frame of B for 5 seconds

So, you rename a001-a175 to s0001-s0175; rename b0001-b1075 to s0176-1250; duplicate s1250 120 times (24fps x 5) and rename the copies s1251-s1370, and finally rename c01-c75 to s1371-s1445.

This method avoids issues of video generation loss. For audio, WAVE files of the correct length and order can be appended losslessy by FFmpeg and then converted+muxed with the output video.

Of course, I see from your history that you have access to Premiere Pro. The simplest way of all would be to load all PNGs and audio in the editor, assemble and take output.

  • Okay, not ideal, but I think I can make it work. I no longer have access to Premiere. I'm curious to see if there are any other answers, because I'll be in this situation on a semi-regular basis.
    – Brigand
    Mar 8 '13 at 9:42

The easiest way to do this is to simply use the png sequences directly in your editing program. Any good editing package should support using them directly and you can interpret the sequence at any framerate you desire (though be aware you will have some quality loss if your final frame rate is not an even multiple of the various PNG sequence frame rates).


Use ffmpeg's concat filter to concatenate multiple -i dir/foo%d.png input sources into a single output video.

Old question so not taking time to dig up links or write more. Just google.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.