npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ffcreatorlite

v2.5.1

Published

FFCreatorLite is a lightweight and flexible short video production library

Downloads

225

Readme

English | 简体中文

Overview

FFCreatorLite is a lightweight and flexible short video processing library based on Node.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. Like weishi and tiktok 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 library FFmpeg, and splicing the complicated and tedious command line parameters of FFmpeg (this is not so easy), using FFmpeg 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 than FFCreator.

For more introduction, please see here

Features

  • Based on node.js development, it is very simple to use and easy to expand and develop.
  • Only rely on FFmpeg, 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 of animate.css, which can convert css animation to video.

Demo

Useage

Install npm Package

npm install ffcreatorlite --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 instance
const creator = new FFCreator({
  cacheDir,
  outputDir,
  width: 600,
  height: 400,
  log: true,
});

// create FFScene
const scene1 = new FFScene();
const scene2 = new FFScene();
scene1.setBgColor('#ff0000');
scene2.setBgColor('#b33771');

// scene1
const fbg = new FFImage({ path: bg1 });
scene1.addChild(fbg);

const fimg1 = new FFImage({ path: img1, x: 300, y: 60 });
fimg1.addEffect('moveInRight', 1.5, 1.2);
scene1.addChild(fimg1);

const text = new FFText({ 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);

// scene2
const fbg2 = new FFImage({ path: bg2 });
scene2.addChild(fbg2);
// logo
const flogo = new FFImage({ 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 install 4.3.0 above version of ffmpeg. Because here is the Xfade filter to achieve Animation.

useage

// https://trac.ffmpeg.org/wiki/Xfade
scene.setTransition('diagtl', 1.5);

About FFCreator

FFCreator is not an enhanced version of FFCreatorLite, 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 uses opengl to process graphics rendering and shader post-processing to generate transition effects, and finally uses FFmpeg to synthesize the video.
  • FFCreatorLite completely uses FFmpeg filters and other effects, splicing FFmpeg commands to generate animations and videos.

FFCreatorLite has 70% of the functions of FFCreator, 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 of FFCreatorLite is the upper left corner and cannot be modified, while the default registration point of FFCreator is the center and can be modified.

For a more detailed tutorial, please check here

Installation

FFCreatorLite depends on FFmpeg, so you need to install FFmpeg

FFCreatorLite depends on FFmpeg>=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 see https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu.

FFmpeg Installation tutorial

For more FFmpeg tutorials, please view https://trac.ffmpeg.org/wiki

Contribute

You are very welcome to join us in developing FFCreatorLite, if you want to contribute code, please read here.

License

MIT