fix connection
This commit is contained in:
@@ -74,6 +74,17 @@ class MediaPlayer extends EventEmitter {
|
|||||||
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
|
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
|
||||||
if (options.seek) args.unshift('-ss', String(options.seek));
|
if (options.seek) args.unshift('-ss', String(options.seek));
|
||||||
|
|
||||||
|
args.unshift(
|
||||||
|
'-reconnect',
|
||||||
|
'1',
|
||||||
|
'-reconnect_at_eof',
|
||||||
|
'1',
|
||||||
|
'-reconnect_streamed',
|
||||||
|
'1',
|
||||||
|
'-reconnect_delay_max',
|
||||||
|
'4294',
|
||||||
|
);
|
||||||
|
|
||||||
const ffmpeg = new prism.FFmpeg({ args });
|
const ffmpeg = new prism.FFmpeg({ args });
|
||||||
streams.ffmpeg = ffmpeg;
|
streams.ffmpeg = ffmpeg;
|
||||||
if (isStream) {
|
if (isStream) {
|
||||||
@@ -135,6 +146,18 @@ class MediaPlayer extends EventEmitter {
|
|||||||
|
|
||||||
if (options.seek) args.unshift('-ss', String(options.seek));
|
if (options.seek) args.unshift('-ss', String(options.seek));
|
||||||
|
|
||||||
|
// Fix connection
|
||||||
|
args.unshift(
|
||||||
|
'-reconnect',
|
||||||
|
'1',
|
||||||
|
'-reconnect_at_eof',
|
||||||
|
'1',
|
||||||
|
'-reconnect_streamed',
|
||||||
|
'1',
|
||||||
|
'-reconnect_delay_max',
|
||||||
|
'4294',
|
||||||
|
);
|
||||||
|
|
||||||
// Get stream type
|
// Get stream type
|
||||||
if (this.voiceConnection.videoCodec == 'VP8') {
|
if (this.voiceConnection.videoCodec == 'VP8') {
|
||||||
args.push('-f', 'ivf', '-deadline', 'realtime', '-c:v', 'libvpx');
|
args.push('-f', 'ivf', '-deadline', 'realtime', '-c:v', 'libvpx');
|
||||||
|
|||||||
Reference in New Issue
Block a user