Skip to content

Commit

Permalink
feat: added new option called useNativeFFmpeg
Browse files Browse the repository at this point in the history
Closes #262
  • Loading branch information
k-yle committed Jun 1, 2024
1 parent 9caa675 commit d46bce7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- feat: added new option called `useNativeFFmpeg` to bypass the bundled version of ffmpeg
- fix: issue where the video was invisible (#202)

## 1.8.0 (2023-10-31)
Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { version } = require('./package.json');
* verbose?: boolean;
* transport?: 'udp' | 'tcp' | 'udp_multicast' | 'http';
* windowsHide?: boolean;
* useNativeFFmpeg?: boolean;
* }} Options
*
* @typedef {import("express").Application} Application
Expand All @@ -27,7 +28,13 @@ class InboundStreamWrapper {
}

/** @param {Options} props */
start({ url, additionalFlags = [], transport, windowsHide = true }) {
start({
url,
additionalFlags = [],
transport,
windowsHide = true,
useNativeFFmpeg,
}) {
if (this.verbose) console.log('[rtsp-relay] Creating brand new stream');

// validate config
Expand All @@ -40,7 +47,7 @@ class InboundStreamWrapper {
}

this.stream = spawn(
ffmpegPath,
useNativeFFmpeg ? 'ffmpeg' : ffmpegPath,
[
...(transport ? ['-rtsp_transport', transport] : []), // this must come before `-i [url]`, see #82
'-i',
Expand Down

0 comments on commit d46bce7

Please sign in to comment.