I am trying to create a simple animation in 1D, using the Plots.jl with GR as a backend.
Basically, I have a matrix where the rows are the solution u at a time instant. What I was trying to do was to plot the evolution of my solution along time.
For that I checked the website: Plots.jl/animations and tried to apply the two examples.
So, i type the following codes:
@gif for i=1:n
plot(x,u_sol[i,:])
end every 10
and
anim = @animate for i=1:n
plot(x,u_sol[i,:])
end
gif(anim, "/tmp/anim_fps15.gif", fps = 15)
gif(anim, "/tmp/anim_fps30.gif", fps = 30)
In either cases I got this error: IOError: could not spawn ffmpeg -v 0 -i 'C:\Users\tiago\AppData\Local\Temp\jl_289C.tmp/%06d.png' -vf palettegen=stats_mode=diff -y 'C:\Users\tiago\AppData\Local\Temp\jl_289C.tmp/palette.bmp': no such file or directory (ENOENT)
I donāt know exactly if I need to install or define something on Juno.
Does anyone had the same or similar problem? Help is welcome.
I have the same problem, I use the following workaround
loadpath = # path to where plots should be stored
animation = Animation(loadpath,String[])
for i=1:n
p = plot(x,u_sol[i,:])
frame( animation, p )
end
name_of_gif = # name of file.gif
run(`ffmpeg -framerate 15 -i $loadpath"%06d.png" $name_of_gif`) # run this in the REPL, it will hang indefinetly, if the gif already exists
when you already go this road I would recommend to use a better format for the video like for example .mp4 with
Thank you for the help! But didnāt work with me, it throws this error:
ERROR: IOError: could not spawn ffmpeg -framerate=15 -i C:/Users/tiago%06d.png teste.gif: no such file or directory (ENOENT)
I did a quick search and I saw that I must install ffmpeg in my computer. Did you had to install too?
UPDATE: I installed now ffmpeg but the error is the same.
I had problems to put my path in a string, but I think I did it right: loadpath = "C:/Users/tiago", the slash i think is correct!
Oh yes! Of course, youāre right.
Now I tried and I had a problem with the attribute -framerate, it says:
Unrecognized option āframerate=15ā.
Error splitting the argument list: Option not found
ERROR: failed process: Process(ffmpeg -framerate=15 -i C:/Users/tiago/%06d.png -vcodec libx264 -crf 25 teste.mp4, ProcessExited(1)) [1]
So, I deleted the -framerate attribute and it worked āfineā. I couldnāt get any gif, instead of a gif saved every plot as a png file in the destination folder. I installed ffmpeg in my computer, I donāt know if it was supposed to.
For a workaround I can, manually, do the gif by my own but itās just a bit annoying!