Nannou: Passing frames into a video encoder

Created on 1 Apr 2020  路  2Comments  路  Source: nannou-org/nannou

Hi :wave:, awesome project.

I am a total newbie to graphics rendering and was wondering what the nicest path to passing the frames rendered in the window into a video encoder so they can be recorded. I've seen the capture_frame part of the window API, is that the way to go?

Currently I'm trying to just use OBS to record the window but I can't do that and render at full speed.

TIA! :)

question

Most helpful comment

Keep in mind that if capturing an animation, you might like to use the current frame number as your source of time rather than app.time for a more precise result, e.g. let t = frame.nth() / 60.0; for a smooth 60 FPS sequence.

Yup. That was the plan!

Hmmm it would be nice if we had a tutorial for this in the guide, and maybe an example of automating the process by calling out to ffmpeg.

I'll have a go and if I have some success I'll make a PR.

All 2 comments

Thanks @alexmorley!

Yes exactly, capture_frame is your best bet. See examples/draw/draw_capture.rs for a demonstration of how to use it to record an image sequence. Once you have your image sequence, I'd recommend using ffmpeg to convert it from a sequence to whichever format you desire.

Keep in mind that if capturing an animation, you might like to use the current frame number as your source of time rather than app.time for a more precise result, e.g. let t = frame.nth() / 60.0; for a smooth 60 FPS sequence.

Hmmm it would be nice if we had a tutorial for this in the guide, and maybe an example of automating the process by calling out to ffmpeg.

Anyway, hope this helps!

Keep in mind that if capturing an animation, you might like to use the current frame number as your source of time rather than app.time for a more precise result, e.g. let t = frame.nth() / 60.0; for a smooth 60 FPS sequence.

Yup. That was the plan!

Hmmm it would be nice if we had a tutorial for this in the guide, and maybe an example of automating the process by calling out to ffmpeg.

I'll have a go and if I have some success I'll make a PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mkesper picture mkesper  路  4Comments

capogreco picture capogreco  路  4Comments

jtnimoy picture jtnimoy  路  3Comments

lewislepton picture lewislepton  路  6Comments

batchku picture batchku  路  3Comments