opensim-creator icon indicating copy to clipboard operation
opensim-creator copied to clipboard

Add the ability to record video files from simulations

Open adamkewley opened this issue 3 years ago • 2 comments

Estimate: 4-7d (assuming recording the states etc. is already sorted and the user doesn't want fancy recording options)

This is a stub issue for implementing simulation recording.

High-level overview:

  • Find a basic, easy to compile from source, C/C++ library for video encoding to webm or one of the MPEG implementations
  • Add button into simulation UI to "record this simulation to a video" that collects up all of the (evenly-spaced) SimTK::States from the simulator into video frames
  • Perform any relevant fixups for video recording (resolution, aspect ratio, interpolating SimTK::States to align with the video framerate)
  • Render each frame to a render buffer/texture and read the pixels onto the CPU, use the video encoder to encode the frame bitmaps into a video stream
  • Prompt for save locations, implement other UX features like a saving bar, progress, etc. etc.

The encoder does not need to be high-perf, only "good enough" to provide the feature. It's preferred to use smaller libraries that OSC can build from source on all target platforms, rather than larger encoding libraries that are a complete PITA to build + integrate (looking at you, FFMPEG...)

adamkewley avatar Jan 27 '22 15:01 adamkewley