ff-helper
Version:
ffmpeg helper by napi-rs binding
64 lines (42 loc) • 1.7 kB
Markdown
# ff-helper
> ffmpeg helper by napi-rs binding
[](https://github.com/magicdawn/ff-helper/actions/workflows/ci.yml)
[](https://codecov.io/gh/magicdawn/ff-helper)
[](https://www.npmjs.com/package/ff-helper)
[](https://www.npmjs.com/package/ff-helper)
[](http://magicdawn.mit-license.org)
## Install rust toolchain
This binding will link against system installed ffmpeg(libavcodec libav\*). <br />
It will run cargo build when install, make sure you have rust toolchain installed.
## Install ffmpeg lib
### macOS
```sh
brew install pkg-config ffmpeg nasm
```
### On Debian-based systems
```sh
apt install -y clang libavcodec-dev libavformat-dev libavutil-dev pkg-config
```
more see https://github.com/zmwangx/rust-ffmpeg/wiki/Notes-on-building
## Install
```sh
$ pnpm add ff-helper
```
## API
see typedoc https://magicdawn.github.io/ff-helper/
### get video info
```ts
export declare async funciton getVideoInfo(file: string): Promise<VideoInfo>;
export interface VideoInfo {
/** degress, 0-360, counterclockwise */
rotation: number
/** millseconds */
duration: number
width: number
height: number
}
```
## Changelog
[CHANGELOG.md](CHANGELOG.md)
## License
the MIT License http://magicdawn.mit-license.org