diff --git a/examples/VoiceChannel/PlayVideo.js b/examples/VoiceChannel/PlayVideo.js index bb16bcb..09e09de 100644 --- a/examples/VoiceChannel/PlayVideo.js +++ b/examples/VoiceChannel/PlayVideo.js @@ -48,7 +48,6 @@ client.on('ready', async client => { const dispatcher = stream.playVideo(input, { fps: 60, bitrate: 4000, - resolution: '1080', }); const dispatcher2 = stream.playAudio(input); dispatcher.on('start', () => { diff --git a/src/client/voice/player/MediaPlayer.js b/src/client/voice/player/MediaPlayer.js index 90a3332..4a1b36e 100644 --- a/src/client/voice/player/MediaPlayer.js +++ b/src/client/voice/player/MediaPlayer.js @@ -119,22 +119,7 @@ class MediaPlayer extends EventEmitter { if (!options?.fps) options.fps = 30; - const args = [ - '-i', - '-', - '-analyzeduration', - '0', - '-flags', - 'low_delay', - '-quality', - 'realtime', - '-r', - `${options?.fps}`, - ]; - - if (options?.resolution && options?.resolution !== 'maximum') { - args.push('-vf', `scale=-1:${options.resolution}`); - } + const args = ['-i', '-', '-analyzeduration', '0', '-flags', 'low_delay', '-r', `${options?.fps}`]; if (options?.bitrate && typeof options?.bitrate === 'number') { args.push('-b:v', `${options?.bitrate}K`); diff --git a/src/client/voice/util/PlayInterface.js b/src/client/voice/util/PlayInterface.js index 6e72e1c..0bad9a3 100644 --- a/src/client/voice/util/PlayInterface.js +++ b/src/client/voice/util/PlayInterface.js @@ -79,7 +79,6 @@ class PlayInterface { * @typedef {Object} VideoOptions * @property {number} [seek=0] The time to seek to, will be ignored when playing `ogg/opus` or `webm/opus` streams * @property {number} [fps=30] Video fps - * @property {'maximum' | '480' | '720' | '1080' | '1440'} [resolution='maximum'] Resoluion (Height) * @property {number} [highWaterMark=12] The maximum number of opus packets to make and store before they are * actually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to * 1 means that changes in volume will be more instant. diff --git a/src/client/voice/util/Socket.js b/src/client/voice/util/Socket.js index 99c3946..86ccf14 100644 --- a/src/client/voice/util/Socket.js +++ b/src/client/voice/util/Socket.js @@ -29,7 +29,6 @@ class UnixStream { if (process.platform === 'win32') { const pipePrefix = '\\\\.\\pipe\\'; const pipeName = `node-webrtc.${++counter}.sock`; - this.socketPath = path.join(pipePrefix, pipeName); this.url = this.socketPath; } else { @@ -41,7 +40,7 @@ class UnixStream { fs.statSync(this.socketPath); fs.unlinkSync(this.socketPath); } catch (err) { - console.error('UnixStream', err); + // Null } const server = net.createServer(onSocket); @@ -60,4 +59,4 @@ function StreamOutput(stream) { return new UnixStream(stream, socket => socket.pipe(stream)); } -module.exports = { StreamOutput, StreamInput }; +module.exports = { StreamOutput, StreamInput, UnixStream }; diff --git a/typings/index.d.ts b/typings/index.d.ts index f7ed7f6..5b0b153 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -935,7 +935,6 @@ export interface VideoOptions { presetH26x?: 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow'; inputFFmpegArgs?: string[]; outputFFmpegArgs?: string[]; - resolution?: 'maximum' | '480' | '720' | '1080' | '1440'; bitrate?: number | 'auto'; }