Compiling frames into a video with ffmpeg

Question:

I have a folder with a number of frames in which I’d like to concatenate into an mp4 file using ffmpeg. What is the correct syntax to do this in a Jupyter notebook script? I have tried:

os.system("ffmpeg -r 30 -i ./inputs/upload%00001d.png -y ./inputs/result.mp4")

The above runs through with no errors but does not produce an output.

Asked By: CS1994

||

Answers:

As I’ve stated in the comment, correct your file format to upload%05d.png and consider specifying the codec too:

def saveMpeg():
    os.system("ffmpeg -r 30 -i ./inputs/upload%05d.png -vcodec mpeg4 -y ./inputs/result.mp4")

saveMpeg()
Answered By: Serzhan Akhmetov
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.