Png files to mp4

Dear All,

how can I converts pngs files (fig1.png, fig2.png, … , fig10.png) to mp4. video using a very easy method in Julia?

Best regards

I am not sure why you think Julia is the right tool for this task. Just use an external program. You can of course call it from Julia.

Sure, I want to find a similar package in Julia, e.g. (Matlab)

writerObj = VideoWriter('test.avi');


for K = 1 : 10000

filename1 = sprintf('%d.png', K);

thisimage1 = imread(filename1);

writeVideo(writerObj, thisimage1);



I assume you’re trying to animate a sequence of plots as described in your earlier post? Plots.jl has a built-in animation utility:
(note that you can save a .mp4 by calling mp4(anim, “path/to/savedir/animation.mp4”, fps=30) )

1 Like

HI @stillyslalom

thanks a lot for your support!

how about VideoIO.jl?


Unfortunately, VideoIO.jl is only capable of video input, not output (at least as of the last time I checked). See:
The most versatile option is, as Tamas mentioned, calling an external program, which is the approach taken by If you need more control, you can build your own ffmpeg command pipe as I did here.


Use ffmpeg and call it from Julia if you want to.

sure , I can also make a video file in terminal using ffmpeg command