# Png files to mp4

**URL:** https://discourse.julialang.org/t/png-files-to-mp4/23978
**Category:** General Usage
**Tags:** question
**Created:** [May 7, 2019, 8:11pm UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978 "2019-05-07T20:11:05Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)
#### Post date: [May 7, 2019, 8:11pm UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/1 "2019-05-07T20:11:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 8, 2019, 5:25am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/2 "2019-05-08T05:25:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)
#### Post date: [May 8, 2019, 6:30am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/3 "2019-05-08T06:30:49Z")

</div>

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

```julia
writerObj = VideoWriter('test.avi');

open(writerObj);

for K = 1 : 10000

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

thisimage1 = imread(filename1);

writeVideo(writerObj, thisimage1);

end

close(writerObj);

```

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [May 8, 2019, 6:42am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/4 "2019-05-08T06:42:34Z")

</div>

I assume you’re trying to animate a sequence of plots as described in your [earlier post](https://discourse.julialang.org/t/visualisation-in-julia/23962/12)? Plots.jl has a built-in animation utility: [Animations · Plots](http://docs.juliaplots.org/latest/animations/)  
(note that you can save a .mp4 by calling `mp4(anim, “path/to/savedir/animation.mp4”, fps=30)` )

---

<div class="post-metadata">

### Author: ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)
#### Post date: [May 8, 2019, 6:45am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/5 "2019-05-08T06:45:47Z")

</div>

HI @stillyslalom

thanks a lot for your support!

how about **[VideoIO.jl](https://github.com/JuliaIO/VideoIO.jl)**?

best

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [May 8, 2019, 6:53am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/6 "2019-05-08T06:53:54Z")

</div>

Unfortunately, VideoIO.jl is only capable of video input, not output (at least as of the last time I checked). See: [https://github.com/JuliaIO/VideoIO.jl/issues/36](https://github.com/JuliaIO/VideoIO.jl/issues/36)  
The most versatile option is, as Tamas mentioned, calling an external program, which is the approach taken by [https://github.com/yakir12/FFmpegPipe.jl](https://github.com/yakir12/FFmpegPipe.jl). If you need more control, you can build your own ffmpeg command pipe as I did [here](https://discourse.julialang.org/t/creating-a-video-from-a-stack-of-images/646/8).

---

<div class="post-metadata">

### Author: ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)
#### Post date: [May 8, 2019, 7:01am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/7 "2019-05-08T07:01:13Z")

</div>

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

[https://stackoverflow.com/questions/24961127/how-to-create-a-video-from-images-with-ffmpeg](https://stackoverflow.com/questions/24961127/how-to-create-a-video-from-images-with-ffmpeg)

---

<div class="post-metadata">

### Author: ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)
#### Post date: [May 8, 2019, 7:03am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978/8 "2019-05-08T07:03:33Z")

</div>

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