Plots.jl: Path issues for animations

Created on 7 Feb 2018  Â·  15Comments  Â·  Source: JuliaPlots/Plots.jl

could not spawn `ffmpeg -v 0 -i /tmp/tmpH4Rh33/%06d.png -vf palettegen=stats_mode=diff -y /tmp/tmpH4Rh33/palette.bmp`: no such file or directory (ENOENT)
_jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at process.jl:360
#373 at process.jl:512 [inlined]
setup_stdio(::Base.##373#374{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:499
#spawn#372(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:511
run(::Cmd) at process.jl:650
#buildanimation#288(::Int64, ::Int64, ::Bool, ::Function, ::String, ::String, ::Bool) at animation.jl:81
#gif#285(::Array{Any,1}, ::Function, ::Plots.Animation, ::String) at animation.jl:63
gif(::Plots.Animation) at animation.jl:63
anonymous at <missing>:?
include_string(::String, ::String, ::Int64) at eval.jl:30
include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N} where N) at eval.jl:34
(::Atom.##100#105{String,Int64,String})() at eval.jl:75
withpath(::Atom.##100#105{String,Int64,String}, ::String) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
hideprompt(::Atom.##99#104{String,Int64,String}) at repl.jl:63
macro expansion at eval.jl:73 [inlined]
(::Atom.##98#103{Dict{String,Any}})() at task.jl:80

I'm getting the same error on Linux and Windows.

could not spawn `ffmpeg -v 0 -i 'C:\Users\Chris\AppData\Local\Temp\jl_B602.tmp/%06d.png' -vf palettegen=stats_mode=diff -y 'C:\Users\Chris\AppData\Local\Temp\jl_B602.tmp/palette.bmp'`: no such file or directory (ENOENT)
_jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at process.jl:360
#376 at process.jl:512 [inlined]
setup_stdio(::Base.##376#377{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:499
#spawn#375(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at process.jl:511
run(::Cmd) at process.jl:650
#buildanimation#288(::Int64, ::Int64, ::Bool, ::Function, ::String, ::String, ::Bool) at animation.jl:81
(::Plots.#kw##buildanimation)(::Array{Any,1}, ::Plots.#buildanimation, ::String, ::String, ::Bool) at <missing>:0
#gif#285(::Array{Any,1}, ::Function, ::Plots.Animation, ::String) at animation.jl:63
(::Plots.#kw##gif)(::Array{Any,1}, ::Plots.#gif, ::Plots.Animation, ::String) at <missing>:0
include_string(::String, ::String) at loading.jl:522
include_string(::String, ::String, ::Int64) at eval.jl:30
include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N} where N) at eval.jl:34
(::Atom.##100#105{String,Int64,String})() at eval.jl:75
withpath(::Atom.##100#105{String,Int64,String}, ::String) at utils.jl:30
withpath(::Function, ::String) at eval.jl:38
didWriteToREPL(::Atom.##99#104{String,Int64,String}) at repl.jl:135
hideprompt(::Atom.##99#104{String,Int64,String}) at repl.jl:69
macro expansion at eval.jl:73 [inlined]
(::Atom.##98#103{Dict{String,Any}})() at task.jl:80

I can confirm that things like C:\Users\Chris\AppData\Local\Temp\jl_B602.tmp/000004.png exist

Most helpful comment

I didn't have ffmpeg installed, so I only
sudo apt install ffmpeg
on Linux and voilá, problem solved!

This had nothing to do with Plots or julia, but it would be nice to add a warning with instructions when this happens, as standard Ubuntu (or at least mine) doesn't install ffmpeg for default.

All 15 comments

Damn! Code?

I assume ffmpeg is in your PATH? (sorry)

The code I was using was this:

https://stackoverflow.com/questions/48652964/using-results-from-odeproblem-while-it-is-running/48654717#48654717

The put ffmpeg in my path on Windows, I assume it installs itself on Linux? I didn't check there.

My student has exactly the same problem on Windows.

This looks similar (julia 0.6.2 on mac):

ERROR: could not spawn ffmpeg -v 0 -i /var/folders/4n/gvbmlhdc8xj973001s6vdyw00000gq/T/tmpPp6o2G/%06d.png -vf palettegen=stats_mode=diff -y /var/folders/4n/gvbmlhdc8xj973001s6vdyw00000gq/T/tmpPp6o2G/palette.bmp: no such file or directory (ENOENT)
Stacktrace:
[1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at ./process.jl:360
[2] #374 at ./process.jl:512 [inlined]
[3] setup_stdio(::Base.##374#375{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:499
[4] #spawn#373(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:511
[5] run(::Cmd) at ./process.jl:650
[6] #buildanimation#288(::Int64, ::Int64, ::Bool, ::Function, ::String, ::String, ::Bool at /Users/anthony/.julia/v0.6/Plots/src/animation.jl:81
[7] #gif#285(::Array{Any,1}, ::Function, ::Plots.Animation, ::String) at /Users/anthony/.julia/v0.6/Plots/src/animation.jl:63
[8] gif(::Plots.Animation) at /Users/anthony/.julia/v0.6/Plots/src/animation.jl:63
[9] macro expansion at /Users/anthony/.julia/v0.6/Plots/src/animation.jl:153 [inlined]
[10] anonymous at ./:?

The code:

using Plots; pyplot()

@gif for j in 1:2
plot(1:10,randn(10))
end every 10

I have the exact same problem on Linux using the very basics:

using Plots

@gif for i=1:10
    plot(rand(10))
end every 1 

and got

could not spawn `ffmpeg -v 0 -i /tmp/tmpchjqGs/%06d.png -vf palettegen=stats_mode=diff -y /tmp/tmpchjqGs/palette.bmp`: no such file or directory (ENOENT)

Stacktrace:
 [1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at ./process.jl:360
 [2] #373 at ./process.jl:512 [inlined]
 [3] setup_stdio(::Base.##373#374{Cmd}, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:499
 [4] #spawn#372(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}) at ./process.jl:511
 [5] run(::Cmd) at ./process.jl:650
 [6] #buildanimation#288(::Int64, ::Int64, ::Bool, ::Function, ::String, ::String, ::Bool) at /home/blaso/.julia/v0.6/Plots/src/animation.jl:81
 [7] #gif#285(::Array{Any,1}, ::Function, ::Plots.Animation, ::String) at /home/blaso/.julia/v0.6/Plots/src/animation.jl:63
 [8] gif(::Plots.Animation) at /home/blaso/.julia/v0.6/Plots/src/animation.jl:63
 [9] macro expansion at /home/blaso/.julia/v0.6/Plots/src/animation.jl:153 [inlined]
 [10] anonymous at ./<missing>:?
 [11] include_string(::String, ::String) at ./loading.jl:515

I, too, can confirm that /tmp/tmpchjqGs/000004.png does exist.

I didn't have ffmpeg installed, so I only
sudo apt install ffmpeg
on Linux and voilá, problem solved!

This had nothing to do with Plots or julia, but it would be nice to add a warning with instructions when this happens, as standard Ubuntu (or at least mine) doesn't install ffmpeg for default.

Thanks blas-k0!

On my mac I did a conda install ffmpeg and that fixed my problem reported above.

Anthony

I was getting this issue as well. I forgot my system deleted a bunch of my programs including ffmpg. I reinstalled as @blas-ko suggested and it works!

Maybe this can be closed now?

I think we should investigate installing ffmpeg as a binary dependency.

I agree.

How do I add ffmpeg into my PATH?

Maybe make a comment about this in the docs? I tried to do this two months ago and just gave up.

// would have been nice to know i was just a brew install ffmpeg away from working animations

Would be good to solve with this: https://github.com/JuliaPlots/Plots.jl/issues/2030

Yes! The videoIO.jl implementation of ffmpeg is actually incredible. I’ve been able to do some awesome things pretty seamless with it.

On Jul 7, 2019, at 4:28 AM, Michael Krabbe Borregaard notifications@github.com wrote:

Would be good to solve with this: #2030

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PallHaraldsson picture PallHaraldsson  Â·  4Comments

nebuta picture nebuta  Â·  3Comments

mkborregaard picture mkborregaard  Â·  3Comments

Cody-G picture Cody-G  Â·  4Comments

dancsi picture dancsi  Â·  4Comments