GIF doesn't work

Hello !

I’m trying to create a GIF but I get an error. I’m under Windows 10 (but it does it also under Linux [Ubuntu])

could not spawn `ffmpeg -v 0 -i 'C:\Users\...\AppData\Local\Temp\jl_C8B5.tmp/%06d.png' -vf palettegen=stats_mode=diff -y 'C:\Users\...\AppData\Local\Temp\jl_C8B5.tmp/palette.bmp'`: no such file or directory (ENOENT)

Do I need to add some package in oder to make it works ?

Just in case, there is the code I’m using (not mine)

using Plots
# initialize the attractor
n = 1500
dt = 0.02
σ, ρ, β = 10., 28., 8/3
x, y, z = 1., 1., 1.

# initialize a 3D plot with 1 empty series
plt = path3d(1, xlim=(-25,25), ylim=(-25,25), zlim=(0,50),
                xlab = "x", ylab = "y", zlab = "z",
                title = "Lorenz Attractor", marker = 1)

# build an animated gif, saving every 10th frame
@gif for i=1:n
    dx = σ*(y - x)     ; x += dt * dx
    dy = x*(ρ - z) - y ; y += dt * dy
    dz = x*y - β*z     ; z += dt * dz
    push!(plt, x, y, z)
end every 10

Thanks for your time

Yes, you need ffmpeg, in Ubuntu you can just sudo apt-get install ffmpeg.

1 Like

Thanks !
As for windows ? I’ve installed it but Julia doesn’t seems to see it. Any idea why ?

Can you run this in the julia REPL

run(`ffmpeg -version`)

(no idea for Windows, google it?)

Perhaps the installer didn’t add the install directory to your PATH? If you run ffmpeg from the CMD console does it run? If you you can edit your PATH environment variable to include the folder with the ffmpeg.exe binary.

You may have to"Plots") again after installing ffmpeg.

1 Like

This give this message
julia> run(ffmpeg -version) ERROR: could not spawn 'ffmpeg -version': no such file or directory (ENOENT) in _jl_spawn at ./process.jl:262

It doesn’t run. How do you edit the Path ? I’ve tried to do so but it still doesn’t work

OK, so I assume that running ffmpeg -version from a console doesn’t work either. Did the installation really go well? On Ubuntu the sudo apt-get install ffmpeg should have just worked. Alternatively, editing the system path @ssfrr mentioned might help.

After building plots I got this message :

ERROR: LoadError: could not spawn `wkhtmltoimage -f png -q --width 600 --height 400 --disable-smart-width /tmp/julia5mfgPr.html /tmp/julia2yPH6Q.png`: no such file or directory (ENOENT)
 in _jl_spawn at ./process.jl:262
while loading /media/.../...//attractor.jl, in expression starting on line 15

It doesn’t work either. As for the sudo apt-get, well I’m not allowed to used it since it’s not my computer, they didn’t give me the rights to do so. But according to Synaptic, ffmpeg is already installed

If ffmpeg is installed you should be able to open a terminal and just run ffmpeg -version. If you can’t then something else is not working. I guess you could install ffmpeg locally and not systenm-wide (from source?), but that seems involved. Hmmm…

I’ve tried to install ffmpeg but all the packages were in conflict with the packages of the version already installed …

And ffmpeg -version is not found

Sorry, you need ffmpeg to create animations using Plots.jl. I think your next best (better) bet is Makie.jl.

I’ll try to fix it later

Thanks a lot for your help !

1 Like

I did it !! Everything work perfectly (under windows at least since I still don’t have the right for Linux)

Thanks a lot guys !


@Sin: How do you fix it under Windows? I have the same problem