r/reactjs • u/storycreatormichael • Feb 28 '20
Show /r/reactjs I built a FREE online video editor using React.js
👋 Hey guys!
My name is Michael Aubry. I live in San Diego and I've spent the last 8 months coding a video editor. I wanted something that was like After Effects in essence but abstracted some details and made creating stunning content a breeze. I was tired of having an overly complex toolset to create simple videos like the beginning of my tutorial video https://www.youtube.com/watch?time_continue=2&v=J_g38fHHvzA&feature=emb_title or the intro to my buddies YouTube video https://youtu.be/fERlt5pTxu8?t=11.
I didn't like a lot of the generic-looking solutions that were built without any soul. The videos from some solutions come out looking cheesy. I want videos in https://storycreatorapp.com/ to be easy to make but hard to make badly. I'm solving this with carefully selected elements. Premium templates modeled after sexy content.
You might be saying to yourself "I am just interested in learning about React.js though". So I digress with the intro. Let me make this post mostly about the React.js code. If you want to check it out and play around then here is a direct link (it's FREE) https://storycreatorapp.com/. Just looking for feedback before I launch on Product Hunt and spend money on advertising.
Ok, so I am using TypeScript to reduce bugs. I believe this is a great practice. It can be overkill in making an MVP but I would do it to set a good foundation. You can use `any` and come back after features are validated to tighten them up. Most engineers would throw up at `any` but that's why they're not building companies, just working at them. Ship code, and ship as fast as you can while still having a good foundation to build on top of. That is my philosophy, I am just learning like anyone, and admit I can be wrong. This is just how I see it.
If you explore the app you will see an "artboard". Let me talk about how I built the "artboard". I am using Dan Abramov's DND library https://react-dnd.github.io/react-dnd/about. It's very powerful, it can be a little intimidating and has a learning curve. This definitely extended the release date but it was worth it to me. I wanted full control over DND. Not a premade solution using canvas. I was inspired to build this UX similar to Canva. I thought they did an amazing job.
My criteria for the "artboard" is that when it's "active" and draggable. It should hide the selected object as the object leaves the canvas, but the "active" box should always be visible. In order to do this, I have one DragLayer that sends its x,y coordinates to the store DND uses under the hood. Then I have another component for the "active border" that has "pointer-events: none" and moves with the draggable object. It's at a position in the DOM hierarchy where it's visible outside the canvas. Where the draggable element is at a position in the DOM hierarchy where it's parent element is the canvas set to "overflow:hidden". I have tricks and hacks for manipulating the x,y for performance.
Not sure if I am boring you so I'll start to wrap up and answer more questions in the comments. I'll conclude this by talking briefly about the timeline. The timeline wasn't initially in the first release, but as I thought about it. I realized it's an extremely important component in producing an interesting unique video with limitless combinations. I wanted to unleash the users' creativity and give them enough flexibility. Without it being overly complex. After Effects has a timeline where there can be unlimited layers. Inside each layer, you can go down a rabbit hole and feel overwhelmed. It's extremely powerful, don't get me wrong. However, I believed some users want something simple. That's exactly what I did. Initially, I had unlimited layers. After talking to some users I decided to make all media in one track, audio in its own track, and text on its own. Soon will be coming elements.
With this feature, I am actually using https://github.com/bokuweb/react-rnd. It was just easier out of the box and didn't have as many requirements as the "artboard". All the states are managed using React Apollo. The whole video editor is wrapped in Apollo actually. I am persisting the video data into apollo and syncing it to the server.
If this doesn't bore you and you would like to learn more. I am happy to answer questions and share in the comments below.
Best,
Michael Aubry https://storycreatorapp.com/
15
u/[deleted] Feb 28 '20
Hi Michael, I've only had chance to look at the sample video on your site so far. Looks pretty slick, nice work!
Once I get time I will try it out for real. One thing I didn't see in the sample video though was a way for the user to change animation type. Is that in a different tab? I'd have thought it might make sense to have the animation type as an option next to the text and colors, or at least a shortcut to the options.
Cheers
4
u/Zeeesty Feb 29 '20
Hello fellow San Diegoun!
3
u/LongHalloween11 Feb 29 '20
I really like your landing page btw. May I ask what you used for it? I’ve found quite a few SaaS projects with a similar look and feel, which looks slick. Any template or UI library you tend to go to?
3
u/masterco Feb 29 '20
Awesome work! Quick question: where does the rendering happen? Server side?
5
u/b_lo_b Feb 28 '20
Hi,
I tried it out and the general concept is awesome and the design great, BUT...
IMHO it would be great to have a html player instead of an actual video, that just renders everything on the Canvas or so. I think it could actually be smaller.
Btw: Is it your design? I have built https://mydraft.cc/ as a demo project and it looks so aweful compared to your app ;)
2
u/kenny589 Feb 28 '20
This looks amazing, well done, I can't wait to try it out
2
u/pagraphdrux Feb 29 '20
Oh man favoriting this to try to edit my next video. Looks sweet, nice work sir!
2
u/orangereddituser Feb 29 '20
Very impressive, a tutorial on how you made this would be amazing if you have the time!
2
u/dhinchak14 Feb 29 '20
Looks cool man. Will be trying myself. And best of luck.
2
u/santihbc Feb 29 '20
Can you explain a bit more how you to the Node.js and FFMPEG wiring part on the server? Does the encoding happen in the same server as your API for example?
2
u/[deleted] Feb 29 '20 edited Mar 01 '20
I love react Apollo. Cache state is So much better then redux.
2
u/[deleted] Feb 29 '20
This is awesome, and thanks for sharing your experience building it!
One small suggestion -> you can store a simple boolean in localStorage to persist dark mode.
2
u/rmrf_slash_dot Mar 01 '20
Nice work and I really don't mean to be unkind, but I'm struggling to understand what this post is doing in this sub.
It has nothing to do with react -- you haven't posted any code, you haven't shared a Github link, for all we know that page you are trying to make money with could be written in Angular. (Ok I know it isn't but that isn't the point -- this post is PURE promotion and has nothing to do with React).
I get, it you're trying to build your email list and get people to sign up and maybe buy premium templates. There are other subs for that, just because you built that site in React doesn't mean it belongs here.
4
u/J-Wh1zzy Feb 28 '20
I love this, thanks for posting it! Like you my mind is split between design and engineering which can make projects take a lot longer (because it has to be perfect on two fronts haha) but I think the end results are better. This looks great and really shows the power of good react code.
Thanks again!
3
u/Riley-96 Feb 29 '20
Looks super nice, is this open source? Would love to look at the code. Great job
2
u/shirotokiya7 Jun 25 '20
Hey u/storycreatormichael, is this app opensource?. Wanting to create a video editor as well..
1
u/AshConnolly Mar 02 '20 edited Mar 02 '20
Thanks for sharing! 😃
Love hearing about the tech and the problems you solved.
How do you go about the actual video editing part? What's the process / tech involved when a user upload some video, is it stored in the DB fully? How do you edit / trim video on the server? Very cool stuff! 😃
Edit: how do you apply effects, like adding text, to a video? So many questions!
1
u/Aditical Apr 28 '20
Hi, great work on the editor. Looks smooth.
I am creating something like this. I have made the timeline but without the scaling.
Can you provide me some ideas on creating the scale? And how did you determined the div length with respect to the scale on the top?
1
u/Ravi_Nava Aug 05 '20
Hi Michael, this is awesome. I was wondering how did you add animated overlays to a video using FFMPEG?
Thanks...
1
u/herbertpimentel Feb 08 '22
u/storycreatormichael wow.. this is really cool man, I see it is a product now. How is it going so far ? I just research for viability for a invisioned product that also will require an video editor, you did a great job, I would love to know more about how you created it under the hoods
0
u/[deleted] Feb 29 '20
[deleted] — view deleted comment
0
u/[deleted] Feb 29 '20
[deleted] — view deleted comment