Getting mp4 animations from Plots.jl to work in Firefox, Safari, etc.?

We’ve been using Plots.jl to create mp4 animations for Literate.jl examples (they work beautifully together!) but recently noticed that the mp4 animations do not show up in Firefox or Safari but do show up in Chrome.

Example: Two-dimensional turbulence · Oceananigans.jl

It would be a shame to require users to use Chrome to view the examples. We were wondering whether anyone else has come across this problem and if they were able to solve it.

It doesn’t seem to be an issue with any Julia package so not sure it makes sense to open any GitHub issue…


Firefox:
image

Chrome:
image

1436678 - Error when providing HTML5 audio with a base64 encoded Data URI as source probably a bug on Firefox’s end

1 Like

Thanks for pointing out that issue! Hmmm are you sure that’s the right issue though? The screenshots attached in that issue show at least the media player’s control bar. It seems to concern HTML5 audio while Plots.jl should be producing mp4’s with no sound (although Firefox is using an HTML5 media player).

Maybe the “base64 encoded Data URI” part of the issue is a hint? Not sure if Plots.jl lets you control how the mp4 is generated but I’ll try generating a bunch of videos with ffmpeg and see which ones Firefox complains about. Probably not an issue with anything in Julia.

Perhaps you could copy what Makie docs do?

they host the .mp4 somewhere, won’t work if you want to pass around a single .html. so there’s that.