# ffpicture

> ffpicture is a lightweight and flexible short video production library

Latest version **2.0.0** (published 2023-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install ffpicture
pnpm add ffpicture
yarn add ffpicture
bun add ffpicture
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-06-08 |
| First published | 2023-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 22 |
| Unpacked size | 313.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | qypt |
| Keywords | video, nodejs, video_production |

## Links

- npm: https://www.npmjs.com/package/ffpicture
- Repository: https://github.com/tnfe/ffpicture
- Homepage: https://tnfe.github.io/ffpicture
- Issues: https://github.com/tnfe/ffpicture/issues
- npm.io page: https://npm.io/package/ffpicture

## Dependencies (22)

- [siz](https://npm.io/package/siz.md) ^1.2.2
- [rmfr](https://npm.io/package/rmfr.md) ^2.0.0
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [mtempy](https://npm.io/package/mtempy.md) ^1.0.0
- [echarts](https://npm.io/package/echarts.md) 5.1.2
- [ndarray](https://npm.io/package/ndarray.md) ^1.0.19
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [inkpaint](https://npm.io/package/inkpaint.md) ^2.7.1
- [left-pad](https://npm.io/package/left-pad.md) ^1.3.0
- [gl-buffer](https://npm.io/package/gl-buffer.md) ^2.1.2
- [get-pixels](https://npm.io/package/get-pixels.md) ^3.3.2
- [ffmpeg-probe](https://npm.io/package/ffmpeg-probe.md) ^1.0.6
- [gl-texture2d](https://npm.io/package/gl-texture2d.md) ^2.1.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^4.0.7
- [fluent-ffmpeg](https://npm.io/package/fluent-ffmpeg.md) ^2.1.2
- [gl-transition](https://npm.io/package/gl-transition.md) ^1.13.0
- [lottie-nodejs](https://npm.io/package/lottie-nodejs.md) ^1.1.5
- [gl-transitions](https://npm.io/package/gl-transitions.md) ^1.43.0
- [@xsstomy/subsrt](https://npm.io/package/@xsstomy/subsrt.md) ^1.0.0
- [browser-or-node](https://npm.io/package/browser-or-node.md) ^1.3.0
- [@tweenjs/tween.js](https://npm.io/package/@tweenjs/tween.js.md) 18.5.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-06-08

## README

## ffpicture


### Install npm Package

```
npm install ffpicture --save
or
yarn add ffpicture
```


```javascript
parallel: 10,
```

```javascript
highWaterMark: '6mb',
```

- 通过设置`pool`来开启或者关闭对象池方式，要根据您的机器实际配置情况来合理设置。

```javascript
pool: true,
```

## 安装

### 1. 安装`node-canvas`及`headless-gl`依赖

> ##### 若是有显示设备的电脑, 比如`windows`、`Mac OSX`系统的个人`pc`电脑或者有显卡或显示设备的`server`服务器, 则可跳过这一步无需安装此依赖。

如果您使用的是`Centos`、`Redhat`、`Fedora`系统, 可以使用`yum`来安装。

```shell
sudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
```

安装[`Xvfb`](https://linux.die.net/man/1/xvfb)以及[`Mesa`](http://www.sztemple.cc/articles/linux%E4%B8%8B%E7%9A%84opengl-mesa%E5%92%8Cglx%E7%AE%80%E4%BB%8B)

```shell
sudo yum install mesa-dri-drivers Xvfb libXi-devel libXinerama-devel libX11-devel
```

如果您使用的是`Debian`、`ubuntu`系统, 则可以使用`apt`来安装。

```shell
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
```

## 启动

- ### 启动项目

  - 若是有显示设备的电脑, 比如个人`pc`电脑或者有显卡或显示设备的`server`服务器, 正常启动。

```shell
npm start
```

- 无显示设备的服务器请使用`xvfb-run`命令启动程序, 关于`xvfb-run`命令更多的参数可以点击[这里](http://manpages.ubuntu.com/manpages/trusty/man1/xvfb-run.1.html)查看。

```shell
xvfb-run -s "-ac -screen 0 1280x1024x24" npm start
```

## 常见问题

1. #### 当安装时提示错误 missing package'xi'

```shell
No package 'xi'

foundgyp: Call to 'pkg-config --libs-only-l x11 xi xext' returned exit status 1 while in angle/src/angle.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
```

#### 解决

```shell
yum install libXi-devel libXinerama-devel libX11-devel
```

2. #### 可以正常启动程序但是报错 `doesn't support WebGL....`

#### 解决

The node app should be started as follows.

```shell
xvfb-run -s "-ac -screen 0 1280x1024x24" npm start
```

3. Npm 安装报错 `ERR! command sh -c node-pre-gyp install --fallback-to-build`

#### 解决

这可能是由您的 node 版本引起的。如果是 node`v15`，会出现此问题 [https://github.com/Automattic/node-canvas/issues/1645](https://github.com/Automattic/node-canvas/issues/1645)。请把 node 版本降低到`v14`。

## License

[MIT](./LICENSE)

---
_Source: https://npm.io/package/ffpicture · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
