Show HN: Revideo – Create Videos with Code (github.com)

298 points by hkonsti ↗ HN
Hey HN! We’re building Revideo (https://github.com/redotvideo/revideo), an open source framework for programmatic video editing.

Revideo lets you create video templates in Typescript and render them with dynamic inputs through an API. It also comes with a <Player /> component that lets you preview your projects in the browser and integrate video editing functionality into web apps.

The project is useful for anyone who wants to build apps that automate certain video editing tasks. A lot of companies in the space build their own custom stack for this, like Opus (https://www.opus.pro/), which automatically creates highlight videos from podcasts, or Clueso (https://www.clueso.io/), which lets you create stutter-free product walkthroughs with AI voiceovers.

Revideo is based on the HTML Canvas API and is forked from Motion Canvas (https://github.com/motion-canvas/motion-canvas), a tool that lets you create canvas animations. While Motion Canvas is intended by its maintainer to exclusively be a standalone application [1], we have turned Revideo into a library that developers can integrate into their apps, while specifically focusing on video use cases. To support this, we have, among other things, added the ability to do headless rendering, made video rendering much faster and added support for syncing and exporting audio.

We’re excited about programmatic video editing because of the possibility to automate content creation with AI. One of our users is building StoriesByAngris (https://storiesbyangris.com/), which lets you create video-based RPG stories from language prompts. Other users are marketing-tech companies that help their customers generate and A/B test different versions of video ads.

We started to work on video tooling because we ourselves explored a bunch of product ideas in the space of AI-based video creation earlier this year. For example, we built apps that automatically create educational short videos and tinkered with apps that let you create memes.

While building these products, we were frustrated with the video editing frameworks we used: Moviepy (https://github.com/Zulko/moviepy), which we used initially, doesn’t work in the browser, so we’d often have to wait minutes for a video to render just to test our code changes. Remotion (https://github.com/remotion-dev/remotion), which we switched to later, is pretty good, but we didn’t want to rely on it as it is not FOSS (source-available only).

We had already followed Motion Canvas for some time and really liked it, so we thought that extending it would get us to something useful much faster than building an animation library from scratch. We initially tried to build Revideo as a set of Motion Canvas plugins, but we soon realized that the changes we were making were too drastic and far too complex to fit into plugins. This is why we ultimately created a fork. We’re unsure if this is the right way to go in the long term, and would prefer to find a way to build Revideo without feeling like we’re dividing the community - if you have experience with this (keeping forks with complex changes in sync with upstream) or other suggestions on how to solve this, we’d love your input.

Our current focus is improving the open source project. In the long term, we want to make money by building a rendering service for developers building apps with Revideo.

We’d love to hear your feedback and suggestions on what we can improv...

80 comments

[ 2.3 ms ] story [ 264 ms ] thread
I see that Revideo uses generator functions which seems intuitive to me as it linearizes frame sequences wrt time as the function yields.

How does this compare to Remotion^ which uses "React" mental model?

^: https://remotion.dev

Yes, exactly! We're also big fans of the generator function model. In Remotion, you get the current frame of the animation through a React hook called useCurrentFrame(). You then use React to build the UI based on the return value of the hook. By structuring it as a generator function, later parts of the function are for later parts of the animation, which makes it a bit easier to read and write. We found this to be a little more intuitive. Ultimately it probably comes down to personal preference.
(comment deleted)
python support?
This is unfortunately not something that is currently on the roadmap. Revideo mainly runs inside the browser which is why we built it entirely in Typescript. You can check out moviepy (https://github.com/Zulko/moviepy) for a similar project written in Python.
Interesting—LangChain seemed kinda like unnecessary abstractions in natural language (since everything is just string manipulations), but with AI video, there's so many different abstractions that I'd need to handle (images, puppeting, facegen, voicegen, etc).

Seems like there might be room for a "LangChain for Video" in this space...

I agree! We were definitely motivated by the emergence of AI tools for video when building Revideo - as mentioned in the post, we think that a lot of video creation can be automated using AI. Currently, there are probably some higher-priority challenges related to the core rendering library that we need to solve, but we’ve definitely already thought about building a universal client library for common AI services that are useful for generating videos (e.g. text-to-speech, text-to-image, text-to-video)
Is this like langchain but for video?
The main use case is not necessarily about AI, but about putting all sorts of assets together into a video. However, we definitely see a lot of people using AI-generated voices and images/videos for their videos, which we think is really cool. We will probably integrate these APIs more into Revideo in the future.
Very cool! I assume it uses WebCodec VideoEncoder to encode in browser, maybe with a wasm ffmpeg fallback? How reliable/easy to use have you found that?
Encoding the video in the browser is on the roadmap, but currently we stream the frames one by one to an ffmpeg backend process and concatenate them into a video there. This has been very reliable and fast so far. I've only just started looking at WebCodec, but it seems to be more challenging, especially as most of the APIs aren't supported by some of the mainstream browsers, so as you said, some fallback will be necessary.
Looks promising - I've been using Shotstack's visual editor to create video templates but keep running into limitations. Looks like Revideo has an "editor" that allows previews but not edits? Is editing through the GUI on the roadmap?
Thanks for the feedback! Justus here, I am one of the co-creators of Revideo. Initially, we intended Revideo to be a developer tool and not necessarily something that could be modified through a user interface. However, we've heard this feedback many times at this point, so we're definitely considering building editing capabilities into the UI. One challenge here is to find a way to keep the UI changes and the code in sync.
>> I've been using Shotstack's visual editor to create video templates but keep running into limitations

What limitations are you hitting?

What’s your functionality wishlist?

I have used Revideo for a personal project and I really like what you're doing.
Thanks a lot! Really glad to hear this feedback :)
Are there commercial use cases for this?
Certainly! You can pretty much build full video editors with Revideo. There are many companies with video-editing at the core of their product that could have been built with us (think veed.io, invideo.io or the editor part of www.synthesia.io). We're thinking about building a template in this direction so people have a starting point when building these kinds of apps. In terms of video automation, we've seen people build apps for marketing and enterprise learning. One marketing tech company uses Revideo to generate video ads from their customers product catalogue.
How is this different to / better than remotion.dev?
Revideo is different to Remotion.dev in a couple of ways:

First, we use generator functions to describe the flow of animations - every yield within the generator function corresponds to a frame in the video. As a result, our API feels quite "procedural" (animations described at the start of the function appear in the start of the video, animations described at the end appear at the end). Remotion's React-based approach is rather declarative - it gives you a frame number and lets you describe what your video should look like as a function of the frame number. Personally, we find our "procedural" API a bit more intuitive and easier to write than the declarative approach, but we might obviously be biased here.

Secondly, we render to the HTML canvas instead of the DOM. Both have advantages and disadvantages: Rendering to the DOM lets you define animations using CSS, which most programmers are already familiar with. On the other hand, an advantage of using the HTML canvas is that it should allow you to render entirely in the browser rather than using server-side rendering, as you can simply capture the current canvas using canvas.toBlob(). We have not yet implemented this for Revideo, but people in our Discord server have made good progress towards it.

Thirdly, we're MIT licensed while Remotion is not FOSS (if your company has more than three employees, you need to purchase a company license to use Remotion). As described in the post, this was one of our original motivations to build our own video editing framework while we were building video products.

I built a large remotion powered video generation pipeline for a major AI video company and one of the major challenges was cost of generating a video. 1 instance of Remotion at best generates 1-2 fullhd frame per second on server and that turns out to be quite expensive for slightly larger videos. From my benchmarking, taking screenshots was the slowest part of their pipeline. Any sense on how many frames revideo can generate. Since you could do canvas.toBlob, I am wondering if it's faster.
It really depends on the complexity of the scene. We're only getting started on optimizing rendering and I'm convinced that we can get it to be significantly more performant/cheaper than Remotion. Right now we're faster in some cases and slightly slower in others. Feel free to contact me at konsti at re.video. I would love to understand your use-case and see if and how we could help you.
Just curious, are you the founders of https://haven.run (YC S23)? I noticed that the Linkedin company page now redirects to Revideo.

Would you mind sharing a bit about your pivot? I always find these stories interesting!

Yes, that's us! We started out in the open source LLM space, but realized that most companies didn't really have any real use cases for custom fine-tuned LLMs. Maybe we were too early, but everyone we talked to was best served by just using OpenAI. Late last year, we started looking at other areas and became fascinated with AI-generated social media content, which sent us down a rabbit hole that led us to build Revideo. It's been a very long and painful process, but we now have a lot of really cool and smart users building really useful stuff, which is something we haven't experienced with any of our previous pivots.
Removed - conversation tone not right.
no worries at all - I appreciate the feedback. Out of curiosity, what makes you think this is a tarpit idea? I roughly understand the term as "ideas that seem obvious and easy, but have non-obvious problems".

Ideally, we would like Revideo to be used to build any kind of web-based video editor. A lot of video editors exist, and many of them make a lot of money. Based on my experience, building a video editor from scratch is also really hard - I would think that people would choose a framework that makes it easy to build them if it exists.

My biggest worry is more about the technical difficulty of the problem (becoming the standard way to build a category of products is probably not easy), rather than this being an actual problem. I'd love to hear your opinion though!

(comment deleted)
How does this compare to VapourSynth or AviSynth?
Hey! I'm not really familiar with either one so take this with a grain of salt. On the first glance, it doesn't seem like these projects are designed to be run in the browser. We're mainly focussing on the use-case of using Revideo as a part of web-apps (we're building on top of the HTML canvas API which makes it really easy to preview instantly). There might be some use-cases where a lower level implementation is more suitable.
Really nice - need to try it with a few hobby use cases.
Thank you! Would love to hear your feedback when you give it a try :)
How does this compare to MoviePy beyond the JSX like syntax and being JS?
The fact that it is JS actually implies more than just being written in a different language. You can ship Revideo as part of your website and run it inside the browser. One of the reasons we struggled with Moviepy was that we couldn't preview our changes in real-time which made the dev-experience a little tedious.
This is really cool, I love this sort of thing.
Thank you! Love to hear it :)
Congrats on the launch! I work at Sieve (https://www.sievedata.com/). We do a bunch of stuff with AI and video. Excited to check this out :)
Hi Mokshith, we talked about releasing a project using the Sieve API and Revideo before! This is definitely something we still want to do. I'll reach out!
Interesting stuff! Which use cases do you think developers will use you most for?

There could be really interesting abstractions that people might build on top of this. Like automatically creating and animating infographics, making background sounds, or video cutting and recycling. If you spin this 100x further an entire video creation studio might emerge.

Which parts of Video Infrastructure do you want to build first? Which other higher-level parts could be built by you or users? Where could this go?

Thank you! As of now, many people use Revideo to programatically create Youtube videos (primarily entertainment content, think of AI generated memes and Youtube Shorts) and for use cases in video marketing (think automatically generating and A/B testing ads from a product portfolio). As the project becomes more mature and better, we want to enable developers to build more complex, and especially interactive video editors using the framework.

I'm glad you raise the point of reusability and people building abstractions - what I find really exciting about code as an interface for video editing (rather than GUI) is that it makes it much easier to create and share isolated, reusable components and functions. Especially as we are open source, I hope that many developers will build abstractions and share them on Github

Out of curiosity, what do you mean by "Video Creation Studio"? Would you add a visual interface for editing to Revideo?

Maybe not for editing per se. But for providing meta-functionalities to services built on top of revideo. Rendering, for instance, but maybe even reusable embeds, video watch analytics, download links, programatic re-rendering with webhooks and their configuration, etc. What other functionalities could you offer?
I think you already mentioned a few interesting ideas. Ultimately, we'll just build what our users want and see from there.
How does Jacob (aarthificial, creator of motion-canvas) feel about this? Will you compensate or include him in some way? I understand the license is MIT so you can do what you want. Just seems like it would be polite to maintain a good relationship with him and other motion-canvas maintainers.
We tried to reach out to Jacob but unfortunately didn't get a response from him. In general, Revideo and Motion Canvas have very different goals and we were very reluctant to go the route of forking his work. We are always open to contribute changes back into Motion Canvas if that is wanted, so far we haven't seen that to be the case.
You mention in your README that you had to fork it in order to make it so you could trigger renders programatically instead of having to click a button. Couldn't you have just used render from the core lib directly?

https://motioncanvas.io/api/core/app/Renderer#render

You can use the render function from motion canvas to trigger headless renders (which is what we do!) without forking the project.

However, this is not the only change we made. Our goal is (as stated in the Readme) to enable developers to build entire video editing apps with Revideo. This encompasses a few more things than just triggering headless renders. For example, here are some of the changes we made that were quite drastic and were not possible without forking:

- we export the audio of <Video/> elements in a scene. Enabling this required us to modify parts of the core package: https://github.com/redotvideo/revideo/commit/d0f72b6df68b380...

- we made video-in-video renders a lot faster by requesting video frames from a backend process rather than seeking video frames using the HTMLVideoElement API. This required us to make all draw() functions in Motion Canvas async: https://github.com/redotvideo/revideo/commit/a6e1bcdf0ca8200...

Does it work with vue/vite? I am really hoping someone will make such a solution some day.
So far, we only have a prebuilt Player component for React, but it is definitely possible to integrate Revideo into a Vue project with a bit of hacking. I'd love to better understand your requirements and help you get started. I already did this for React so porting this over to another framework like Vue should be straight forward - feel free to message me in our Discord server (invite link is in our repository) or email me at konsti at re.video.
This looks like lots of fun.

I’ve only skimmed the docs and nothing jumped out on this: would it be possible to use a 3d canvas context? For example, integrate a dynamic three.js layer/asset into the video?

Looks like a cool tool. Will play around a bit, thanks for sharing!
That's so cool!!!Thanks for your wonderful job!
This looks very cool! I have built a project using remotion to bake in subtitles with some effects to a video from a .srt file, but this approach looks nicer and FOSS is amazing so I'll have a go at porting it. Thanks!
Thank you! If you have any questions or run into issues, please let us know! You can find out Discord server in our repo or can email me at justus at re.video
(comment deleted)
I can't be the only one that has assumed an affiliation with Retool based on the "Re-" prefix and similar logo, even though there doesn't seem to be any.
Justus here, I'm one of the co-creators of Revideo. I agree that there's a high similarity. We unfortunately only noticed this a few weeks after launching - our logo was inspired by the tracks you see in video editors.

Given that we are not a Retool competitor and operate in very different spaces, I would think and hope that this is not an issue for the Retool team

I love mucking around with canvases and videos, so I will certainly be checking this out!

On a selfish note, as a canvas library developer/maintainer, I do have questions around your choice of Motion Canvas: what attracted you to that library in particular (I'm assuming it's the Editor, but could be wrong)?

On a broader note, my main interest in canvas+video center around responsive, interactive and accessible video displays in web pages. Have you had any thoughts on how you'd like to develop Revideo to support these sorts of functionalities?

Glad to hear that! I would say that the choice of Motion Canvas was motivated by their API for defining animations rather than the editor - we really like the approach of using generator functions and find the "procedural" API (the time of the yield corresponds to the time in the video) quite nice to work with.

Given that our goal is mainly to let developers build their own editors, the Motion Canvas editor is not that important for us - we only use it for previewing code changes, so merely projecting the canvas without any of the remaining editor interface would also be sufficient.

I also agree that interactivity is super important. We have not yet started to work on this, but something we definitely need to make easier with the Revideo player is building drag-and-drop editing features (i.e. moving elements around on the canvas to modify their position).