Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A lightweight and fast short video processing library based on node.js

License

NotificationsYou must be signed in to change notification settings

drawcall/FFCreatorLite

Repository files navigation

English |简体中文

NPM VersionPackage LicenseTravis CICode StylePRsNode Version

Overview

FFCreatorLite is a lightweight and flexible short video processing library based onNode.js. You only need to add some pictures, music or video clips, you can use it to quickly create a very exciting video album.

Nowadays, short video is an increasingly popular form of media communication. Likeweishi andtiktok is full of all kinds of wonderful short videos. So how to make users visually create video clips on the web easily and quickly. Or based on pictures Text content, dynamic batch generation of short videos is a technical problem.

FFCreatorLite is developed based on the famous video processing libraryFFmpeg, and splicing the complicated and tedious command line parameters ofFFmpeg (this is not so easy), usingFFmpeg various filters and features to realize animation And video clips and generate the final movie. So its processing speed is beyond your imagination, even faster thanFFCreator.

For more introduction, please seehere

Features

  • Based on node.js development, it is very simple to use and easy to expand and develop.
  • Only rely onFFmpeg, easy to install, cross-platform, and low requirements for machine configuration.
  • The video processing speed is extremely fast, a 5-7 minute video only takes 1 minute.
  • Supports multiple elements such as pictures, sounds, video clips, and text.
  • Support for adding music and animation to the live stream before launching.
  • The latest version supports more than 30 scene transition animations.
  • Contains 70% animation effects ofanimate.css, which can convert css animation to video.

Demo

Useage

Install npm Package

npminstallffcreatorlite--save

Note: To run the preceding commands, Node.js and npm must be installed.

Node.js

const{ FFCreatorCenter, FFScene, FFImage, FFText, FFCreator}=require('ffcreatorlite');// create creator instanceconstcreator=newFFCreator({  cacheDir,  outputDir,width:600,height:400,log:true,});// create FFSceneconstscene1=newFFScene();constscene2=newFFScene();scene1.setBgColor('#ff0000');scene2.setBgColor('#b33771');// scene1constfbg=newFFImage({path:bg1});scene1.addChild(fbg);constfimg1=newFFImage({path:img1,x:300,y:60});fimg1.addEffect('moveInRight',1.5,1.2);scene1.addChild(fimg1);consttext=newFFText({text:'这是第一屏', font,x:100,y:100});text.setColor('#ffffff');text.setBackgroundColor('#000000');text.addEffect('fadeIn',1,1);scene1.addChild(text);scene1.setDuration(8);creator.addChild(scene1);// scene2constfbg2=newFFImage({path:bg2});scene2.addChild(fbg2);// logoconstflogo=newFFImage({path:logo,x:100,y:100});flogo.addEffect('moveInUpBack',1.2,0.3);scene2.addChild(flogo);scene2.setDuration(4);creator.addChild(scene2);creator.addAudio(audio);creator.start();creator.on('progress',e=>{console.log(colors.yellow(`FFCreatorLite progress:${(e.percent*100)>>0}%`));});creator.on('complete',e=>{console.log(colors.magenta(`FFCreatorLite completed: \n USEAGE:${e.useage} \n PATH:${e.output} `),);});

About Transition

The latest version of ffcreatorlite already supports scene transition animation, which means you can use it to make cool effects like ffcreator.

Of course you need to install4.3.0 above version of ffmpeg. Because here is theXfade filter to achieve Animation.

usage

// https://trac.ffmpeg.org/wiki/Xfadescene.setTransition('diagtl',1.5);
fade (default)fadeblackfadewhitedistance
wipeleftwiperightwipeupwipedown
slideleftsliderightslideupslidedown
smoothleftsmoothrightsmoothupsmoothdown
rectcropcirclecropcircleclosecircleopen
horzclosehorzopenvertclosevertopen
diagbldiagbrdiagtldiagtr
hlslicehrslicevuslicevdslice
dissolvepixelizeradialhblur
wipetlwipetrwipeblwipebr
fadegrayssqueezevsqueezeh

AboutFFCreator

FFCreator is not an enhanced version ofFFCreatorLite, in fact the two implementation principles are completely different. When you need to process a lot of video without special cool transition animation,FFCreatorLite may be a better choice.

Principle difference

  • FFCreator usesopengl to process graphics rendering andshader post-processing to generate transition effects, and finally usesFFmpeg to synthesize the video.
  • FFCreatorLite completely usesFFmpeg filters and other effects, splicingFFmpeg commands to generate animations and videos.

FFCreatorLite has 70% of the functions ofFFCreator, but in some cases the processing speed is faster and the installation is extremely simple. So please choose which version of the library to use according to the actual usage.

The difference between registration points

The default registration point ofFFCreatorLite is the upper left corner and cannot be modified, while the default registration point ofFFCreator is the center and can be modified.

For a more detailed tutorial, please checkhere

Installation

FFCreatorLite depends onFFmpeg, so you need to installFFmpeg

FFCreatorLite depends onFFmpeg>=0.9 and above. Please set FFmpeg as a global variable, otherwise you need to use setFFmpegPath to add FFmpeg native path. (The ffmpeg for windows users is probably not in your%PATH, so you must set%FFMPEG_PATH)

FFCreator.setFFmpegPath('...');

Of course, you can also compile ffmpeg on your machine, please seehttps://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu.

FFmpeg Installation tutorial

For moreFFmpeg tutorials, please viewhttps://trac.ffmpeg.org/wiki

Contribute

You are very welcome to join us in developingFFCreatorLite, if you want to contribute code, please readhere.

License

MIT

About

A lightweight and fast short video processing library based on node.js

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp