Is there a way to use love2d to encode mp4s or other video formats, or is the most one could do simply to encode many png files and then use an external program to stitch them into a video? Or is there even a Lua library out there for doing this?

Edit: I realized it was not exactly clear what I meant. I was wondering if there was a way to use love2d to draw each frame, but instead of just outputting each frame to the screen, outputting each frame to a function that would encode it into an mp4 file. In fact, I don't necessarily need a love2d-specific way to do this; I just need a Lua way to do it. Is there a library out there capable of this?

Last edited by NetherGranite on Thu Jul 12, 2018 8:27 pm, edited 1 time in total.

Sorry, I just realized that my question was not clear. I was wondering how one would go about using love2d to draw each frame but instead of merely outputting each frame to the screen, outputting each frame to a function that would encode it into an mp4 file. I have added clarification to it.

LÖVE supports Ogg Theora video decoding, but I don't think it supports any form of video encoding. Saving one image per frame to encode them into a video later sounds like one way to go. Using a video capturing tool that captures from the screen would be another.

If anything, i'd just code my game to be able to save deterministic replays, since that can be done much faster than saving each rendered frame, and one could either export the recreated frames "off-line", as png images and combined together with an external program, like ffmpeg, or one could theoretically include ffmpeg in their project and maybe use FFI to access its functions so it automatically would do that for you.

Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.