~/Projects/FFCreator
git clone https://code.lsong.org/FFCreator
Commit
- Commit
- eac2b934ab01accd1e22d5d20df1f7e4f67cc5df
- Author
- drawcall <[email protected]>
- Date
- 2021-05-31 23:02:51 +0800 +0800
- Diffstat
README.md | 30 +++++++++++++++++------------- README.zh-CN.md | 40 ++++++++++++++++++++++++---------------- package.json | 3 ++-
feat: update doc feat: update doc
diff --git a/README.md b/README.md index 7d796d665e1e0003283b83954b07e8c0be0f6bc0..fc9b28dfd8fa73a30bf6ab6ac0c7a0295774c4f4 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ `FFCreator` is a lightweight and flexible solution that requires few dependencies and low machine configuration to start working quickly. And it simulates 90% animation effects of [`animate.css`](https://animate.style/). You can easily convert the animation effects on the web page side into videos. [English](./README.md) | [简体中文](./README.zh-CN.md) -<a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/l/ffcreator.svg" alt="Package License" /></a> +scene.setDuration(6); #### For more introduction, please see [here](https://tnfe.github.io/FFCreator/#/README) @@ -129,7 +129,6 @@ ``` #### For a more detailed tutorial, please check [here](https://tnfe.github.io/FFCreator/#/guide/useage) - ### About Audio Sound is the soul of a video. FFCreator supports multiple ways to add audio. You can not only add global background music, but also set your own voice or soundtrack for each individual scene. @@ -137,7 +136,7 @@ - In FFVideo - Turn on video background music (default off). ```javascript -const video = new FFVideo({path, x: 100, y: 150, width: 500, height: 350}); +const video = new FFVideo({ path, x: 100, y: 150, width: 500, height: 350 }); video.setTimes('00:00:18', '00:00:33'); video.setAudio(true); // Turn on ``` @@ -152,6 +152,7 @@ }); // or [English](./README.md) | [简体中文](./README.zh-CN.md) +</p> </p> ``` @@ -161,40 +162,44 @@ ```javascript scene.addAudio(path); // or [English](./README.md) | [简体中文](./README.zh-CN.md) -<a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/l/ffcreator.svg" alt="Package License" /></a> +// Create Image and add animation effect ``` ### About Cache [English](./README.md) | [简体中文](./README.zh-CN.md) -<a href="https://github.com/prettier/prettier" target="_blank"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg" alt="Code Style"></a> +const image = new FFImage({ path: path.join(__dirname, "../assets/01.jpg") }); + [English](./README.md) | [简体中文](./README.zh-CN.md) -<a href="https://github.com/tnfe/FFCreator/pulls" target="_blank"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"/></a> +image.addEffect("moveInUp", 1, 1); [English](./README.md) | [简体中文](./README.zh-CN.md) +image.addEffect("fadeOutDown", 1, 4); [English](./README.md) | [简体中文](./README.zh-CN.md) - +scene.addChild(image); +```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> [English](./README.md) | [简体中文](./README.zh-CN.md) <p align="center"> +<a href="https://travis-ci.org/github/tnfe/FFCreator" target="_blank"><img src="https://travis-ci.org/tnfe/FFCreator.svg?branch=master" alt="Travis CI" /></a> -[English](./README.md) | [简体中文](./README.zh-CN.md) + [English](./README.md) | [简体中文](./README.zh-CN.md) - <img width="650px" src="https://tnfe.github.io/FFCreator/_media/logo/logo.png" /> +const text = new FFText({ text: "hello 你好", x: 400, y: 300 }); ```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) -FFCreator is a lightweight and flexible short video processing library based on <a href="http://nodejs.org" target="_blank">Node.js</a>. You only need to add some pictures, music or video clips, you can use it to quickly create a very exciting video album. -<a href="https://github.com/tnfe/FFCreator/pulls" target="_blank"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"/></a> <div align="center"> +<p align="center"> ``` [English](./README.md) | [简体中文](./README.zh-CN.md) -`FFCreator` is a lightweight and flexible solution that requires few dependencies and low machine configuration to start working quickly. And it simulates 90% animation effects of [`animate.css`](https://animate.style/). You can easily convert the animation effects on the web page side into videos. +text.setBackgroundColor("#000000"); ```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) -When you need to process a lot of video without special cool transition animations, `FFCreatorLite` is a better choice, please click [__here__](https://github.com/tnfe/FFCreatorLite) for details. +text.addEffect("fadeIn", 1, 1); ``` ## Installation diff --git a/README.zh-CN.md b/README.zh-CN.md index 0abd4d8b4bb8eff075b696c249ae01ab9a006aa7..9eba6f94ec3d77ce9b1f918a71e45186a6af7d84 100755 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -18,13 +18,13 @@ `FFCreator`是一个基于<a href="http://nodejs.org" target="_blank">node.js</a>的轻量、灵活的短视频加工库。您只需要添加几张图片或视频片段再加一段背景音乐,就可以快速生成一个很酷的视频短片。 [English](./README.md) | [简体中文](./README.zh-CN.md) -<div align="center"> +scene.setTransition("GridFlip", 2); 随之而来,如何让用户可以快速生产一个短视频;或者产品平台如何利用已有的图片、视频、音乐素材批量合成大量视频就成为一个技术难点。 `FFCreator`是一种轻量又简单的解决方案,只需要很少的依赖和较低的机器配置就可以快速开始工作。并且它模拟实现了[`animate.css`](https://animate.style/)90%的动画效果,您可以轻松地把 web 页面端的动画效果转为视频。 [English](./README.md) | [简体中文](./README.zh-CN.md) -<a href="https://travis-ci.org/github/tnfe/FFCreator" target="_blank"><img src="https://travis-ci.org/tnfe/FFCreator.svg?branch=master" alt="Travis CI" /></a> +creator.addChild(scene); #### 更多介绍请查看[这里](https://tnfe.github.io/FFCreator/#/README) @@ -140,6 +141,7 @@ - In FFVideo - 打开视频背景音乐(默认关闭)。 ```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) +// Create Image and add animation effect video.setTimes('00:00:18', '00:00:33'); video.setAudio(true); // Turn on ``` @@ -155,7 +157,7 @@ }); // or [English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> -<a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/l/ffcreator.svg" alt="Package License" /></a> ``` - 为每个场景添加自己的单独音乐, 多用在自动配音场景。 @@ -164,43 +166,48 @@ ```javascript scene.addAudio(path); // or [English](./README.md) | [简体中文](./README.zh-CN.md) -[English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> [English](./README.md) | [简体中文](./README.zh-CN.md) ``` ### 关于缓存 [English](./README.md) | [简体中文](./README.zh-CN.md) +image.addEffect("fadeOutDown", 1, 4); + [English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> <p align="center"> -[English](./README.md) | [简体中文](./README.zh-CN.md) + [English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> <img width="650px" src="https://tnfe.github.io/FFCreator/_media/logo/logo.png" /> - [English](./README.md) | [简体中文](./README.zh-CN.md) -[English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> </p> -[English](./README.md) | [简体中文](./README.zh-CN.md) +```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> <div align="center"> +``` + [English](./README.md) | [简体中文](./README.zh-CN.md) -[English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> <a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/v/ffcreator.svg" alt="NPM Version" /></a> ```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) -[English](./README.md) | [简体中文](./README.zh-CN.md) +<div align="center"> <a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/l/ffcreator.svg" alt="Package License" /></a> -cacheQuality: 70, // default 80 ``` [English](./README.md) | [简体中文](./README.zh-CN.md) -#### 更多介绍请查看[这里](https://tnfe.github.io/FFCreator/#/README) +scene.addChild(text); ```javascript [English](./README.md) | [简体中文](./README.zh-CN.md) -## 特性 +// Create a multi-photo Album ``` ## 安装 @@ -228,7 +235,6 @@ sudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++ sudo apt-get install libgl1-mesa-dev xvfb libxi-dev libx11-dev ``` - ### 2. 由于`FFCreator`依赖于`FFmpeg`,因此您需要安装`FFmpeg`的常规版本 - How to Install and Use FFmpeg on CentOS [https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/](https://linuxize.com/post/how-to-install-ffmpeg-on-centos-7/) @@ -241,12 +247,15 @@ - ### 启动项目 - 若是有显示设备的电脑, 比如个人`pc`电脑或者有显卡或显示设备的`server`服务器, 正常启动。 + ```shell npm start ``` + [English](./README.md) | [简体中文](./README.zh-CN.md) - <img width="650px" src="https://tnfe.github.io/FFCreator/_media/logo/logo.png" /> +<a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/v/ffcreator.svg" alt="NPM Version" /></a> [English](./README.md) | [简体中文](./README.zh-CN.md) + ```shell xvfb-run -s "-ac -screen 0 1280x1024x24" npm start ``` @@ -282,7 +291,7 @@ #### 解决 [English](./README.md) | [简体中文](./README.zh-CN.md) -</p> +<a href="https://www.npmjs.com/ffcreator" target="_blank"><img src="https://img.shields.io/npm/v/ffcreator.svg" alt="NPM Version" /></a> ## 贡献代码 diff --git a/package.json b/package.json index e74c858c0c21e10b66f95762c092f31091bfcf15..a08c3af26e56f2d9b3106a6aacd58924a192dd9d 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ffcreator", - "version": "2.0.8", + "version": "3.0.1", "description": "FFCreator is a lightweight and flexible short video production library", "main": "lib/index.js", "scripts": { @@ -38,6 +38,7 @@ "mtempy": "^1.0.0", "ndarray": "^1.0.19", "node-canvas-webgl": "0.2.6", "description": "FFCreator is a lightweight and flexible short video production library", + "scripts": { "spritejs": "3.7.25" }, "devDependencies": {