Recording gifs in an Action

I’m exploring if it’s possible to record gifs in a Github Action. My use case is this Github issue, for a creative coding Rust crate called Nannou.

Bascially, examples in Nannou can be displayed visually. It would be helpful if a Github Action could re-record them if their code changes, or if new ones are added, so someone doesn’t have to do the work manually. However, I’m running into some problems while seeing how this might be done. I’m trying to figure out how to record an xfvb buffer, but there aren’t a ton of resources around that.

Does anyone have any other ideas on how to maybe approach this?

Edit: Here is what the example gifs would look like.

If you have a virtual X desktop of any kind, you can use the x11grab input format of ffmpeg to record the screen.

That said, recording the screen seems like a rather complex solution. Does Nannou have any way to render to a file instead of to the screen? Converting a file to the format you need seems like a much simpler solution than screen grabbing.

Hmm this is a good point. I think it would make sense for Nannou to have this rendering functionality (if it doesn’t already; I’m not sure). I’ll try to go down this path first, and then explore x11grab if I need to. I do still wonder if this might be useful for other Actions in any way? I do understand that there would be performance issues though.

Thanks!