FFMPEG error when using @animate in Julia: "Output file #0 does not contain any stream"

I am trying to run the example code at Animations · Plots :

using Plots

@userplot CirclePlot
@recipe function f(cp::CirclePlot)
    x, y, i = cp.args
    n = length(x)
    inds = circshift(1:n, 1 - i)
    linewidth --> range(0, 10, length = n)
    seriesalpha --> range(0, 1, length = n)
    aspect_ratio --> 1
    label --> false
    x[inds], y[inds]
end

n = 150
t = range(0, 2π, length = n)
x = sin.(t)
y = cos.(t)

anim = @animate for i ∈ 1:n
    circleplot(x, y, i)
end
gif(anim, "anim_fps15.gif", fps = 15)

However I am getting the following error:

Output file #0 does not contain any stream
ERROR: failed process: Process(`/Users/smgroves/.julia/artifacts/ab49fb08fb4494ca6d30bd5124515c4b34ca6c9b/bin/ffmpeg -v 16 -i /var/folders/vh/xk34gq593k53lzm7wlyg64xw0000gn/T/jl_d32QSc/%06d.png -vf palettegen=stats_mode=full -y /var/folders/vh/xk34gq593k53lzm7wlyg64xw0000gn/T/jl_d32QSc/palette.bmp`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] (::FFMPEG.var"#4#6"{Cmd})(command_path::String)
    @ FFMPEG ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:112
  [5] (::JLLWrappers.var"#2#3"{FFMPEG.var"#4#6"{Cmd}, String})()
    @ JLLWrappers ~/.julia/packages/JLLWrappers/pG9bm/src/runtime.jl:49
  [6] withenv(::JLLWrappers.var"#2#3"{FFMPEG.var"#4#6"{Cmd}, String}, ::Pair{String, String}, ::Vararg{Pair{String, String}})
    @ Base ./env.jl:197
  [7] withenv_executable_wrapper(f::Function, executable_path::String, PATH::String, LIBPATH::String, adjust_PATH::Bool, adjust_LIBPATH::Bool)
    @ JLLWrappers ~/.julia/packages/JLLWrappers/pG9bm/src/runtime.jl:48
  [8] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:816
  [9] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:813
 [10] #ffmpeg#3
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/executable_generators.jl:22 [inlined]
 [11] ffmpeg
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/executable_generators.jl:19 [inlined]
 [12] #exe#2
    @ ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:111 [inlined]
 [13] exe
    @ ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:105 [inlined]
 [14] ffmpeg_exe
    @ ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:123 [inlined]
 [15] |>
    @ ./operators.jl:907 [inlined]
 [16] buildanimation(anim::Animation, fn::String, is_animated_gif::Bool; fps::Int64, loop::Int64, variable_palette::Bool, verbose::Bool, show_msg::Bool)
    @ Plots ~/.julia/packages/Plots/sxUvK/src/animation.jl:141
 [17] buildanimation (repeats 2 times)
    @ ~/.julia/packages/Plots/sxUvK/src/animation.jl:116 [inlined]
 [18] #gif#300
    @ ~/.julia/packages/Plots/sxUvK/src/animation.jl:91 [inlined]
 [19] top-level scope
    @ ~/Documents/test_movie.jl:36

I have seen similar problems with FFMPEG but they all seem to suggest changes to the FFMPEG command outside of Julia, and I’m not sure why it doesn’t seem to be working when run from Julia directly. I have tried installing VideoIO and FFMPEG julia packages, but I still get the same error. I am pretty new to Julia so any help would be appreciated!

Your script runs successfully and produces an animated image on my computer.

Can you provide more information about your system and environment?

julia> versioninfo()
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 9950X 16-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, generic)
Threads: 32 default, 0 interactive, 16 GC (on 32 virtual cores)
Environment:
  JULIA_NUM_THREADS = auto
  JULIA_REVISE_INCLUDE = 1

(jl_AUQf1i) pkg> st
Status `/tmp/jl_AUQf1i/Project.toml`
  [91a5bcdd] Plots v1.40.9

Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 16 × Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 
  DYLD_FALLBACK_LIBRARY_PATH = /Users/smgroves/.julia/artifacts/0233bb40b298b03aa3743cc339b4a5c6816ce583/lib:/Users/smgroves/.julia/artifacts/1e901863cf8fbb1ee50a5d0976114a2371899331/lib:/Users/smgroves/.julia/artifacts/dcc1b7719d5a106fba77bbc272d231e163d15fe5/lib:/Users/smgroves/Documents/julia-1.9.2/lib/julia:/Users/smgroves/.julia/artifacts/24f5f98997d22643d93c4f77ffd202ea7630d311/lib:/Users/smgroves/.julia/artifacts/397fee52d94fc3404c3e466a6a8277ad9fdde715/lib:/Users/smgroves/.julia/artifacts/b906f57a353cdf9fb0dee51c8667e370b2bed6da/lib:/Users/smgroves/.julia/artifacts/ffdee4f2c5c1a970450976825cd6df5b97916b5d/lib:/Users/smgroves/.julia/artifacts/01634e770ae64009bdfef5564794522bc669be47/lib:/Users/smgroves/.julia/artifacts/e1474d1af4a4242b4718049e5e5e8cc4f1946bee/lib:/Users/smgroves/.julia/artifacts/d2c0cecc02276383892768bc0805601d0533b60d/lib:/Users/smgroves/.julia/artifacts/4ef31a32cc88f589244c86dd5d6ea49b901b1a41/lib:/Users/smgroves/.julia/artifacts/2b17f8eb5c0167b92ee1ef185a98606e9d27b75e/lib:/Users/smgroves/.julia/artifacts/962c970ed3b6520e774fd8c1d1f916dbf9318a29/lib:/Users/smgroves/.julia/artifacts/283f882df6f27091e6ecd8ef992ae9fecc7639dd/lib:/Users/smgroves/.julia/artifacts/fb5ebcbea6d2f03cf79fe1bf6aa237f4929b1d2d/lib:/Users/smgroves/.julia/artifacts/3a10d140fdfe84ac9bebb570319e9d173d5c7e6c/lib:/Users/smgroves/.julia/artifacts/f9f9209aaba179c03a71fa49432487fbe41daac8/lib:/Users/smgroves/.julia/artifacts/d4387ba5551f47f3733c2b041a7745c29b35c26e/lib:/Users/smgroves/.julia/artifacts/28fdb61e5a3f030b889e7d2a0f490c28fdca6edb/lib:/Users/smgroves/.julia/artifacts/13d72f9c10469b24ae6ed7dd1a3b2ab5338ae2ab/lib:/Users/smgroves/.julia/artifacts/572714f8bb8cb23efde4bcd230b638bc3cd7ef00/lib:/Users/smgroves/.julia/artifacts/ea0d780d1d257836385747da7db21967d7450bdc/lib:/Users/smgroves/.julia/artifacts/966098580a6feebc43e729bf20dbb97848be4663/lib:/Users/smgroves/.julia/artifacts/bbb69711f9eab313bab4f202da8fbae8c1914a96/lib:/Users/smgroves/.julia/artifacts/f67573d1693f31bfa9f8ab1d946194475fafe454/lib:/Users/smgroves/.julia/artifacts/a50227ae6f693d36e10f6515b7b5d601791f2d20/lib:/Users/smgroves/.julia/artifacts/ab49fb08fb4494ca6d30bd5124515c4b34ca6c9b/lib:/Users/smgroves/.julia/artifacts/edff4ea07b16998e8b6a86b1fdbdefb6d01e4980/lib:/Users/smgroves/.julia/artifacts/60b6e54f05c35fd3fb7fad2255501d7769bc963c/lib:/Users/smgroves/.julia/artifacts/d3f66a1beb37e7d6778ecff998c64c2807d19c9f/lib:/Users/smgroves/.julia/artifacts/420fc8fcf6f318e7c8ea117a4e462931d7192a97/lib:/Users/smgroves/.julia/artifacts/13bcf03d39cbfba45f7c6a33ad0b6d990f927ae5/lib:/Users/smgroves/.julia/artifacts/20ac6b26294e1f68a703d5d75d1364ce3ec14c2d/lib:/Users/smgroves/.julia/artifacts/912eff7e041876f3994e732ccdfe3cd44b7664e2/lib:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtConcurrent.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtCore.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtDBus.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtGui.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtNetwork.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtOpenGL.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtPrintSupport.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtSql.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtTest.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtWidgets.framework/Versions/A:/Users/smgroves/.julia/artifacts/ad6d90720961deee1ccd3b65a3695c856b32595a/lib/QtXml.framework/Versions/A:/Users/smgroves/.julia/artifacts/d9bcd57b8aec083a17e5ed7efd1ea8c723618613/lib:/Users/smgroves/Documents/julia-1.9.2/bin/../lib/julia:/Users/smgroves/Documents/julia-1.9.2/bin/../lib:
  JULIA_IMAGE_THREADS = 1
Status `~/.julia/environments/v1.9/Project.toml`
⌃ [6e4b80f9] BenchmarkTools v1.5.0
⌃ [336ed68f] CSV v0.10.14
⌃ [a93c6f00] DataFrames v1.6.1
⌃ [31c24e10] Distributions v0.25.111
  [c87230d0] FFMPEG v0.4.2
⌃ [7a1cc6ca] FFTW v1.8.0
⌅ [28b8d3ca] GR v0.72.10
  [c27321d9] Glob v1.3.1
⌃ [b964fa9f] LaTeXStrings v1.3.1
  [420e96ae] Parula v0.1.0 `https://github.com/RobBlackwell/Parula.jl#master`
⌃ [91a5bcdd] Plots v1.39.0
⌅ [c3e4b0f8] Pluto v0.19.27
⌃ [7f904dfe] PlutoUI v0.7.59
⌅ [c46f51b8] ProfileView v1.7.2
⌃ [274fc56d] PythonPlot v1.0.3
⌃ [90137ffa] StaticArrays v1.9.3
⌃ [bd369af6] Tables v1.11.1
  [d6d074c3] VideoIO v1.1.1
Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`

Try upgrading the packages in your environment (] up in the REPL), Plots is a few versions old.

Although it is unlikely to be your problem, it is also worth upgrading to at least Julia 1.9.4 and preferably to the LTS release which is currently 1.10.8.

If neither of those changes anything, then this may be a problem specific to macOS, hopefully someone more familiar with that environment can provide more insight.

Thank you for your help. I ended up updating the packages and julia version, and then Julia became incompatible with my mac OS version (which I’ve been meaning to upgrade from 10.15, since the newest mac OS is 15!). I updated the OS and it seems like it worked. Thanks!