https://github.com/emersion/node-fluent-vlc
A fluent API to VLC (https://www.videolan.org/vlc/)
https://github.com/emersion/node-fluent-vlc
Last synced: 4 months ago
JSON representation
A fluent API to VLC (https://www.videolan.org/vlc/)
- Host: GitHub
- URL: https://github.com/emersion/node-fluent-vlc
- Owner: emersion
- License: mit
- Created: 2014-12-15T17:38:01.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-15T19:32:45.000Z (over 11 years ago)
- Last Synced: 2025-01-03T07:14:06.765Z (over 1 year ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fluent VLC-API for Node.js
Inspired from [`fluent-ffmpeg`](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg).
## Installation
Via npm:
```
$ npm install fluent-vlc
```
## Usage
### Prerequisites
You will need VLC to be installed on your system.
If the `VLC_PATH` environment variable is set, it will be used as the full path to the `vlc` executable. Otherwise, it will attempt to call `vlc` directly (so it should be in your `PATH`).
### Creating a VLC command
The fluent-vlc module returns a constructor that you can use to instanciate VLC commands.
```js
var vlc = require('fluent-vlc');
var command = vlc();
```
You may pass an input URL or readable stream, a configuration object, or both to the constructor.
```js
var command = vlc('file:///path/to/file.avi');
var command = vlc(fs.createReadStream('/path/to/file.avi'));
```
### Specifying outputs
#### output(target): set the output
Sets the output of the command. The target argument may be an output filename, a URL or a writable stream (but at most one output stream may be used with a single command).
#### format(format): set output format
```js
vlc('file:///path/to/file.avi').format('flv');
```
#### audioCodec(format, [options]): set output audio codec
```js
vlc('file:///path/to/file.avi').audioCodec('vorb');
```
#### videoCodec(format, [options]): set output video codec
```js
vlc('file:///path/to/file.avi').videoCodec('theo');
```
### Misc
#### addOption(option...): add a custom VLC option
```js
vlc('file:///path/to/file.avi').format('ogg').videoCodec('theo').audioCodec('vorb').addOption('--sout-theora-quality=5', '--sout-vorbis-quality=1');
```