Animation error Makie

I downloaded Makie and I tried to run one of the given example:

using Makie

 xyvec = rand(Point2f0, (2)) .* 5 .+ 1
 velvec = rand(Point2f0, (2)) .* 10
 # define some other parameters
 t = 0
 ts = 0.03
 balldiameter = 1
 origin = Point2f0(0, 0)
 xybounds = Point2f0(10, 10)
 N = 200
 scene = scatter(
     markersize = balldiameter,
     color = rand(RGBf0, 2),
     limits = FRect(0, 0, xybounds)
 s = scene[end] # last plot in scene

 record(scene, "pong.mp4", 1:N) do i
     # calculate new ball position
     global t = t + ts
     global xyvec = xyvec .+ velvec .* ts
     global velvec = map(xyvec, xybounds, origin, velvec) do p, b, o, vel
         boolvec = ((p .+ balldiameter/2) .> b) .| ((p .- balldiameter/2) .< o)
         velvec = map(boolvec, vel) do b, v
             b ? -v : v
     # plot
     s[1] = xyvec

This animation plays but at the end I get the following error:

ERROR: LoadError: failed process: Process(`ffmpeg -loglevel quiet -i '/var/folders/fn/h4l89fwx2sgdfscp5rt05cbm0000gn/T/tmpt6c6Hl/##video#369.mkv' -c:v libx264 -preset slow -crf 24 -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k -y pong.mp4`, ProcessExited(1)) [1]

The issue is from the function record(). Running ]test Makie, I have a similar error when it tries to use record. Any idea on how to fix this ? (I did not find this issue anywhere else)

Thank you for your suggestions!

Do you have ffmpeg?

1 Like

No I do not… I assumed the installation would do everything for me.
I am downloading it right now! Thank you very much.

Very understandable, but it turns out to be tricky to have ffmpeg as a binary dependency

Oh ok.
So I did install ffmpeg (then moved the folder to my User folder). The command ]test Makie still fails:

LoadError: failed process: Process(`ffmpeg -loglevel quiet -i '/var/folders/fn/h4l89fwx2sgdfscp5rt05cbm0000gn/T/tmpybAg97/##video#371.mkv' -c:v libx264 -preset slow -crf 24 -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k -y ./media/interaction.mp4`, ProcessExited(1)) [1]

Then, I added in my bash_profile file the following line

# Setting PATH for ffmpeg
export PATH="/ffmpeg-4.1/:${PATH}"

It did not help, so I used push!(LOAD_PATH,"/Users/Olivier/ffmpeg-4.1") but no luck. Would you happen to know why Makie does not see ffmpeg ?

No but I saw someone else with this problem. @sdanisch probably knows.

Ok thank you. I will message him then :slightly_smiling_face:

It’s normally preferred not to message the package developer directly - he’ll most likely see this when he visits Discourse in his own time :slight_smile:

1 Like

Ah! I already sent a message through Julia discourse… Well I will know for next time at least! Thank you.

Good evening, I just want to post an update on the situation.
I kept looking and trying different things but none of my attempt have been successful (mainly adding path and reinstalling using conda instead of brew).

Julia seems to find ffmpeg since if I use the shell and type ffmpeg, the REPL returns something.
Also (not sure if it indicates anything) but animations with Plots seem to work just fine.
At this point all I can think of is either:

  • there is a specific version of ffmpeg compatible with Makie. But that would have been written somewhere so I doubt it.
  • I messed up somewhere, or I just really don’t understand what adding a path for Julia mean. This is definitely more likely.

Anyways, if anyone has some thoughts I’d be glad to hear them!

I had the same issue and a simple installation of ffmpeg is probably missing some additional dependencies/libraries that are required in

ffmpeg -loglevel quiet -i filename.mkv -c:v libx264 -preset slow -crf 24 -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k -y filename.mp4

Try to run directly the above command on some examples (outside Julia) and see the error message you get to understand what you are missing (Makie hides error messages). I found this guide useful

I ran the command you wrote on my Terminal and I had no error message. I will check the guide in any case, thanks!

My mistake, you need to erase “-loglevel quiet” to get errors displayed. Anyway, to test the command you also need a mkv file to convert (you can use the one generated by Makie, in the error message it says in which folder you can find it).

Alright, so I have been doing a lot of attempts and it seems that ffmpeg with fdk-aac works.
However, I do have the libx264 and libvo_aacenc unknown (I guess I must add them the same way I did for fdk-aac). Are they required by Makie ? Also the option ‘preset’ and ‘cry’ are not recognized.

Moreover, it turns out I have the following message on Julia:

ERROR: Unsatisfiable requirements detected for package ModernGL [66fc600b]:
 ModernGL [66fc600b] log:
 ├─possible versions are: [0.0.1-0.0.8, 0.1.0-0.1.1, 0.2.0-0.2.1, 1.0.0, 1.1.0] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.8, 0.1.0-0.1.1, 0.2.0-0.2.1, 1.0.0, 1.1.0]
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

So I deleted Makie to reinstall it but it fails with the same error message… I assume that this is just a coincidence that it happened right after the ffmpeg configuration.

I finally have some time to close this discussion. I do not know if it is obvious for everyone, but after a couple of attempts on how to configure ffmpeg the following configuration worked properly with Makie:

configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1 --enable-libx264 --enable-gpl --enable-libvorbis --enable-libfdk-aac --enable-nonfree

The simplest for the installation is to do something in the spirit of

brew install --with-libx264 --with-gpl --with-libvorbis --with-libfdk-aac --with-nonfree.

Thank you for the helpful comments :slightly_smiling_face:.

With Makie switching to a BinaryBuilder-provided FFMPEG, this should no longer be an issue.