https://github.com/native-bindings/ffmpeg
https://github.com/native-bindings/ffmpeg
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/native-bindings/ffmpeg
- Owner: native-bindings
- License: mit
- Created: 2021-09-02T03:06:40.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-02T03:12:10.000Z (almost 4 years ago)
- Last Synced: 2025-02-23T01:51:39.503Z (4 months ago)
- Language: C++
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-ffmpeg
### Installation
```
yarn add node-ffmpeg
```### Usage
```
import {
Codec,
CodecContext,
FormatContext,
constants,
Packet,
Frame,
getBytesPerSample,
CodecParameters,
Rational
} from 'node-ffmpeg';const enc = Codec.findEncoder(constants.AV_CODEC_ID_OPUS);
console.log(enc);const encCtx = new CodecContext(enc);
encCtx.parametersToContext(new CodecParameters({
codecId: constants.AV_CODEC_ID_OPUS,
channels: 1,
channelLayout: constants.AV_CH_LAYOUT_MONO,
sampleRate: 48000,
bitRate: 20000,
codecType: constants.AVMEDIA_TYPE_AUDIO,
format: sampleFormat
}));
encCtx.open(enc);console.log(encCtx.frameSize() === 960)
```