Open mifi opened 4 years ago
I made a working statelessMode
for the video frame source in https://github.com/mifi/editly/tree/stateless
However the hard part is to convert the main loop and its logic and state into a pure stateless function: https://github.com/mifi/editly/blob/ccd42cc2daa236114b288c44a35382b048ac720c/index.js#L436
I made a function https://github.com/mifi/editly/blob/fc2cb572fe9e2afc4e533537927d23379967d207/index.js#L372
...which will render a single frame at the specified time to a PNG. Useful for testing and could be useful in the future.
Example: renderSingleFrame.js
TODO:
renderSingleFrame
does not render correctly in transitions (it will just render one clip or the other)Wow I just found this project which does exactly this: https://www.remotion.dev/
Look into making it completely functional/stateless:
getFrame(frameNum, parameters)
-> calculates transitions and everything to return a calculated frameThis allows for making a GUI with seeking to any random frame
Must have workaround for non-seekable streams like ffmpeg pipe
Also cache low resolution/low framerate version of each input video cut so we can render preview faster