JuliaTeX / PGFPlots.jl

This library uses the LaTeX package pgfplots to produce plots.
Other
188 stars 36 forks source link

Animate using Reel: Decoder (codec svg) not found for input stream #134

Open raunakbh92 opened 4 years ago

raunakbh92 commented 4 years ago

I tried to run the animation example provided in the tutorial. However, ran into the following error.

(v1.3) pkg> st
    Status `~/.julia/environments/v1.3/Project.toml`
  [3b7a836e] PGFPlots v3.2.1
  [71555da5] Reel v1.3.0
julia> using PGFPlots
[ Info: Precompiling PGFPlots [3b7a836e-365b-5785-a47d-02c71176b4aa]

julia> using Reel
[ Info: Precompiling Reel [71555da5-176e-5e73-a222-aebc6c6e4f2f]

julia> Reel.extension(m::MIME"image/svg+xml") = "svg"

julia> frames = Frames(MIME("image/svg+xml"), fps=10)
Frames{MIME{Symbol("image/svg+xml")}}("/tmp/jl_t4K0iF", 0x0000000000000000, 10.0, nothing)

julia> for frame in 1:10
           t = frame/5
           ax = Axis(Plots.Linear(x -> sin(x+t*π), (0,6)), xlabel="x", ylabel="y")
           push!(frames, ax)
       end
julia> write("output.gif",frames)
Decoder (codec svg) not found for input stream #0:0
ERROR: failed process: Process(`/home/raunakbh/.julia/packages/FFMPEG/guN1x/deps/usr/bin/ffmpeg -y -r 10.0 -f image2 -i /tmp/jl_t4K0iF/%d.svg yo.gif -loglevel error`, ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error at ./process.jl:525 [inlined]
 [2] #run#565(::Bool, ::typeof(run), ::Cmd) at ./process.jl:440
 [3] run at ./process.jl:438 [inlined]
 [4] #4 at /home/raunakbh/.julia/packages/FFMPEG/guN1x/src/FFMPEG.jl:133 [inlined]
 [5] withenv(::FFMPEG.var"#4#6"{String,Cmd}, ::Pair{String,String}) at ./env.jl:161
 [6] #exe#2 at /home/raunakbh/.julia/packages/FFMPEG/guN1x/src/FFMPEG.jl:132 [inlined]
 [7] #exe at ./none:0 [inlined]
 [8] ffmpeg_exe at /home/raunakbh/.julia/packages/FFMPEG/guN1x/src/FFMPEG.jl:144 [inlined]
 [9] #write#6 at /home/raunakbh/.julia/packages/Reel/Mu9ck/src/Reel.jl:68 [inlined]
 [10] write(::String, ::Frames{MIME{Symbol("image/svg+xml")}}) at /home/raunakbh/.julia/packages/Reel/Mu9ck/src/Reel.jl:66
 [11] top-level scope at REPL[8]:1

I see on the Reel.jl page that some recent changes have taken place in terms of dependency on FFMPEG.jl. Could that be the potential cause here?

mykelk commented 4 years ago

I think @MaximeBouton might have some ideas.

MaximeBouton commented 4 years ago

I think FFMPEG needs a flag when compiled to support svg: https://stackoverflow.com/questions/48216871/ffmpeg-support-for-svg-rasterization

Here is the build recipe for FFMPEG.jl: https://github.com/JuliaPackaging/Yggdrasil/blob/master/F/FFMPEG/build_tarballs.jl#L69 the svg flag is not there.

You could:

The example would work with an older version of Reel.jl (v1.1) that is using ImageMagick for gifs instead of ffmpeg.

raunakbh92 commented 4 years ago

Reverted Reel to v1.1.1 and tried rerunning the animation script from the tutorial. While the animation shows up fine, the axes labels don't show up. Wondering what could be causing that? output