Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/native-bindings/ffmpeg
https://github.com/native-bindings/ffmpeg
Last synced: about 2 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-02T03:12:10.000Z (over 3 years ago)
- Last Synced: 2024-10-12T23:07:12.234Z (3 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)
```