From d46bce7cc0948e498bf68d16c54970e78b415433 Mon Sep 17 00:00:00 2001 From: Kyle Hensel Date: Sat, 1 Jun 2024 23:22:53 +1000 Subject: [PATCH] feat: added new option called `useNativeFFmpeg` Closes #262 --- CHANGELOG.md | 1 + index.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c73a322..87d9258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/index.js b/index.js index e3c25dd..f475fdf 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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 @@ -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',