Encode an mp4?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

Encode an mp4?

Post by NetherGranite »

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.
User avatar
Link
Prole
Posts: 19
Joined: Tue Jun 19, 2018 4:09 am

Re: Encode an mp4?

Post by Link »

I'm unsure of your goal; to make a video from PNG files try FFMPEG: https://trac.ffmpeg.org/wiki/Slideshow

If you're looking to create a video of gameplay footage, use https://obsproject.com/ to capture your screen & audio while you play.
User avatar
NetherGranite
Prole
Posts: 30
Joined: Wed Jul 11, 2018 11:08 pm

Re: Encode an mp4?

Post by NetherGranite »

Link wrote: Thu Jul 12, 2018 3:49 pm I'm unsure of your goal
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.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Encode an mp4?

Post by pgimeno »

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.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Encode an mp4?

Post by zorg »

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 :3True 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests