Why write this article

It’s a bit clickbait. Recently, I saw some video editing tools, which seemed very complicated, but in fact, it is relatively simple to implement some basic functions. The core here is video editing and adding corresponding copywriting to the video. Of course, there are many more functions that can be implemented.

Related knowledge points

  • Ffmpeg – Audio and video processing tool This tool is the core, other functions actually rely on this tool.

The effect

The screenshot effect blacked out the content, not the video content.

  • To add text

  • Generate a new video

You can see it in the video

Implementation flowchart

This is the main flow chart, and a lot of the links are fixed in the code for convenience.

Video to sequence frame + extract audio

Canvas draws sequence frames

Here it is relatively simple to draw the picture through canvas, and then we can add corresponding text and so on to canvas. Finally, canvas-> Base64 -> BLOb -> Upload server -> overwrite the original sequence frame

Sequence Frame + Audio => Composite video

This is very simple, using FFMPEG to convert pictures and audio and video to video

More features

Ffmpeg can also perform audio and video time clips, in fact, that is to execute ffMPEG commands. I won’t go into too much detail here.

conclusion

In fact, the core is how to edit videos as pictures through canvas, and FFMPEG tool is used to realize this function. In fact, it will be very easy to realize other points along this point, and we can operate videos as a bunch of pictures. That way we can achieve a lot of things. Time is tight and the writing is rough. thank you