Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it a stateless/pure/functional component #3

Open
mifi opened this issue Apr 22, 2020 · 3 comments
Open

Make it a stateless/pure/functional component #3

mifi opened this issue Apr 22, 2020 · 3 comments
Labels
enhancement New feature or request epic A big rewrite

Comments

@mifi
Copy link
Owner

mifi commented Apr 22, 2020

Look into making it completely functional/stateless:

getFrame(frameNum, parameters) -> calculates transitions and everything to return a calculated frame

This 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

@mifi mifi added enhancement New feature or request epic A big rewrite labels Apr 22, 2020
@mifi
Copy link
Owner Author

mifi commented Sep 23, 2020

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:

editly/index.js

Line 436 in ccd42cc

while (true) {

@mifi mifi changed the title Make it a stateless functional component Make it a stateless/pure/functional component Sep 24, 2020
@mifi
Copy link
Owner Author

mifi commented Sep 24, 2020

I made a function

editly/index.js

Line 372 in fc2cb57

async function renderSingleFrame({

...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:

  • Must merge the previously mentioned stateless branch for videos to work.
  • renderSingleFrame does not render correctly in transitions (it will just render one clip or the other)

@mifi
Copy link
Owner Author

mifi commented Mar 3, 2021

Wow I just found this project which does exactly this: https://www.remotion.dev/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic A big rewrite
Projects
None yet
Development

No branches or pull requests

1 participant